From: <ro...@us...> - 2011-11-30 21:07:22
|
Revision: 1904 http://nsclspectcl.svn.sourceforge.net/nsclspectcl/?rev=1904&view=rev Author: ron-fox Date: 2011-11-30 21:07:16 +0000 (Wed, 30 Nov 2011) Log Message: ----------- Get callbacks to work Modified Paths: -------------- trunk/SpecTcl/treegui/treeParameterWidget.tcl Modified: trunk/SpecTcl/treegui/treeParameterWidget.tcl =================================================================== --- trunk/SpecTcl/treegui/treeParameterWidget.tcl 2011-11-30 20:35:31 UTC (rev 1903) +++ trunk/SpecTcl/treegui/treeParameterWidget.tcl 2011-11-30 21:07:16 UTC (rev 1904) @@ -51,7 +51,8 @@ ## - # Constructor + # Constructor -- see the summary comments above the class. + # @param args - an option/value list. # constructor args { @@ -84,4 +85,26 @@ incr col } } + ## + # Dispatch a button push to the approprate option command. + # prior to dispatch all occurences of %W in the command are replaced by + # $win (our top level widgte name). The callback is executed at global level + # (uplevel #0). + # + # @param optionName -name of the option holding the script to execute. + # + method callback optionName { + set script $options($optionName) + + # empty scripts are no-ops. + + if {$script ne ""} { + + # Substitute for %W: + + regsub -all {%W} $script $win script + uplevel #0 $script + } + } + } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |