[Tutor] Tkinter wierdness

Isaac Hall hall@ouhep1.nhn.ou.edu
Tue Dec 10 13:43:03 2002


On Tue, 10 Dec 2002, Rick Pasotto wrote:

> On Tue, Dec 10, 2002 at 11:28:20AM -0600, Isaac Hall wrote:
> > I was wondering if someone could explain the source of some wierdness
> > I am seeing in Tkinter. I have a program with a main window, and later
> > create other Toplevel Windows.  I place a button in the Toplevel
> > window, but then the wierdness ensues.  the command for the button is
> > run when the button is created, and can never be run again!  clicking
> > the button afterward does nothing.  can someone explain why this is
> > happening, because I am stumped.  
> 
> Without seeing your actual code this is only a guess but does your
> button definition include 'command=func()'? If so, drop the parentheses
> and your problem will be solved.
> 
> 
That was it exactly.  Thank you

Ike

P.S. the inevitable follow-up question:  why must this be done?  if I wish 
to call a function with some arguments, how is this done?  


--