Tk button help

Park997 park997 at aol.comnotospam
Tue Feb 12 12:23:38 EST 2002


Hi,

I have a Tk button with a command (function) bound to it. The first
time the program is run, the command is executed without the button
being pushed. After this pushing the button does nothing.

Here is the relevant (I think) code. I would appreciate help in
understanding and fixing this:

	def run(self,G):
		
		from tkSimpleDialog import askfloat
	
		self.N = askfloat('N', 'Leaf N (50 - 250 mmol m-2) ')




if __name__ == '__main__':
	
	test = assimilation()
	
	import Gen_Graph
	
	from Tkinter import *

	top = Tk()
		
	G = Gen_Graph.grapher(top)

	Button(top, text='Enter Leaf N', command = test.run(G)).pack(side=RIGHT, fill
= BOTH)
	
	top.mainloop()  

Thanks.

Wendell Cropper
	



More information about the Python-list mailing list