PDA

View Full Version : dynamic tabelement width


dsyliu
12-06-2004, 07:13 AM
Hi all,

I created a <tabslider> and three <tabelement> within a window, and they all work fine. My problem is, once I resize the window, the width of the <tabelement> does not follow up, so I end up having a ugly tabslider. To clearify my question, if my original width for window is 100, and my width of <tabslider> is width="${immediateParent.getAttribute('width')}", then when I resize the window to width=200 by dragging, the size of my tabslider is still 100.

How do I solve this problem? I noticed that the dashboard example does not have this issue, but I don't understand how it is done.

Thank you.

metasarah
12-06-2004, 07:25 AM
Hmm. You are right that getAttribute doesn't work. I'm not sure what's up with that, but here's what I usually do:


<canvas width="800">
<window resizable="true" width="200" height="200">
<tabslider height="100%" width="100%">
<tabelement text="one"/>
<tabelement text="two"/>
<tabelement text="three"/>
</tabslider>
</window>
<window x="300" resizable="true" width="200" height="200">
<tabslider height="100%" width="${immediateParent.width}">
<tabelement text="one"/>
<tabelement text="two"/>
<tabelement text="three"/>
</tabslider>
</window>
</canvas>


Both examples above work.

Sarah

dsyliu
12-06-2004, 09:05 AM
Thank you, it works.

metasarah
12-06-2004, 09:37 AM
I looked into getAttribute. Its meant to be deprecated, but I don't think that made it into the docs and there ought to be a warning. It will be formally deprecated in the next release.

Sorry for the confusion.

Sarah