Problem deleting text in TK widget

dogboy777 at my-deja.com dogboy777 at my-deja.com
Thu Jul 27 14:38:32 EDT 2000


I'm trying to delete text in a TK Text field, and I'm getting an error I
don't understand.  The code is:

		self.logarea = Text(master, height=35, width=30)
		self.logarea.insert(END, 'This is a test')
		self.logarea.delete(1,3)

The resulting error is:

Traceback (most recent call last):
  File "junkyard.py", line 109, in ?
    junk = Junkyard(root)
  File "junkyard.py", line 20, in __init__
    self.createMainScreen()
  File "junkyard.py", line 34, in createMainScreen
    self.logarea.delete(1,3)
  File "C:\PYTHON16\lib\lib-tk\Tkinter.py", line 1643, in delete
    self.tk.call(self._w, 'delete', index1, index2)
TclError

Any idea why Tcl is unhappy?

NOTE:  I'm using Python 1.6

Thanks,
Anders Schneiderman
National Journal Group


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list