a_random_programmer
a_random_programmer

Reputation: 148

_tkinter.TclError: invalid command name ".!text"

I am making a program using tkinter that executes some code from different files.

This is the part of my code causing problems:

text=textbox.get('1.0','end-1c')

FYI: textbox is a tkinter.Text object defined by a different file that my code executed

when ever I execute my code, I get the error:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/anaconda3/lib/python3.7/tkinter/__init__.py", line 1705, in __call__
    return self.func(*args)
  File "/Users/iskee/python/programs/atfedit/atf.py", line 98, in save
    text=textbox.get('1.0','end-1c')
  File "/anaconda3/lib/python3.7/tkinter/__init__.py", line 3246, in get
    return self.tk.call(self._w, 'get', index1, index2)
_tkinter.TclError: invalid command name ".!text"

what is going wrong?

Upvotes: 3

Views: 3197

Answers (1)

Bryan Oakley
Bryan Oakley

Reputation: 385800

That error means that you're trying to access a widget that has been destroyed.

Upvotes: 4

Related Questions