Tk Library Source Code

Artifact [cf75b4a5ee]
Login

Artifact cf75b4a5eed2a66ad8a06aa8dbe77555c7a83c62:

Attachment "cvsdiff_dynhelp" to ticket [567982ffff] added by decosterjos 2002-10-09 20:12:13.
Index: dynhelp.tcl
===================================================================
RCS file: /cvsroot/tcllib/bwidget/dynhelp.tcl,v
retrieving revision 1.8
diff -r1.8 dynhelp.tcl
4c4
< #  $Id: dynhelp.tcl,v 1.8 2002/05/09 21:01:06 andreas_kupries Exp $
---
> #  $Id: dynhelp.tcl,v 1.5 2002/10/08 12:56:04 decoster Exp $
18a19,20
> # JDC: allow variable and ballon help at the same timees
> 
39c41,42
<     variable _current ""
---
>     variable _current_balloon ""
>     variable _current_variable ""
48c51
<     bind BwHelpBalloon <Destroy> {if {[info exists DynamicHelp::_registered(%W)]} {unset DynamicHelp::_registered(%W)}}
---
>     bind BwHelpBalloon <Destroy> {if {[info exists DynamicHelp::_registered(%W,balloon)]} {unset DynamicHelp::_registered(%W,balloon)}}
53c56
<     bind BwHelpVariable <Destroy> {if {[info exists DynamicHelp::_registered(%W)]} {unset DynamicHelp::_registered(%W)}}
---
>     bind BwHelpVariable <Destroy> {if {[info exists DynamicHelp::_registered(%W,variable)]} {unset DynamicHelp::_registered(%W,variable)}}
122,123d124
<         set idx  [lsearch $evt "BwHelp*"]
<         set evt  [lreplace $evt $idx $idx]
125a127,128
> 		set idx  [lsearch $evt "BwHelpBalloon"]
> 		set evt  [lreplace $evt $idx $idx]
128c131
<                     set _registered($path) $text
---
>                     set _registered($path,balloon) $text
131,132c134,135
<                     if {[info exists _registered($path)]} {
<                         unset _registered($path)
---
>                     if {[info exists _registered($path,balloon)]} {
>                         unset _registered($path,balloon)
139a143,144
> 		set idx  [lsearch $evt "BwHelpVariable"]
> 		set evt  [lreplace $evt $idx $idx]
143c148
<                     set _registered($path) [list $var $text]
---
>                     set _registered($path,variable) [list $var $text]
146,147c151,152
<                     if {[info exists _registered($path)]} { 
<                         unset _registered($path)
---
>                     if {[info exists _registered($path,variable)]} { 
>                         unset _registered($path,variable)
195a201,206
>         if {[info exists _registered($path,balloon)]} {
>             unset _registered($path,balloon)
>         }
>         if {[info exists _registered($path,variable)]} {
>             unset _registered($path,variable)
>         }
201a213,218
>         if {[info exists _registered($path,balloon)]} {
>             unset _registered($path,balloon)
>         }
> 	if {[info exists _registered($path,variable)]} {
>             unset _registered($path,variable)
>         }
217c234
<     variable _current
---
>     variable _current_balloon
219,220c236,237
<     if { $_current != $path && $type == "enter" } {
<         set _current $path
---
>     if { $_current_balloon != $path && $type == "enter" } {
>         set _current_balloon $path
224c241
<     if { $_current == $path } {
---
>     if { $_current_balloon == $path } {
235c252
<             set _current ""
---
>             set _current_balloon ""
246c263
<     variable _current
---
>     variable _current_variable
249c266
<     if { $_current != $path && [info exists _registered($path)] } {
---
>     if { $_current_variable != $path && [info exists _registered($path,variable)] } {
251c268
<             set _saved [GlobalVar::getvar [lindex $_registered($path) 0]]
---
>             set _saved [GlobalVar::getvar [lindex $_registered($path,variable) 0]]
253,254c270,271
<         GlobalVar::setvar [lindex $_registered($path) 0] [lindex $_registered($path) 1]
<         set _current $path
---
>         GlobalVar::setvar [lindex $_registered($path,variable) 0] [lindex $_registered($path,variable) 1]
>         set _current_variable $path
264c281
<     variable _current
---
>     variable _current_variable
267,268c284,285
<     if { [info exists _registered($path)] } {
<         GlobalVar::setvar [lindex $_registered($path) 0] $_saved
---
>     if { [info exists _registered($path,variable)] } {
>         GlobalVar::setvar [lindex $_registered($path,variable) 0] $_saved
271c288
<     set _current ""
---
>     set _current_variable ""
306c323
<     if { [info exists _registered($path)] } {
---
>     if { [info exists _registered($path,balloon)] } {
317c334
<         label $_top.label -text $_registered($path) \
---
>         label $_top.label -text $_registered($path,balloon) \