Tk Library Source Code

View Ticket
Login
Ticket UUID: 0ffbe8ccecfbbe8f95383231d9bc97c2ac9d4cc1
Title: text (dgw::txmixins): bugs found by the new tests
Type: Bug Version: trunk
Submitter: serhiy.storchaka Created on: 2026-11-21 18:08:48
Subsystem: None Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2026-11-22 15:52:43
Resolution: None Closed By: nobody
    Closed on:
Description:

The bugs below were found by the tests in branch tests-text; each is covered by a test with the knownBug constraint (txmixins-2.1, 3.2, 3.3, 4.6, 4.12, 5.2, 5.9, 6.6, 8.3, 8.4). Unless noted otherwise, they occur with both Tk 8.6 and Tk 9.1.

  • dgw::txautorep cannot be created with Tk 8.6: the constructor binds <KeyRelease-)>, which Tk 8.6 rejects with bad event type or keysym ")" (<KeyRelease-parenright> works in all versions). Tk 8.6 only. Test txmixins-2.1.
  • dgw::txblocksel: the Control-c and Control-x bindings call copy_blocksel with the hard-coded widget name .txt (bind Text <Control-Key-c> [list [myproc copy_blocksel] .txt 0]), so copying or cutting a block selection works only in a widget named .txt; for any other widget nothing is copied to the clipboard and nothing is cut. The bindings are also made on the class Text, i.e. for all text widgets of the application. Tests txmixins-3.2, 3.3.
  • dgw::txfileproc: every fileOpen/fileSave cycle adds empty lines at the end of the file: fileOpen inserts every line with a trailing newline (after which the text widget has its own final newline too), and fileSave writes [$win get 1.0 end] with puts, which adds another one. A file containing "a\nb\n" is saved as "a\nb\n\n\n". Test txmixins-4.6.
  • dgw::txfileproc: fileSaveAs always fails with can't read "text": no such variable; it uses the undefined variables $text (instead of $win) and $file (instead of $filename). Test txmixins-4.12.
  • dgw::txfold: the documentation describes the option -foldallkey, but the code defines it as -foldall: cget -foldallkey fails with unknown option "-foldallkey". Test txmixins-5.2.
  • dgw::txfold: FoldCurrent (key F2) prints the list of fold ranges to stdout with a leftover debugging puts $folds. Test txmixins-5.9.
  • dgw::txhighlight: -highlightcommand does not work: doHilights calls $options(-highlightcommand) $text before the variable text is set, so the command is never called and a can't read "text" error is raised instead. Test txmixins-6.6.
  • dgw::txpopup: the documentation describes a public method menu, but the method is called Menu in the code, so $w menu fails with bad option "menu". Test txmixins-8.3.
  • dgw::txpopup: the documented options -redokey and -popupkey are not implemented (unknown option "-redokey"); Control-y and Button-3 are hard-coded. Test txmixins-8.4.

User Comments: serhiy.storchaka added on 2026-11-22 15:52:43:

Proposed fix for the creation of dgw::txautorep with Tk 8.6 in branch txautorep-tk86-binding.