Welcome, Guest
Please Login or Register.    Lost Password?

Dynamic window height
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Dynamic window height
#24367
Dynamic window height 6 Months ago  
Hi,

I'm trying to get a window, which dynamically changes its height according to the contained text.

Code:


<skin version="1.4">
<window id="Quote of the Day" w="400" default="1" oncreate="Quote_Initialize('#SKIN#', '#ID#')">
<image element="color.background" scaling="STRETCH" origin1="TOP-LEFT" x1="0" y1="0" origin2="BOTTOM-RIGHT" x2="0" y2="0" />
<text id="Quote.text" text="Refreshing..." x="3" y="3" w="394" align="TOP-LEFT" element="font.normal" color="255,255,255,200" />
<text id="Quote.author" text="" align="BOTTOM-RIGHT" origin="BOTTOM-RIGHT" x="-10" y="-3" element="font.normal.italic" color="255,255,255,200" />
</window>
</skin>



Gives me a window with the height of my background. The text "Refreshing..." seems to have no effect on the text or window element.
Also after running the script "Quote_Initialize" to change the text and redraw the window, there's no change in the window height.
As the text has variable length, I can't exactly determine how many lines it'll have, when it's displayed and therefore only guess, what's the needed height of the text element.

Is there a way to
a) Get window and text elements which change their height according to their height?
b) Determine the number of lines which the displayed text would have by the script?

Thank you
BigMike
Fresh Boarder
Posts: 18
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#24373
Re: Dynamic window height 6 Months ago  
I think you need to use a 'list' element to make the window set the height automatically. Check how the 'File' window is implemented in the Shadow4 addon pack.
Rainy
Moderator
Posts: 6871
graph
User Online Now Click here to see the profile of this user
The administrator has disabled public write access.
 
#24379
Re: Dynamic window height 6 Months ago  
Perfect Thank you very much
BigMike
Fresh Boarder
Posts: 18
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
get the latest posts directly to your desktop