[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