Ignore:
Timestamp:
May 21, 2006 7:30:40 PM (18 years ago)
Author:
mmc
Message:

Fixed the up/down buttons on the <integer> element so they report
min/max limit errors with a nice tooltip, instead of an ugly error
dialog!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/gauge.tcl

    r437 r442  
    317317        set val 0
    318318    }
    319     value [expr {$val+$delta}]
     319    if {[catch {value [expr {$val+$delta}]} result]} {
     320        if {[regexp {allowed here is (.+)} $result match newval]} {
     321            set _value $newval
     322            $itk_component(value) configure -text $newval
     323        }
     324        if {[regexp {^bad.*: +(.)(.+)} $result match first tail]
     325              || [regexp {(.)(.+)} $result match first tail]} {
     326            set result "[string toupper $first]$tail"
     327        }
     328        bell
     329        Rappture::Tooltip::cue $itk_component(value) $result
     330        return 0
     331    }
    320332}
    321333
Note: See TracChangeset for help on using the changeset viewer.