Ignore:
Timestamp:
May 18, 2010 4:26:32 PM (14 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/blt4/gui/scripts/tooltip.tcl

    r1695 r1719  
    3838    itk_option define -message message Message ""
    3939
    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}
    4843    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
    5249    public proc tooltip {option args}
     50    private common pending "" ;# after ID for pending "tooltip show"
     51
    5352    public proc cue {option args}
    54     public proc delay { widget args }
    5553
    5654    bind RapptureTooltip <Enter> \
     
    298296                after cancel $pending
    299297            }
    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]]
    305299        }
    306300        show {
     
    390384
    391385# ----------------------------------------------------------------------
    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 it
    396 # 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) $time
    407     } else {
    408         error "wrong # args: should be \"delay widget ?millisecs?\""
    409     }
    410 }
    411 
    412 # ----------------------------------------------------------------------
    413386# CONFIGURATION OPTION: -icon
    414387# ----------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.