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
Hi Michael,
> The problem is apparently that the widget name of the menu's "button" is
> assigned by Tk and there does not seem to be a way to access this subwidget
> from within Tkinter. Besides this I don't understand why this does not happen
> with the context
menu from my previous example b
Michael(s):
> def callback(event):
> print event.widget.index('active')
>
> I see, this happens only with cascade menus, in my example I only had a
> popup menu, for which it worked as expected. Right now I am trying to
> figure out what's wrong with Tkinter (it's definitely a bug within
> Tkin
Hi Michael(s):
> At least in Python 2.5.4 linked to Tk 8.4 (Windows version),
> the following fails because event.widget holds a string (the tcl/tk
> widget name), not a Tkinter class.
>
> def callback(event):
> print event.widget.index('active')
>
> Maybe fixed in later editions
This fails i
Michael,
Thank you! That's EXACTLY the solution I was looking for :)
Regards,
Malcolm
Change your statusbarUpdate for the following, which will print out
the index of the currently selected menu item:
def statusbarUpdate( event=None ):
print tk.call(event.widget, "index", "active")
Note th
Hi,
Thus spoketh "Michael O'Donnell"
unto us on Sun, 21 Nov 2010 10:26:24 +0100:
> Hi Malcom,
>
> Change your statusbarUpdate for the following, which will print out
> the index of the currently selected menu item:
>
> def statusbarUpdate( event=None ):
>print tk.call(event.widget, "index
Hi Mick,
Thus spoketh "Michael O'Donnell"
unto us on Sun, 21 Nov 2010 13:05:49 +0100:
> Hi Michael,
>
> At least in Python 2.5.4 linked to Tk 8.4 (Windows version),
> the following fails because event.widget holds a string (the tcl/tk
> widget name), not a Tkinter class.
>
> > def callback(e
Hi Michael,
At least in Python 2.5.4 linked to Tk 8.4 (Windows version),
the following fails because event.widget holds a string (the tcl/tk
widget name), not a Tkinter class.
> def callback(event):
> print event.widget.index('active')
Maybe fixed in later editions, but if one wants a soluti
Hi Malcolm,
Thus spoketh pyt...@bdurham.com
unto us on Sat, 20 Nov 2010 18:09:58 -0500:
> Hi Michael,
>
> Thank you for your idea to use the event. That works when I use
> the mouse, but it doesn't work when a user uses the cursor keys to move
> between menu items.
sure, you're right, I didn'
Hi Malcom,
Change your statusbarUpdate for the following, which will print out
the index of the currently selected menu item:
def statusbarUpdate( event=None ):
print tk.call(event.widget, "index", "active")
Note that this uses tcl/tk code, where Tkinter code should be used,
but it seems the
10 matches
Mail list logo