antun
02-04-2003, 04:55 PM
If you have text fields that will accept data, but you don't know how much text there will be (e.g. it gets set at runtime, from a script or by datapaths), it can be frustrating that the text gets clipped.
Here's a simple fix:-
<class name="resizetext" extends="text">
<method event="ontext">
this.setWidth( this.getTextWidth() );
</method>
</class>
Our custom resizetext class will stretch every time text is set to it.
However, be warned that this is expensive (which is why we didn't set this as default).
Enjoy!
Here's a simple fix:-
<class name="resizetext" extends="text">
<method event="ontext">
this.setWidth( this.getTextWidth() );
</method>
</class>
Our custom resizetext class will stretch every time text is set to it.
However, be warned that this is expensive (which is why we didn't set this as default).
Enjoy!