giu
giu copied to clipboard
Popup Window outside the Master Window
What happend?
I created a Master Window with a Popup Modal inside. And I am able to drag it anywhere on the screen. I dont know if this is intended or a bug :D
Code example
main.go
package main
import g "github.com/AllenDang/giu"
func loop() {
Window := g.SingleWindow()
Window.Layout(
g.PopupModal("Popup Modal").Layout(
g.Label("This is a popup modal"),
g.Button("Close").OnClick(func() {
g.CloseCurrentPopup()
}),
),
g.Row(
g.Button("Open Popup Modal").OnClick(func() {
g.OpenPopup("Popup Modal")
}),
),
)
}
func main() {
wnd := g.NewMasterWindow("Cloud - Universal", 750, 500, g.MasterWindowFlagsNotResizable)
wnd.Run(loop)
}
To Reproduce
- Run my demo
- Drag the Window around
- See its outside Master Window
Version
master
OS
Windows 11
It is docking branch of imgui, idk how to disable it tbh. Ill need to check
@OfflinePing I've checked out and added it on wiki: https://github.com/AllenDang/giu/wiki/FAQ#windows
Q: I can drag my Window out of the MasterWindow! I don't want that!
A: This is a new Dear ImGui feature from the docking branch that is enabled by default in cimgui-go.
To disable it, do the following after NewMasterWindow:
io := imgui.CurrentIO()
io.SetConfigFlags(io.ConfigFlags() & ^imgui.ConfigFlagsViewportsEnable)