Tk Library Source Code

View Ticket
Login
Ticket UUID: 3567463
Title: ctext sends <<Modified>> too often
Type: Bug Version: None
Submitter: duquette Created on: 2012-09-13 20:39:35
Subsystem: tklib :: ctext Assigned To: nobody
Priority: 5 Medium Severity:
Status: Open Last Modified: 2026-11-15 23:30:14
Resolution: None Closed By:
    Closed on:
Description:
The Tk text widget sends the <<Modified>> virtual event when the state of the [$w edit modified] flag changes.  The ctext widget sends <<Modified>> on every change, whether the [$w edit modified] flag has actually changed or not.  The ctext widget's interface should mimic the text widget's interface here; if there are actions you want to do when the editor's content has just become unsaved, you don't want to repeat them every time they add another character.
User Comments: serhiy.storchaka added on 2026-11-15 23:30:14:

Proposed fix in branch ctext-modified-event.

ctext is in the bindtags of its text widget, so bindings on the ctext received the <<Modified>> of the text widget in addition to the one ctext sent itself after every change. Now the text widget keeps the modified flag, as in a plain text widget: <<Modified>> is sent once each time the flag changes, also when it is set with edit modified.