-
Notifications
You must be signed in to change notification settings - Fork 4
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
MasterWindow.Run wait for events? #1
Comments
@millerlogic Thanks for your advice. I'm wrapping more widgets right now. After that I will try to implement this. |
@AllenDang There is a PR in imgui main repo ocornut/imgui#2749 |
@Nicify Thanks for the information! |
@Nicify I implemented it in imgui version, and it works like magic!!!! |
@AllenDang Wow, great job! |
I like this project very much, especially the UI style. At present, this project is just in its infancy. I would like to support this project with bitcoin😊 |
@l0v3R0bber Thanks! But gimu has a very big issue on the auto-generated cgo wrapper side which will cause random crash. It's nearly unable to fix at this moment unless I manually wrap all nuklear API in future. |
hi @AllenDang ,i have got some problem. |
func AboutMsgBox(w *gimu.Window) {
gimu.SetFont(w.MasterWindow().GetContext(), customFont)
opened := w.Popup("关于本程序", nk.PopupStatic, nk.WindowTitle|nk.WindowNoScrollbar|nk.WindowClosable, nk.NkRect(30, 10, 300, 100), func(w *gimu.Window) {
w.Row(25).Dynamic(1)
// Custom font
w.Label("本程序由 sndnvaps<sndnvaps@gmail.com>开发", "LC")
buttonState := w.Button("关闭")
if buttonState {
showAboutPopup = false
w.ClosePopup()
}
gimu.SetFont(w.MasterWindow().GetContext(), w.MasterWindow().GetDefaultFont())
})
if !opened {
showAboutPopup = false
}
} // Menu 3
w.Menu("Help", "CC", 100, 100, func(w *gimu.Window) {
w.Row(25).Dynamic(1)
state := w.Button("关于")
if state {
showAboutPopup = true
}
if showAboutPopup {
AboutMsgBox(w)
}
}) this code will cause app crash |
@sndnvaps I strongly suggest to use github.com/AllenDang/giu instead of gimu. Because gimu has random crash issue that I cannot fix at the moment. |
ok,thanks. |
Hi,
It looks like it runs at 30 fps regardless of what's going on, but if it used WaitEvents it could allow saving CPU cycles and battery. PostEmptyEvent could be used to break out of the WaitEvents for exit or updates.
This makes UI updates somewhat more difficult, requiring an explicit update call to invalidate the current display and force update, but this is fairly common in GUIs. Or at least it seems like a tradeoff the application might want to make.
The text was updated successfully, but these errors were encountered: