This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Text.edit_modified() doesn't work
Type: Stage:
Components: Tkinter Versions: Python 2.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Text.edit_modified() fails
View: 961805
Assigned To: loewis Nosy List: gpolo, loewis, mkiever, ronpro@cox.net
Priority: normal Keywords: patch

Created on 2005-11-21 03:13 by ronpro@cox.net, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
edit_modified.diff gpolo, 2008-05-17 00:02
Messages (5)
msg60838 - (view) Author: Ron Provost (ronpro@cox.net) Date: 2005-11-21 03:13
Tkinter's Text widget has a method edit_modified()
which should return True if the modified flag of the
widget has been set, False otherwise.  It should also
be possible to pass True or False into the method to
set the flag to a desired state.  The implementation
retrieves the correct value, but then calls
self._getints( result ).  This causes an exception to
be thrown.

In my build, I found that changing the implementation
to the following appears to fix the function.

  return self.tk.call( self._w, 'edit', 'modified', arg )

msg60839 - (view) Author: Matthias Kievernagel (mkiever) * Date: 2007-01-24 15:53
Posted patch 1643641.
The patch removes the offending _getints call.

Greetings,
Matthias Kievernagel
msg66974 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2008-05-17 00:01
This bug still exists, I'm attaching a patch against current python-trunk.
This patch is based on the fact that documentation tk 8.4 (version which
edit command was added) and tk 8.5 says only edit_modified is supposed
to return something, which is either 0 or 1, so there was no reason to
use _gettints on that tk.call, and returning an empty tuple is against
the expected value, 0.
msg67001 - (view) Author: Matthias Kievernagel (mkiever) * Date: 2008-05-17 15:54
Hi Guilherme,

funny, I wasn't aware of this duplicate of this issue
until I got the message of your comment :)
The other duplicate is:
 http://bugs.python.org/issue1643641
which was closed by Georg Brandl upon my request.
The oldest issue is:
  http://bugs.python.org/issue961805
Both these issues have my patch attached.
(it's somewhat resembling yours and the proposition
of Ron Provost - except that it is 1.5 years older)
The latter issue also has demo code attached.

Can someone close this one or the other open issue??

Cheers,
Matthias Kievernagel
msg67002 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2008-05-17 15:58
Closed as this is yet another duplicate.
History
Date User Action Args
2022-04-11 14:56:14adminsetgithub: 42614
2008-05-17 15:58:04gpolosetstatus: open -> closed
resolution: duplicate
superseder: Text.edit_modified() fails
messages: + msg67002
2008-05-17 15:54:19mkieversetmessages: + msg67001
2008-05-17 00:02:10gpolosetfiles: + edit_modified.diff
nosy: + gpolo
messages: + msg66974
keywords: + patch
2005-11-21 03:13:59ronpro@cox.netcreate