-
-
Notifications
You must be signed in to change notification settings - Fork 135
FAQ
In this chapter you find many issues, new users may face with.
Work in progress! Feel free to post any suggestions in this issue
Q: What is Master Window (giu.MasterWindow
)?
A: Master Window is a native application window in you OS.This is hosted (currently)
by GLFW. Master window is a workspace for imgui windows created by giu.
Q: Is there a way to open two (or more) Master Windows?
A: No. Current implementation does not allow to have more than one native windows in paralel.
You can however have many imgui windows.
Q: What is Run function? A: It is the most important method of "MasterWindow". You use this to specify, which function should be treated as loop function.
Q: So what is the loop
function?
A: This function is responsible for doing everything about imgui.
Its may task is to draw widgets that will be visible in MasterWindow.
For more details, refer to examples
Q: How to close Master Window from code?
A: There is (*MasterWindow).Close()
method. You can also use (*MasterWindow).SetShouldClose(true)
Q: How to use (*MasterWindow).SetCloseCallback
?
A: Use it before calling Run
. func() bool
argument, is a callback
called, whnever window needs to be closed (by user of via SetShouldClose).
Return value of this callback says, whether the window really should be closed.
If false
is returned, window remains opened.
Q: My app is refreshed only when I move my mouse type something, so my constantly changing Widgets doesn't work
A: Giu implements Power Saving Mode. UI is not re-rendered if no event happens. To baypass
this, you need to call giu.Update()
whenever you want to redraw UI.
Q: How to handle double-click event on any widget?
A: To do this, you simply need to use EventHandler
giu.Button("Double-click me"),
giu.Event().OnDClick(giu.MouseButtonLeft, func() {fmt.Println("I was double clicked!")}),
Q: How to use popups? I can't open them anyhow...
A: Generally poups are being refactored. Some useful information you can find in
this issue
If you find anything you'd like to talk about in reference to this wiki, Don't hesitate to hit dedicated Discussion