MacOSX menu item Quit not working
- Lenguaje dominante
- C
- Estrellas
- 10.9k
- Forks
- 612
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Hi,
First of all, I'd like to say thanks for this amazing library! I've used it in my cross-platform project:
https://gitlab.com/bztsrc/usbimager
which is an extremely small (ca. 256k) compressed disk image writer with a minimalistic GUI. I use libui for Cocoa and for GTK under Linux.
I had issues with linking the provided examples under Windows, so I gave up on that part and implemented win32 myself. Any reason why you've used C++ there instead of C? Just curious, off topic.
I also had some other issues under MacOSX, mostly with multiple threads and progressbars, but I was able to solve them all. There's one thing left though, which is kept reported over and over again. Under MacOSX the menu contains a grayed out Quit and the Cmd+Q shortcut does not work either.
I took a deep dive in the source, and I've found https://github.com/andlabs/libui/blob/master/darwin/menu.m#L176 which looks okay to me and also has the keybinding set. Yet Quit is not working. I don't use multiple windows, I don't need user defined menu items, nothing extra. I've found a ticket on the Go version with exactly the same problem, and it was closed pointing to issue #321. However there's no explanation in that issue on how to enable Quit.
So may question is, what I'm doing wrong? How should I change the code to have a working Quit menu item? Here's my code: https://gitlab.com/bztsrc/usbimager/-/blob/master/src/main_libui.c#L440
Do I need some special option or something? (However I did not see any "if"s in "makeMenubar" nor in "buildApplicationMenu"). If I need to add a Quit item manually, how can I do it? "uiMenuAppendQuitItem" requires an uiMenu pointer, but I don't want to call "uiNewMenu", as it has to be added to the already existing application menu. What is the correct way to do this?
Thanks for this awesome library,
bzt
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.