Last change
on this file since 2138 was
2138,
checked in by mmc, 14 years ago
|
More changes for the regression tester tool. Added a way for all ObjVal?
objects to import their attribute values. Once an ObjVal? has been imported,
it knows everything about itself without having to consult the XML.
Added Rappture::objects::viewer, which can be used to query the viewer for
a particular object type. Each object can have an "input" viewer for
specifying input values, and an "output" viewer for visualizing output
results. Right now, there is only one viewer implemented: an output viewer
for the CurveValue? object. We should create output viewers for all object
types, and then work on the input side too.
Added a "mkobjects.tcl" script used by the Makefile to build up the tclIndex
file. It looks for input/output viewers for all object classes and adds
them to tclIndex so they can be autoloaded.
|
File size:
764 bytes
|
Line | |
---|
1 | object string -extends base { |
---|
2 | palettes "Inputs" |
---|
3 | |
---|
4 | help http://rappture.org/wiki/rp_xml_ele_string |
---|
5 | |
---|
6 | attr default -title "Default Value" -type string -path default |
---|
7 | attr size -title "Size" -type string:validate=size -path size |
---|
8 | attr hints -title "Hint String" -type string -path about.hints |
---|
9 | |
---|
10 | storage { |
---|
11 | private variable _val ;# string value |
---|
12 | } |
---|
13 | |
---|
14 | import xml {xmlobj path} { |
---|
15 | attr import $xmlobj $path |
---|
16 | import_string [$xmlobj get $path.current] |
---|
17 | } |
---|
18 | |
---|
19 | export xml {xmlobj path} { |
---|
20 | $xmlobj put $path $_val |
---|
21 | } |
---|
22 | |
---|
23 | import string {val} { |
---|
24 | set _val $val |
---|
25 | } |
---|
26 | |
---|
27 | export string {var} { |
---|
28 | upvar $var v |
---|
29 | set v $_val |
---|
30 | } |
---|
31 | |
---|
32 | compare { |
---|
33 | return [string compare $_val $_val2] |
---|
34 | } |
---|
35 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.