[Tutor] Problems with tkinter callbacks

Alexandre Passos alextp@ig.com.br
Thu, 06 Apr 2000 20:56:26 -0300


I tried to make a big program, but I had problems with changing
objects's positions with the grid manager. I wrote a simple program to
test solutions an couldn't find any. Thanks for every help.
I try this:
#! /usr/bin/env python
from Tkinter import *

root = Tk()

class All:
    def __init__(self):
        self.main_screen=Frame(root, width=600, height=200, bg='',
colormap='new' )
        self.main_screen.grid()
        Label(self.main_screen, text="Nothing will be here when the
program is done").grid(row=0, column=1)
        self.title = Label(self.main_screen, text="Frame_Title")        
	self.title.grid(row=0, column=0)
        self.title.bind('<1>',self.callback)

    def callback(self):
        self.title.grid_configure(column=2)
all=All()
root.mainloop()


ang get this confusing error message:

Exception in Tkinter callback
Traceback (innermost last):
  File "/var/tmp/python-root/usr/lib/python1.5/lib-tk/Tkinter.py", line
752, in __call__
    return apply(self.func, args)
TypeError: too many arguments; expected 1, got 2


Again, thanks for any help on this.





"The thruth is out there"
X-Files