Treeview Error: "invalid command name": help!

Skip to first unread message


Oct 2, 2010, 2:31:16 PM10/2/10
to Tk Documentation and Resources

I have written a program in Python 3.1.2 using Tkinter 8.5. In this
program, there is a ttk.Treeview widget called "treeW" and a function
called "updateCensus()" that is supposed to make changes to treeW. The
function works totally fine until I execute a command that opens 2 new
toplevel windows to get input from the user. When the second window is
closed, it calls the updateCensus() function and an Error occurs. The
Traceback is:

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files\Python31\lib\tkinter\", line
1399, in __call__
return self.func(*args)
File "C:\...\", line 372, in changeSim
File "C:\...\", line 324, in updateCensus
children = treeW.get_children()
File "C:\Program Files\Python31\lib\tkinter\", line 1217,
in get_children
return, "children", item or '') or ()
_tkinter.TclError: invalid command name ".

Even if I delete the line "children = treeW.get_children()" from the
updateCensus() function, the Error still occurs (this time the
Traceback points to a different line in updateCensus() that involves
treeW). ".33932240.33978672.33990480.33990512" is the string I get if
I enter str(treeW).

Does anyone know this error and how it can be fixed?

Reply all
Reply to author
0 new messages