bug in Tkinter (FIX)

E

Ed Blake

It's my first time posting to the list so I hope I don't sound like an idiot!
The other day I was looking for a way to keep track of whether a user had
changed the contents of a Tk text widget. After a little bit of searching I
found edit_modified. This should let me get/set the modified flag on a Tk
text widget... But using it to check the flag raises an exception. A little
more searching showed that the problem had been reported numerous times, but
never fixed. So, despite the fact that I could use Tk.call to access the
value directly, I decided to poke around in Tkinter.py and see if I could fix
it myself. It took about five seconds to fix the problem ^_^

Search for 'edit', it is a method in the Text class. Replace:
return self._getints(self.tk.call((self._w, 'edit') + args)) or ()

With:
if 'modified' in args:
return self._getboolean(
self.tk.call((self._w, 'edit') + args)) or ()
return self._getints(
self.tk.call((self._w, 'edit') + args)) or ()

Simple right? Anyway could somebody fix this in the official version please?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,470
Messages
2,571,808
Members
48,797
Latest member
PeterSimpson
Top