Hi,

you can use a edit field with the same attributes (font, size, bold,
italic, ...) and  idealBoundingRect to determine the size of the text.
See http://code.google.com/intl/en/apis/desktop/docs/releasenotes-v55.html#s10
for details on idealBoundingRect.

If you set the edit to the same width as your label and enable the
multiline and wordwrap features you can detect the necessary height of
the element to display all text.

Best regards,
Benjamin

On Jun 2, 4:58 pm, Klas <[email protected]> wrote:
> Hi
>
> I've made a simple gadget that grabs the latest entry of an RSS feed
> and displays a message in a label on a fixed width view.
>
> The problem is that I need to know if the text (word-wrapped) exceeds
> the height of the label. If there is a way to find out if the text is
> clipped or not, my idea was to incrementally increase the label height
> until it fits and then animate the Y position of the label so that it
> scrolls upwards.
>
> Ideally I'd like to see the label expand in height automatically so
> that the text fits (Like the way DIV elements work with the default
> CSS-overflow setting work). I also noticed that you can set trimming
> on a label as well but as far as I can tell there is no way to
> determine if the text is trimmed or not through the api as the value
> of the label returns the full content of the label as opposed to the
> trimmed text.
>
> Any ideas would be highly appreciated.
>
> Thanks
>
> Klas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Desktop Developer Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Desktop-Developer?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to