[Contents] [index] [Help] [Retrace] [browse <] [Browse >]

The ASL library also contains a font requester.  Using the font requester
is very similar to using the file requester.  First, allocate a requester
structure with allocaslrequest() or allocaslrequesttags().  the type
should be set to ASL_FontRequest in order to get a fontrequester structure:

    struct FontRequester    {
        APTR    fo_Reserved1[2];
        struct TextAttr fo_Attr;        /* Returned TextAttr            */
        UBYTE   fo_FrontPen;            /* Returned pens, if selected   */
        UBYTE   fo_BackPen;
        UBYTE   fo_DrawMode;
        APTR    fo_UserData;
        /* missing from asl.h but present in this structure */
        SHORT   fo_LeftEdge, fo_TopEdge, fo_Width, fo_Height;
        };

Once the requester is set up, call aslrequest() or aslrequesttags() to
make the requester appear on screen.  These functions return TRUE if the
user makes a selection.  In that case, the font selected is returned as a
textattr structure in the fo_attr field of the fontrequester structure.
(The TextAttr structure is defined in <graphics/text.h>.  see the amiga
ROM Kernel Manual: Includes and Autodocs for a complete listing.)  If the
user cancels the font requester FALSE is returned.

     figure 16-2: the asl font requester 

When the requester is no longer needed, call freeaslrequest() to
deallocate the requester data structure.

 specifying font requester options with tagitems 
 example font requester