From: | Rod Schnell |
Date: | 24 Aug 99 at 06:22:15 |
Subject: | Re: Text Boxes |
From: Rod Schnell <rodsch@telusplanet.net>
Hello Laura
On 23-Aug-99, Laura Vance wrote:
> From: Laura Vance <vancel@amiga.nols.com>
>
> Hi again,
>
> I don't think that my first post made it to the list. I could be wrong,
> but nobody replied to it, so here goes again.
>
> I have made a program that uses a separate window to display some text.
> The text is too long to fit on one line in a window, and it looks nicer to
> have it wrap around the edge for another line. I couldn't find a text box
> style gadget within the system libraries (one might be there, but I didn't
> find it) I tried making a regular text box from the gadtools.library large
> enough to hold it, but all the larger text box did was still let the text
> flow out of the other side. I wrote a small function to count the
> characters based on the width of the font and try to wrap them at the
> appropriate time, and it works with some fonts, but I would prefer to let
> the system handle that.
>
> I'm sure there is a simple solution to this problem, because everyone does
> this kind of thing every day, and I know that I've overlooked a very simple
> solution.
>
> Any help will be appreciated.
Sounds like a job for TextFit(), TextFit() tells how much of a string Text()
can print into a given rastport from the current pen position with the width
of the rastport's font taken into consideration. Alternatively, you might
find it simpler to use a BOOPSI gadget such as texteditor.gadget or
textfield.gadget.
Rod