PDA

View Full Version : Bug? <window> mis-displays with dynamically set x,y,width,height


bjaspan
11-08-2005, 07:35 PM
I think I found a bug in <window>. Here is an excerpt from my code:

<class name="Comment" extends="window" resizable="true" visible="false">

<method name="set_comment" args="t,x,y,w,h">
<![CDATA[
outer.msg.setAttribute('text', t);
this.setAttribute('x', x);
this.setAttribute('y', y);
this.setAttribute('width', w);
this.setAttribute('height', h);
]]>
</method>

<!-- views "outer" and "msg" appear here -->
</class>

<Comment name="comment">

When code calls comment.set_comment("text", x, y, w, h); comment.setAttribute('visible', true), the view appears and the window borders are right, but the content area seems like it is a single pixel high. If I click on the resizer control (even without dragging it), the window content area snaps to the correct size.

If I put width="nnn" and height="nnn" attributes in the <class> tag, the problem goes away, even thought those values are never used (b/c they are overriden by set_comment).

Thanks,

Barry