brent
04-01-2003, 08:13 AM
Howdy,
I'm creating a class which extends "view" with some objects layed out in it - all relative to each other and the view's dimensions. However, when instantiating several of these views, how can I reference each instance? I can use "this.parent" like the following does, but the real app I'm building has several levels and doing "this.parent.parent...." is not the cleanest -- I'd like to use the ids "first" and "second" if possible - is it?
For example,
--------------------------------------------
<canvas>
<simplelayout axis = "y" spacing = "10" />
<class name = "foo" extends = "view" width = "200" bgcolor = "gray">
<view bgcolor = "red" height = "10" width = "this.parent.width" />
<!-- Want this on the bottom no matter what -->
<view
bgcolor = "blue"
height = "10"
width = "this.parent.width"
y = "this.parent.height - 10"
/>
</class>
<foo height = "100" id = "first" />
<foo height = "200" id = "second" />
</canvas>
--------------------------------------------
Cheers,
Brent
I'm creating a class which extends "view" with some objects layed out in it - all relative to each other and the view's dimensions. However, when instantiating several of these views, how can I reference each instance? I can use "this.parent" like the following does, but the real app I'm building has several levels and doing "this.parent.parent...." is not the cleanest -- I'd like to use the ids "first" and "second" if possible - is it?
For example,
--------------------------------------------
<canvas>
<simplelayout axis = "y" spacing = "10" />
<class name = "foo" extends = "view" width = "200" bgcolor = "gray">
<view bgcolor = "red" height = "10" width = "this.parent.width" />
<!-- Want this on the bottom no matter what -->
<view
bgcolor = "blue"
height = "10"
width = "this.parent.width"
y = "this.parent.height - 10"
/>
</class>
<foo height = "100" id = "first" />
<foo height = "200" id = "second" />
</canvas>
--------------------------------------------
Cheers,
Brent