Ignore:
Timestamp:
May 16, 2011, 11:07:56 AM (13 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

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

    r1694 r2241  
    3434    protected method _downloadValues {}
    3535    protected method _tooltip {}
     36
     37    private method SetDefaultValue { value }
    3638
    3739    private variable _owner ""    ;# thing managing this control
     
    240242    #
    241243    set str [$_owner xml get $path.default]
    242     if {$str != ""} { after 1500 [itcl::code $this value $str] }
     244    if { $str != "" } {
     245        bind $itk_component(hull) <Map> [itcl::code $this SetDefaultValue $str]
     246    }
    243247}
    244248
     
    314318    # query tooltip on-demand based on current choice
    315319    return "@[itcl::code $this _tooltip]"
     320}
     321
     322#
     323# SetDefaultValue --
     324#
     325#       Sets the designated default value for the loader.  This must be done
     326#       after the entire application is assembled, otherwise the default
     327#       values set up by the loader will be overwritten by the various widgets
     328#       themselves when they try to set their default values. 
     329#
     330#       This is called from a  <Map> event to the loader (combobox).  This
     331#       will get trigger the first time the loader is displayed.  The binding
     332#       is then removed.
     333#
     334itcl::body Rappture::Loader::SetDefaultValue { value } {
     335    after idle [itcl::code $this value $value]
     336    # We're done. Remove the binding.
     337    bind $itk_component(hull) <Map> {}
    316338}
    317339
Note: See TracChangeset for help on using the changeset viewer.