[Tkinter-discuss] Put items on the iconized menu?

jepler at unpythonic.net jepler at unpythonic.net
Tue Feb 7 15:54:51 CET 2006


Read the section "SPECIAL MENUS IN MENUBARS" from the tk "menu" manpage:
    On Windows, access to the Windows System menu in each window is provided.
    [...] So for a menubar named .menubar, on the Macintosh, the special menus
    would be .menubar.apple and .menubar.help; on Windows, the special menu
    would be .menubar.system [...]
A bit of experimentation shows that this does work (the item appears both when
you click the icon in the upper left and when you right-click the task bar 
entry for the application), but that you'll also want to specifically turn
off the "tearoff" property of the "system" menubar.

I tested this in 'wish', not Tkinter.  Creating a widget with a particular name
seems to be done in Tkinter by using the name= parameter when constructing the
widget:
        menubar = Tkinter.Menu(root); root.configure(menu=menubar)
        system_menu = Tkinter.Menu(menubar, name="system", tearoff=0, ...)
        menubar.add_cascade(menu=system_menu, ...)
(untested)

Jeff


More information about the Tkinter-discuss mailing list