How is it possible to add menu items to the system menu of a frame in wxPython/wxWidgets?
(I’m talking about the menu that appears when clicking on the application icon in Windows – the one with Minimize, Maximize, Close, …).
I want to add a menu item of my own for a simple application that doesn’t require a full blown top menu.
A Windows-only solution, if one exists (and is simple enough), would be useful too.
I don’t think wxWidgets/wxPython allows you to manipulate the system menu, with a few exceptions that are not sufficient for what you want:
You can remove the system menu by passing a style flag to the wx.Frame:
style=wx.DEFAULT_FRAME_STYLE & ~wx.SYSTEM_MENUOn Mac OS X, menu items with ids such as
wx.ID_EXITandwx.ID_HELPare moved into the application menu.I tried to bind the
wx.EVT_MENU_OPENevent and although the event handler is invoked, the passed event doesn’t contain anything useful on Windows. The code below prints ‘None 0’ when I open the Frame’s system menu: