Window Resizing and Browser APIs #810
-
I'm moving a project from NW.js to Wails. I was using Tauri, but the websockets only work with a secure server even on a local host. But, I was able to get it to work okay in Wails. Now, I want to dynamically change window size based on the main container size. But, I don't see any API for changing window size. Is this possible? Also, it seems the ResizeObserver API isn't supported. What browser APIs are supported? Is there a list somewhere? Also, how do you do a tray icon? I think xBar is using Wails and has a tray icon, but I don't see anything in the docs. Will I need to use a separate go library? Thanks for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Okay, I figured out how to resize with |
Beta Was this translation helpful? Give feedback.
-
I also found out that V2 has what I need for menu tray icons and such. Should I go ahead and build with v1 and then migrate to V2 when it's at least beta quality, or is it better to just jump in and make it V2. I'm currently only using straight JS/HTML/CSS and the minimal go for launching it (it still had the hello example). I'm just now getting into doing Wails specific items (refactoring has been taking me a while). |
Beta Was this translation helpful? Give feedback.
-
Hey there! Thanks for your messages. V1 is using a fairly old webview so the options may be limited in terms of API support. The v2 situation is....interesting. Xbar does indeed use a v2 version and does indeed support menu trays and icons so you are welcome to build against that branch ( |
Beta Was this translation helpful? Give feedback.
-
Thanks. How do you migrate to v2-alpha-xbar? Do I have to first remove the v1 binaries and then compile v2-alpha-xbar and recreate the directory? And the move over my current code? |
Beta Was this translation helpful? Give feedback.
Hey there! Thanks for your messages. V1 is using a fairly old webview so the options may be limited in terms of API support. The v2 situation is....interesting. Xbar does indeed use a v2 version and does indeed support menu trays and icons so you are welcome to build against that branch (
v2-alpha-xbar
) if it satisfies your needs. Be aware though that to ensure v2 has parity across the 3 platforms, it is unlikely menu trays will be supported, even on Mac for the v2 release. However, that branch will stay and of course that may be fine for you. The intent is to add tray menus after v2, which for Mac will be easy, but that will be a post v2 option. As a side note, the way v2 works has change…