On Fri, Jun 1, 2012 at 3:50 PM, Alexander Matyukhin < alex.matyuk...@yandex.ru> wrote:
> Hello to all! I have a simple code, which use tkinter. > It has a Text widget and two Buttons. First Button > must insert string into text. But it dont do it. > The string is inserted into text after start and the > button don't react on click. > Second button must close window and it do it normal. > Where did I have an error? > <snip> > > # First button > button_insert = tk.Button (main_window, > text='Insert string', command=InsertToText()) > Remove the () for the command attribute. It should be: ... command=InsertToText) The way you have it, you are calling InsertToText(), and the result of that call (None) is what is getting assigned to the command attribute of the button.
_______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org http://mail.python.org/mailman/listinfo/tkinter-discuss