wxDialog + Default Menu Bar on OSX: Quit App?

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Xangis
Earned some good credits
Earned some good credits
Posts: 122
Joined: Fri Apr 14, 2006 9:49 pm
Location: Beaverton, OR
Contact:

wxDialog + Default Menu Bar on OSX: Quit App?

Post by Xangis » Tue Dec 13, 2011 11:41 pm

I have a wxDialog-based application on OSX that shows a single modal dialog window.

My understanding is that a dialog-based app cannot have a menu bar. However, I do get the default system menu bar on the app.

The Cmd-Q option (Quit) shows up on the default system menu bar, but it is grayed out. How can I modify my app to bind to that Cmd-Q option so I can treat it the same as clicking the red button at the top right of my dialog (which exits the app)?
WinVista/7: VC++ .Net 2010 / Ubuntu 11.04: gcc4.4.3 [2.8.12 on all]

User avatar
tierra
Site Admin
Site Admin
Posts: 1339
Joined: Sun Aug 29, 2004 7:14 pm
Location: Salt Lake City, Utah, USA
Contact:

Re: wxDialog + Default Menu Bar on OSX: Quit App?

Post by tierra » Thu Dec 15, 2011 9:10 pm

You should really use wxFrame instead of wxDialog. An application with a single window makes the whole point of making that window modal pretty pointless anyway, and even if it did, you can still configure a wxFrame to be modal.

Post Reply