List Info

Thread: Put items on the iconized menu?




Put items on the iconized menu?
user name
2006-02-07 09:28:36

Is there a way to put additional items on the context menu that comes up when you RMB click on the iconized form of a Tkinter app (in Windows at least)?

 thanks, Avery Andrews

Put items on the iconized menu?
user name
2006-02-07 14:54:51
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
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discusspython.org
http://mail.python.org/mailman/listinfo/tkinter-discuss
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )