[Gambas-user] Scrolling text ... how to do in gambas
M0E Lnx
m0e.lnx at ...626...
Wed Apr 30 19:07:41 CEST 2008
On Fri, Apr 25, 2008 at 2:29 AM, Werner <wdahn at ...1000...> wrote:
> M0E Lnx wrote:
> > I'm not sure this does what I need though...
> > In this code you sent, there is a scrollview, and a text label.
> > The timer shifts the scrollview's Y property to do the animation, but
> > still doesn't work for me, because that would be the same as simply
> > using a text label, and moving it's Y property.
> >
> > That I can do with a timer like in your example... but how to
> > determine how tall or wide the text label has to be in order for the
> > text not to get cut off the label?
> >
> >
> If I understand the question correctly, you want to know how many pixels
> wide and high a given text using a particular font on the screen will be.
>
> The gb.qt Font class has the answer to that.
>
> Example: if the name of your TextLabel is txl then
>
> PRINT "The text is " & txl.Font.Width(txl.Text) & " pixel wide and " &
> txl.Font.Height(txl.Text) & " pixel high."
>
> prints the width and the height when using the TextLabel's font.
>
> One word of caution: Some fonts designers were a little sloppy in
> describing their fonts accurately, especially as far as height is concerned.
>
> Hope I haven't answered a different question :-)
>
> Regards,
>
> Werner
>
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
This is exactly what I needed... thank you
More information about the User
mailing list