[Tkinter-discuss] Working with tear-off menus (change the "-----" label, customize location/appearance of tear-off window)

python at bdurham.com python at bdurham.com
Mon Nov 22 02:18:06 CET 2010


I've been experimenting with Tkinter tear-off menus and have the
following questions (relative to Windows):

1. Is there a way to change the default appearance of the
"------" menu label that is used to indicate a tear-off menu -OR-
is there a way to programmatically convert a menu widget to a
torn-off state? Note: The tear-off menu item does not have a
'label' property.

2. Is there a way to customize the location and appearance of the
window that contains a tear-off menu? On Windows, the tear-off
menus appear at random(?) places on the desktop. And these
windows have min/max buttons and are resizable - all behaviors
that IMO don't make sense for a floating tear-off menu. What I
would like to do is capture a reference to the window of a
tear-off and customize it like I would any other Toplevel()
window. Is this possible?

Note: I can detect the tearoff event by using the tearoffcommand=
option when I create a menu. I think this event is where I want
to take control of the tear-off menu's window properties? But how
to get a reference to the tear-off menu's window (and does it
exist yet?).

Thank you,
Malcolm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20101121/28d6b361/attachment.html>


More information about the Tkinter-discuss mailing list