Ignore:
Timestamp:
Feb 19, 2006 8:10:19 PM (18 years ago)
Author:
mmc
Message:
  • Added "Upload..." capability to the <loader> widget. You can now add an <upload> directive containing the path of the control that will receive data. A file is uploaded from the desktop and saved in the specified control.
  • Fixed download capability to work properly for all result types, including contour plots and molecules.
  • Added rappture::signal so we can catch SIGHUP and clean up the upload/download spool directory.
File:
1 edited

Legend:

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

    r115 r193  
    2323    public method load {newobj}
    2424    public method widgetfor {path args}
     25    public method valuefor {path args}
    2526    public method changed {path}
    2627    public method notify {option owner args}
     
    8485    } else {
    8586        unset _path2widget($path)
     87    }
     88}
     89
     90# ----------------------------------------------------------------------
     91# USAGE: valuefor <path> ?<newValue>?
     92#
     93# Used by embedded widgets such as a Loader to query or set the
     94# value of another control.  With no extra args, it returns the
     95# value of the widget at the <path> in the XML.  Otherwise, it
     96# sets the value of the widget to <newValue>.
     97# ----------------------------------------------------------------------
     98itcl::body Rappture::ControlOwner::valuefor {path args} {
     99    # if this is a query operation, then look for the path
     100    if {[llength $args] == 0} {
     101        if {[info exists _path2widget($path)]} {
     102            return [$_path2widget($path) value]
     103        }
     104        return ""
     105    }
     106
     107    # otherwise, set the value
     108    if {[llength $args] > 1} {
     109        error "wrong # args: should be \"valuefor path ?newValue?\""
     110    }
     111
     112    if {[info exists _path2widget($path)]} {
     113        $_path2widget($path) value [lindex $args 0]
     114    } else {
     115        error "bad path \"$path\": should be one of [join [lsort [array names _path2widget]] {, }]"
    86116    }
    87117}
Note: See TracChangeset for help on using the changeset viewer.