A while ago I posted the implementation of a swipe action over checkbuttons in order to quickly toggle their state:
https://groups.google.com/g/comp.lang.tcl/c/MS3YKU-uQkU/m/SL76RvNfAgAJ
Now I realize, that the bindings for the tooltips are not working anymore for those checkbuttons that have the swipe action.
The tooltips are implemented as below. The SwipeInit procedure calls this command:
bindtags $parentframe.$child [list $parentframe all TCheckbutton]
Without it, the tooltips are working.
Question: How can a make both work?
Many thanks
Alexandru
proc ::TooltipSet {widgets text {textvariable ""} {delay 1000} {prependcmd ""} {appendcmd ""}} {
if {$text != ""} {
# 2) Adjusted timings and added key and button bindings. These seem to
# make artifacts tolerably rare.
set textlines [string map {". " ".\n"} $text]
if {$textvariable==""} {
foreach widget $widgets {
bind $widget <Any-Enter> [list after $delay [list ::TooltipShow %W $textlines $prependcmd $appendcmd]]
bind $widget <Any-Leave> [list after [expr $delay/2] [list destroy %W.tooltip]]
bind $widget <Any-KeyPress> [list after [expr $delay/2] [list destroy %W.tooltip]]
bind $widget <Any-Button> [list after [expr $delay/2] [list destroy %W.tooltip]]
}
} else {
set text [string map {"\n" " "} $text]
foreach widget $widgets {
bind $widget <Any-Enter> "set $textvariable [list $text]; after $delay [list [list ::TooltipShow %W $textlines $prependcmd $appendcmd]]"
bind $widget <Any-Leave> "set $textvariable {}; after [expr $delay/2] [list [list destroy %W.tooltip]]"
bind $widget <Any-KeyPress> "set $textvariable {}; after [expr $delay/2] [list [list destroy %W.tooltip]]"
bind $widget <Any-Button> "set $textvariable {}; after [expr $delay/2] [list [list destroy %W.tooltip]]"
}
}
}
}
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)