From Newsgroup: comp.lang.tcl
On Fri, 10 Oct 2025 12:45:44 -0300, Emiliano wrote:
On Fri, 10 Oct 2025 09:41:52 -0000 (UTC)
Mark Summerfield <m.n.summerfield@gmail.com> wrote:
[...]
bindtags $Text {$Text Ntext . all}
# bind $Text doesn't work; nor does bind $parent.$FrameName or $parent
The correct line is
bindtags $Text [list $Text Ntext [winfo toplevel $Text] all]
Regards
Thank you for that code, it works great!
Here're the changes I made (including a Control-BackSpace which I now
believe works):
oo::define TextEdit constructor parent {
…
bindtags $Text [list $Text Ntext [winfo toplevel $Text] all]
bind $Text <Control-BackSpace> [callback on_ctrl_bs]
…
oo::define TextEdit method on_ctrl_bs {} {
set i [$Text index "insert -1 char"]
set x [$Text index "$i wordstart"]
set y [$Text index "$x wordend"]
$Text delete $x $y
}
--- Synchronet 3.21a-Linux NewsLink 1.2