1 # These procs allow widgets to behave like objects with their own
2 # state variables of processing objects.
5 # generate a "unique" name for a widget variable
6 proc GetWidgetVariable {widget varName} {
7 regsub -all {\.} $widget "_" base
12 # returns an object which will be associated with a widget
13 # A convienience method that creates a name for you
14 # based on the widget name and varible value/
15 proc NewWidgetObject {widget type varName} {
16 set var "[GetWidgetVariable $widget $varName]_Object"
17 # create the vtk object
20 # It is better to keep interface consistent
21 # setting objects as variable values, and NewWidgetObject.
22 SetWidgetVariableValue $widget $varName $var
28 # returns the same thing as GetWidgetVariableValue
29 proc GetWidgetObject {widget varName} {
30 puts "Warning: obsolete call: GetWidgetObject"
31 puts "Please use GetWidgetVariableValue"
32 return "[GetWidgetVariable $widget $varName]_Object"
35 # sets the value of a widget variable
36 proc SetWidgetVariableValue {widget varName value} {
37 set var [GetWidgetVariable $widget $varName]
42 # This proc has alway eluded me.
43 proc GetWidgetVariableValue {widget varName} {
44 set var [GetWidgetVariable $widget $varName]
47 catch {eval "set temp [format {$%s} $var]"}