-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Multiple Windows #1480
Comments
Can you also support custom dialog windows as an |
Hey @KiddoV - what's driving this requirement? Is it Webview2 showing light dialogs in dark mode? That's a known bug on their end. If not, please open another ticket so we don't mix up the conversation 👍 |
@leaanthony no, I was just wondering if we can have a way to customize the dialog boxes like a message box using So, instead of: I know, I know... that I can make a |
Some people wouldn't agree 😄 but having the option is good. |
+1 |
Yes, this would unlock the true potential of wails. 💪 I discovered wails today and super pumped to learn and create. Thanks for this excellent effort. |
genuinely looking forward to this, something like this would be a lifesaver especially for a screenshotting tool |
期待支持多窗口 |
To support multiple windows, I'm treating each window as a different executable. My project structure looks like this
1 - The screens are opened via cmd inside the executables.
This is a simple and limited solution, but it suits my use case. |
@santanamic Why didn't I think of this! :) I tried this just now in my Mac and realised that this created two apps in the taskbar. For example: Do you have a way to make it not do this? |
@santanamic To give context, this is what I did to the template app. Please ignore the messy code; it is written to confirm my understanding. // Greet returns a greeting for the given name
func (a *App) Greet(name string) string {
dir, err := os.Getwd()
if err != nil {
fmt.Println(err.Error())
}
fmt.Println("directory=", dir)
err = exec.Command(dir + "/kuit").Run()
if err != nil {
fmt.Println(err.Error())
}
return fmt.Sprintf("Hello %s, It's show time!", name)
} |
@aneeskA You can open a native webview window.
The problem is the fixed URL bar window.open accepts some parameters. Most unfortunately don't work. |
You can also reopen the current window. 😅 cmd := exec.Command(path+"\self.exe", "-screen=editor") The screen argument must receive the name of the view and do the proper logic for execution. This way it is possible to work with only 1 executable. I hadn't noticed this simplicity. I believe Multiple Windows support can be based on this? @leaanthony @aneeskA Please if this runs successfully on the mec let me know. |
Great workaround 👍 Multiple window support will allow more than 1 window to be displayed at once. Is there any reason you prefer to relaunch the app instead of just swapping out the view? |
I need for the following components 1 - Home screen/Splash screen 2 - Custom Dialogs, Configuration Forms and a Log Console 3 - Open a custom HTML outside the main editor |
I just now tried it and it is not working as we expected in my Mac. |
I am not sure if I understood "swapping out the view", but for me I need multiple windows to be able to do separate but related things in different windows something like a browser allows me to do. Put different but related stuff side by side to analyse data. |
This would be great. I think all I really need is a way to open a window with window options that opens to a particular HTML file. A way to control the window would be good too (close it, move it, hide it, etc). I'd mainly be using these for displaying logs alongside the main application, giving the user a way to provide more information (like a form), and customize the main app (like an options pane). I think it'll be useful if windows have access to other windows, so for example the new window could change what the main window is doing. |
I want to have two web views in one window, allowing me to show an external website. Many sites block iframe usage, and I assume that's true with something like Wails. I have two use cases. One use case is a live-reload app that will run a Go web app and rebuild, then reload it when something changes. This is possible with an iframe but doesn't allow me to read things like the page title or to use JavaScript to reload the page. The workaround is to use a reverse proxy. The other is a hacker news client, where I'd like to show the comments with the linked external website. I can move this comment elsewhere if this is out of scope for Multi-Windows. |
@mholt - I think this will be fairly trivial once we refactor out the current window code and make it more programmatic, as per the system tray API. I imagine this being something like:
|
@SamHennessy I'd make that a different request. I think you're wanting more flexibility around containers within the same window? |
I have another use case. I could use a single view but I will need to manage window properties and focus as there are other wayland surfaces that are rendering other applications.. |
So I want to port a web app I was working on to Wails. One of my use cases is the ability to enter markdown in text areas. But I also provide the ability to edit the markdown in a full blown editor window that launches as a separate named tab and writes the result to local storage and sends a closed event to the launching tab when done. Then the launching tab fetches the modified markdown and replaces the text area with the new markdown. Being able to launch a separate editor window that allows communication between the two windows would be fantastic. |
Hey @steowens - this is absolutely happening but be aware that the current API is really geared around 1 window, and that affects everything. For multiple windows, there will unavoidably be an API change but that's a good thing! I have some exciting things to announce soon so stick around 👍 |
support multiple windows +1 |
Please Support multiple Windows:
|
What's PLT? |
I think you mean PLZ? PLZ is please in internet slang |
haha~,Thank you! |
May I ask if there are any new developments? |
A year has passed unknowingly. |
Multiple windows is in v3. If anyone is interested in any updates on this then please feel free to join the discord server. This was a video made 6 months ago as a little demo. If you want to see the source code, just press pause and rewind to the start. multidevtools720.mov |
Is there a popout into second window feature planned? |
Sorry, I'm not sure I understand what you mean. |
In your example it seems that you can spawn only a clone of the root window. |
Those 2 windows are entirely independent and you can have what you like in them. This was just defaulting to an external URL for demo purposes. A lot has happened in 6 months 🚀For more discussion on this, please join the Discord server 👍 |
Is there any ETA for v3? |
No. I imagine Mac/Windows alpha might be out soon... |
Multi window support has been completed for v3. Closing this. |
thanks |
when will v3 release? |
When it's ready. |
Where is it documented? checked next version of docs but can't find new api https://wails.io/docs/next/reference/runtime/window |
|
@leaanthony how would multiple windows communicate with each other , through BroadcastChannel ? window.postMessage ? |
Worth asking on the discord channel rather than this closed ticket 👍 |
@leaanthony sorry ,google search lead me here , did not realize this was closed . |
Is your feature request related to a problem? Please describe.
We'd like to support multiple windows and improve the current window APIs to support it.
Describe the solution you'd like
A window-centric API eg:
The text was updated successfully, but these errors were encountered: