Tkinter: disable menu items while running

Patrick L. Nolan pln at cosmic.stanford.edu
Wed Jan 14 18:28:21 EST 2004


We have a Tkinter application which has a menubar with cascade
submenus.  I would like to start the program with one of the
submenu items state=DISABLED, then change it to state=NORMAL
at a later time.  I hope I just missed something obvious, 
because I can't figure out how to change its state.

The problem comes about because the menu bar is built by several
add_cascade() calls.  Each of the cascades, in turn, has
several add_command() calls.  If the cascade in question was,
say, an object named Cas, then I could call Cas.entryconfigure().
However, I don't know how to get ahold of the objects
created by add_cascade() or add_command().  Do they live
somewhere accessible?

-- 
*   Patrick L. Nolan                                          *
*   W. W. Hansen Experimental Physics Laboratory (HEPL)       * 
*   Stanford University                                       *



More information about the Python-list mailing list