Changeset 1120 for trunk/gui


Ignore:
Timestamp:
Aug 19, 2008 9:36:54 AM (16 years ago)
Author:
gah
Message:
 
Location:
trunk/gui/scripts
Files:
2 edited

Legend:

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

    r1112 r1120  
    217217    grid $inner.f.grid -row 0 -column 0 -sticky w
    218218
    219     set ::Rappture::HeightmapViewer::_settings($this-axes) 1
     219    set ::Rappture::HeightmapViewer::_settings($this-axes) 0
    220220    ::checkbutton $inner.f.axes \
    221221        -text "Axes" \
  • trunk/gui/scripts/switch.tcl

    r1076 r1120  
    1616    inherit itk::Widget
    1717
    18     itk_option define -oncolor onColor Color "green"
     18    itk_option define -oncolor onColor Color "#00cc00"
    1919    itk_option define -state state State "normal"
    2020
    2121    constructor {args} { # defined below }
    2222    public method value {args}
     23    public method updateText {}
    2324    private variable _value 0  ;# value for this widget
    2425}
     
    3435
    3536    itk_component add value {
    36         checkbutton $itk_interior.value  -variable [itcl::scope _value]
     37        checkbutton $itk_interior.value \
     38            -variable [itcl::scope _value] \
     39            -command [itcl::code $this updateText]
    3740    } {
    38         rename -background -textbackground textBackground Background
     41        #rename -background -textbackground textBackground Background
    3942    }
    4043    pack $itk_component(value) -side left -expand yes -fill both
     
    7073        set _value $newval
    7174        event generate $itk_component(hull) <<Value>>
    72 
     75        updateText
    7376    } elseif {[llength $args] != 0} {
    7477        error "wrong # args: should be \"value ?-check? ?newval?\""
     
    7780}
    7881
     82itcl::body Rappture::Switch::updateText {} {
     83    set mesg [expr {($_value) ? "on" : "off"}]
     84    $itk_component(value) configure -text $mesg
     85}
     86   
    7987
    8088# ----------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.