Changeset 1719 for branches/blt4/gui/scripts/tooltip.tcl
- Timestamp:
- May 18, 2010 4:26:32 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4/gui/scripts/tooltip.tcl
r1695 r1719 38 38 itk_option define -message message Message "" 39 39 40 private common pending "" ; # after ID for pending "tooltip show" 41 private common catalog ; # maps widget => message 42 private common delay ; # The delay in milliseconds to wait 43 # before presenting the tooltip. 44 constructor {args} { 45 # defined below 46 } 47 public method show { where } 40 constructor {args} { # defined below } 41 42 public method show {where} 48 43 public method hide {} 49 50 public proc for { widget args } 51 public proc text { widget args } 44 45 public proc for {widget args} 46 public proc text {widget args} 47 private common catalog ;# maps widget => message 48 52 49 public proc tooltip {option args} 50 private common pending "" ;# after ID for pending "tooltip show" 51 53 52 public proc cue {option args} 54 public proc delay { widget args }55 53 56 54 bind RapptureTooltip <Enter> \ … … 298 296 after cancel $pending 299 297 } 300 set t 750 301 if { [info exists delay($widget)] } { 302 set t $delay($widget) 303 } 304 set pending [after $t [itcl::code tooltip show $widget $loc]] 298 set pending [after 750 [itcl::code tooltip show $widget $loc]] 305 299 } 306 300 show { … … 390 384 391 385 # ---------------------------------------------------------------------- 392 # USAGE: delay <widget> ?<value>?393 #394 # Used to query or set the text used for the tooltip for a widget.395 # This is done automatically when you call the "for" proc, but it396 # is sometimes handy to query or change the text later.397 # ----------------------------------------------------------------------398 itcl::body Rappture::Tooltip::delay {widget args} {399 if {[llength $args] == 0} {400 if {[info exists delay($widget)]} {401 return $delay($widget)402 }403 return ""404 } elseif {[llength $args] == 1} {405 set time [lindex $args 0]406 set delay($widget) $time407 } else {408 error "wrong # args: should be \"delay widget ?millisecs?\""409 }410 }411 412 # ----------------------------------------------------------------------413 386 # CONFIGURATION OPTION: -icon 414 387 # ----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.