Tk Library Source Code

View Ticket
Login
2026-11-15
23:30 • Ticket [3567463fff] ctext sends <<Modified>> too often status still Open with 3 other changes artifact: ad99b53890 user: serhiy.storchaka
23:24
ctext: let the text widget keep the modified flag. ctext is in the bindtags of its text widget, so the <<Modified>> the text widget sends also reached bindings on the ctext, in addition to the one ctext sent itself. Now only the text widget sends it, once each time the flag changes, and "edit modified" goes to the text widget. ctext no longer sets the flag after inserts and deletes; the text widget does it when the text changes. The tests now let queued events be delivered. See [3567463fff]. leaf check-in: adab3e651c user: serhiy.storchaka tags: ctext-modified-event
23:07
Fix [3567463fff]: ctext sent <<Modified>> on every change, and not at all for "edit modified". Like the text widget, <<Modified>> is now sent only when the modified flag changes, also when it is set with "edit modified". Add ctext.test. check-in: 8b53c6beb2 user: serhiy.storchaka tags: ctext-modified-event
2012-09-13
20:39 • New ticket [3567463fff] ctext sends <<Modified>> too often. artifact: 627d7d3f7d user: duquette

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.