Re: [Tkinter-discuss] Bind to event related to currently selected menu item

2010-11-21 Thread python
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

Re: [Tkinter-discuss] Bind to event related to currently selected menu item

2010-11-21 Thread python
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

Re: [Tkinter-discuss] Bind to event related to currently selected menu item

2010-11-21 Thread Michael Lange
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

Re: [Tkinter-discuss] Bind to event related to currently selected menu item

2010-11-21 Thread Michael O'Donnell
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

Re: [Tkinter-discuss] Bind to event related to currently selected menu item

2010-11-20 Thread python
Kevin, > Try <>. Thanks for the recommendation. Any suggestions on how I can determine the currently selected menu item in the event raised by <>? # here's how I create my popup menu popup = tk.Menu( menubar ) popup.bind( '<>', statusbarUpdate ) # here's the command I bind to def statusbarUpdat

Re: [Tkinter-discuss] Bind to event related to currently selected menu item

2010-11-18 Thread Kevin Walzer
On 11/18/10 5:56 PM, pyt...@bdurham.com wrote: Wondering if there's a menu event I can bind to that's related to the currently selected menu item? By menu item I mean the items that show up in a popup menu like New, Open, Save, etc. Use case: I would like to update a statusbar area of our applic

[Tkinter-discuss] Bind to event related to currently selected menu item

2010-11-18 Thread python
Wondering if there's a menu event I can bind to that's related to the currently selected menu item? By menu item I mean the items that show up in a popup menu like New, Open, Save, etc. Use case: I would like to update a statusbar area of our application with a description of the currently selected