gadtools.library Reference¶
Comprehensive function reference for gadtools.library, synthesised from the AmigaOS NDK 3.2 Release 4 (Autodocs/AG/gadtools).
This page documents 21 functions of gadtools.library. Each function entry follows the canonical autodoc format. struct Name, union Name, enum Name are clickable links to the type definition in the types reference.
Function index¶
CreateContext()CreateGadgetA()CreateMenusA()DrawBevelBoxA()FreeGadgets()FreeMenus()FreeVisualInfo()GetVisualInfoA()GT_BeginRefresh()GT_EndRefresh()GT_FilterIMsg()GT_GetGadgetAttrsA()GT_GetIMsg()GT_PostFilterIMsg()GT_RefreshWindow()GT_ReplyIMsg()GT_SetGadgetAttrsA()LayoutMenuItemsA()LayoutMenusA()ScaleGadgetRectA()SetDesignFontA()
CreateContext()¶
CreateContext -- create a place for GadTools context data. (V36)
Synopsis
gad = CreateContext(glistpointer);
D0 A0
Gadget*CreateContext(Gadget**);
Function
Creates a place for GadTools to store any context data it might need for your window. In reality, an unselectable invisible gadget is created, with room for the context data. This function also establishes the linkage from a glist type pointer to the individual gadget pointers. Call this function before any of the other gadget creation calls.
Inputs
glistptr - address of a pointer to a Gadget, which was previously set to NULL. When all the gadget creation is done, you may use that pointer as your NewWindow.FirstGadget, or in intuition.library/AddGList(), intuition.library/RefreshGList(), FreeGadgets(), etc.
Results
gad - pointer to context gadget, or NULL if failure.
Example
struct Gadget gad; struct Gadget glist = NULL; gad = CreateContext(&glist); * Other creation calls go here \ if (gad) { myNewWindow.FirstGadget = glist; if ( myWindow = OpenWindow(&myNewWindow) ) { GT_RefreshWindow(win,NULL); * other stuff \ CloseWindow(myWindow); } } FreeGadgets(glist);
CreateGadgetA()¶
CreateGadgetA -- allocate and initialize a gadtools gadget. (V36) CreateGadget -- varargs stub for CreateGadgetA(). (V36)
Synopsis
gad = CreateGadgetA(kind, previous, newgad, tagList)
D0 D0 A0 A1 A2
Gadget*CreateGadgetA(ULONG,Gadget*,
struct NewGadget*,TagItem*);
gad = CreateGadget(kind, previous, newgad, firsttag, ...)
Gadget*CreateGadget(ULONG,Gadget*,
struct NewGadget*, Tag, ...);
Function
CreateGadgetA() allocates and initializes a new gadget of the specified kind, and attaches it to the previous gadget. The gadget is created based on the supplied kind, NewGadget structure, and tags.
Inputs
kind - kind of gadget is to be created, one of the XXX_KIND values
defined in
Results
gad - pointer to the new gadget, or NULL if the allocation failed or if previous was NULL.
Notes
Note that the ng_VisualInfo and ng_TextAttr fields of the NewGadget structure must be set to valid VisualInfo and TextAttr pointers, or this function will fail.
The function set by the GTSL_DispFunc tag will be called with its
two parameters passed on the stack. Note that these parameters
are not passed in dedicated registers and you should make no
assumptions about the register contents when it is called. Both
parameters are passed as 32 bit values:
LONG (*function)(struct Gadget *g, LONG level)
The level value is a signed 32 bit integer whose range is limited
to -32768..32767. Previous versions of this documentation
suggested that the level value may have been a signed 16 bit integer
but this has never been the case.
Starting with V37, string and integer gadgets have the GFLG_TABCYCLE
feature automatically. If the user presses Tab or Shift-Tab while
in a string or integer gadget, the next or previous one in
sequence will be activated. You will hear an IDCMP_GADGETUP message
with a code of 0x09. Use {GA_TabCycle, FALSE} to supress this.
Starting with V47, gadgets can be positioned and scaled relative to
the design font of the VisualInfo. To activate this feature, set
NG_GRIDLAYOUT in NewGadget->ng_Flags. The scaling algorithm is
specified in SetDesignFontA(), and examples are given in
ScaleGadgetRectA() as this uses the same algorithm.
See also
FreeGadgets(), GT_SetGadgetAttrs(), GetVisualInfo(), SetDesignFontA(), ScaleGadgetRectA()
CreateMenusA()¶
CreateMenusA -- allocate and fill out a menu structure. (V36) CreateMenus -- varargs stub for CreateMenus(). (V36)
Synopsis
menu = CreateMenusA(newmenu, tagList)
D0 A0 A1
Menu*CreateMenusA(struct NewMenu*,TagItem*);
menu = CreateMenus(newmenu, firsttag, ...)
Menu*CreateMenus(struct NewMenu*, Tag, ...);
Function
CreateMenusA() allocates and initializes a complete menu structure based on the supplied array of NewMenu structures. Optionally, CreateMenusA() can allocate and initialize a complete set of menu items and sub-items for a single menu title. This is dictated by the contents of the array of NewMenus.
Inputs
newmenu - pointer to an array of initialized struct NewMenus. tagList - pointer to an array of tags providing optional extra parameters, or NULL.
Results
menu - pointer to the resulting initialized menu structure (or the resulting FirstItem), with all the links for menu items and subitems in place. The result will be NULL if CreateMenusA() could not allocate memory for the menus, or if the NewMenu array had an illegal arrangement (eg. NM_SUB following NM_TITLE). (see also the GTMN_SecondaryError tag above).
Notes
The strings you supply for menu text are not copied, and must be preserved for the life of the menu. The resulting menus have no positional information. You will want to call LayoutMenusA() (or LayoutMenuItemsA()) to supply that. CreateMenusA() automatically provides you with a UserData field for each menu, menu-item or sub-item. Use the GTMENU_USERDATA(menu) or GTMENUITEM_USERDATA(menuitem) macro to access it.
Bugs
Prior to V39, if you put images into menus using IM_ITEM or IM_SUB for a NewMenu->nm_Type, the image supplied had to be an ordinary struct Image. Starting with V39, you can use boopsi images.
See also
DrawBevelBoxA()¶
DrawBevelBoxA -- draw a bevelled box. (V36) DrawBevelBox -- varargs stub for DrawBevelBoxA(). (V36)
Synopsis
DrawBevelBoxA(rport, left, top, width, height, tagList);
A0 D0 D1 D2 D3 A1
VOID DrawBevelBoxA(RastPort*, WORD, WORD, WORD, WORD,
TagItem*taglist);
DrawBevelBox(rport, left, top, width, height, firsttag, ...);
VOID DrawBevelBox(RastPort*, WORD, WORD, WORD, WORD,
Tag, ...);
Function
This function renders a bevelled box of specified dimensions and type into the supplied RastPort.
Inputs
rport - RastPort into which the box is to be drawn. left - left edge of the box. top - top edge of the box. width - width of the box. height - height of the box. tagList - pointer to an array of tags providing extra parameters
Notes
DrawBevelBox() is a rendering operation, not a gadget. That means you must refresh it at the appropriate time, like any other rendering operation. BBFT_CTXTFRAME requires intuition V47 to render anything.
See also
GetVisualInfoA(), SetDesignFontA()
FreeGadgets()¶
FreeGadgets -- free a linked list of gadgets. (V36)
Synopsis
FreeGadgets(glist)
A0
VOID FreeGadgets(Gadget*glist);
A0
Function
Frees any GadTools gadgets found on the linked list of gadgets beginning with the specified one. Frees all the memory that was allocated by CreateGadgetA(). This function will return safely with no action if it receives a NULL parameter.
Inputs
glist - pointer to first gadget in list to be freed.
See also
FreeMenus()¶
FreeMenus -- frees memory allocated by CreateMenusA(). (V36)
Synopsis
FreeMenus(menu)
A0
VOID FreeMenus(Menu*);
Function
Frees the menus allocated by CreateMenusA(). It is safe to call this function with a NULL parameter.
In case a menu is composed out of several calls to CreateMenus and tied together you still need to call FreeMenus on each pointer returned from CreateMenus. You don't have to untie before calling FreeMenus.
Inputs
menu - pointer to menu structure (or first MenuItem) obtained from CreateMenusA().
See also
FreeVisualInfo()¶
FreeVisualInfo -- return any resources taken by GetVisualInfo. (V36)
Synopsis
FreeVisualInfo(vi)
A0
VOID FreeVisualInfo(APTR);
Function
FreeVisualInfo() returns any memory or other resources that were allocated by GetVisualInfoA(). You should only call this function once you are done with using the gadgets (i.e. after CloseWindow()), but while the screen is still valid (i.e. before CloseScreen() or UnlockPubScreen()).
Inputs
vi - pointer that was obtained by calling GetVisualInfoA(). This value may be NULL.
See also
GetVisualInfoA()¶
GetVisualInfoA -- get information GadTools needs for visuals. (V36) GetVisualInfo -- varargs stub for GetVisualInfoA(). (V36)
Synopsis
vi = GetVisualInfoA(screen, tagList)
D0 A0 A1
APTR vi = GetVisualInfoA(Screen*,TagItem*);
vi = GetVisualInfo(screen, firsttag, ...)
APTR vi = GetVisualInfo(Screen*, Tag, ...);
Function
Get a pointer to a (private) block of data containing various bits of information that GadTools needs to ensure the best quality visuals. Use the result in the NewGadget structure of any gadget you create, or as a parameter to the various menu calls. Once the gadgets/menus are no longer needed (after the last CloseWindow), call FreeVisualInfo().
Inputs
screen - pointer to the screen you will be opening on. This parameter may be NULL, in which case this function fails. tagList - pointer to an array of tags providing optional extra parameters, or NULL.
Results
vi - pointer to private data, or NULL for failure
See also
FreeVisualInfo(), LockPubScreen(), UnlockPubScreen()
GT_BeginRefresh()¶
GT_BeginRefresh -- begin refreshing friendly to GadTools. (V36)
Synopsis
GT_BeginRefresh(win)
A0
VOID GT_BeginRefresh(Window*);
Function
Invokes the intuition.library/BeginRefresh() function in a manner friendly to the Gadget Toolkit. This function call permits the GadTools gadgets to refresh themselves at the correct time. Call GT_EndRefresh() function when done.
Inputs
win - pointer to Window structure for which a IDCMP_REFRESHWINDOW IDCMP event was received.
Notes
The nature of GadTools precludes the use of the IDCMP flag WFLG_NOCAREREFRESH. You must handle IDCMP_REFRESHWINDOW events in at least the minimal way, namely:
case IDCMP_REFRESHWINDOW:
GT_BeginRefresh(win);
GT_EndRefresh(win, TRUE);
break;
See also
GT_EndRefresh()¶
GT_EndRefresh -- end refreshing friendly to GadTools. (V36)
Synopsis
GT_EndRefresh(win, complete)
A0 D0
VOID GT_EndRefresh(Window*, BOOL complete);
Function
Invokes the intuition.library/EndRefresh() function in a manner friendly to the Gadget Toolkit. This function call permits GadTools gadgets to refresh themselves at the correct time. Call this function to EndRefresh() when you have used GT_BeginRefresh().
Inputs
win - pointer to Window structure for which a IDCMP_REFRESHWINDOW IDCMP event was received. complete - TRUE when done with refreshing.
See also
GT_FilterIMsg()¶
GT_FilterIMsg -- filter an IntuiMessage through GadTools. (V36)
Synopsis
modimsg = GT_FilterIMsg(imsg)
D0 A1
IntuiMessage*GT_FilterIMsg(IntuiMessage*);
Function
NOTE WELL: Extremely few programs will actually need this function. You almost certainly should be using GT_GetIMsg() and GT_ReplyIMsg() only, and not GT_FilterIMsg() and GT_PostFilterIMsg().
GT_FilterIMsg() takes the supplied IntuiMessage and asks the
Gadget Toolkit to consider and possibly act on it. Returns
NULL if the message was only of significance to a GadTools gadget
(i.e. not to you), else returns a pointer to a modified IDCMP
message, which may contain additional information.
You should examine the Class, Code, and IAddress fields of
the returned message to learn what happened. Do not make
interpretations based on the original imsg.
You should use GT_PostFilterIMsg() to revert to the original
IntuiMessage once you are done with the modified one.
Inputs
imsg - an IntuiMessage you obtained from a Window's UserPort.
Results
modimsg - a modified IntuiMessage, possibly with extra information from GadTools, or NULL. When NULL, the message passed in to the function should be sent back to Intuition via ReplyMsg()
Notes
Starting with V39, this function actually expects and returns pointers to ExtIntuiMessage structures, but the prototype was not changed for source code compatibility with older software.
See also
GT_GetIMsg(), GT_PostFilterIMsg()
GT_GetGadgetAttrsA()¶
GT_GetGadgetAttrsA -- request the attributes of a GadTools gadget. (V39) GT_GetGadgetAttrs -- varargs stub for GT_GetGadgetAttrsA(). (V39)
Synopsis
numProcessed = GT_GetGadgetAttrsA(gad, win, req, taglist)
A0 A1 A2 A3
LONG GT_GetGadgetAttrsA(Gadget*,Window*,
Requester*,TagItem*);
numProcessed = GT_GetGadgetAttrs(gad, win, req, firsttag, ...)
LONG GT_GetGadgetAttrs(Gadget*,Window*,
Requester*, Tag, ...);
Function
Retrieve the attributes of the specified gadget, according to the attributes chosen in the tag list. For each entry in the tag list, ti_Tag identifies the attribute, and ti_Data is a pointer to the long variable where you wish the result to be stored.
Inputs
gad - pointer to the gadget in question. May be NULL, in which case this function returns 0 win - pointer to the window containing the gadget. req - reserved for future use, should always be NULL taglist - pointer to TagItem list.
Results
numProcessed - the number of attributes successfully filled in.
Example
long top = 0; long selected = 0; long result; result = GT_GetGadgetAttrs( listview_gad, win, NULL, GTLV_Top, &top, GTLV_Selected, &selected, TAG_DONE ); if ( result != 2 ) { printf( "Something's wrong!" ); }
See also
GT_GetIMsg()¶
GT_GetIMsg -- get an IntuiMessage, with GadTools processing. (V36)
Synopsis
imsg = GT_GetIMsg(intuiport)
D0 A0
IntuiMessage*GT_GetIMsg(MsgPort*);
Function
Use GT_GetIMsg() in place of the usual exec.library/GetMsg() when reading IntuiMessages from your window's UserPort. If needed, the GadTools dispatcher will be invoked, and suitable processing will be done for gadget actions. This function returns a pointer to a modified IntuiMessage (which is a copy of the original, possibly with some supplementary information from GadTools). If there are no messages (or if the only messages are meaningful only to GadTools, NULL will be returned.
Inputs
intuiport - the Window->UserPort of a window that is using the Gadget Toolkit.
Results
imsg - pointer to modified IntuiMessage, or NULL if there are no applicable messages.
Notes
Be sure to use GT_ReplyIMsg() and not exec.library/ReplyMsg() on messages obtained with GT_GetIMsg(). If you intend to do more with the resulting message than read its fields, act on it, and reply it, you may find GT_FilterIMsg() more appropriate.
Starting with V39, this function actually returns a pointer to an
ExtIntuiMessage structure, but the prototype was not changed for
source code compatibility with older software.
See also
GT_ReplyIMsg(), GT_FilterIMsg()
GT_PostFilterIMsg()¶
GT_PostFilterIMsg -- return the unfiltered message after GT_FilterIMsg() was called, and clean up. (V36)
Synopsis
imsg = GT_PostFilterIMsg(modimsg)
D0 A1
IntuiMessage*GT_PostFilterIMsg(IntuiMessage*);
Function
NOTE WELL: Extremely few programs will actually need this function. You almost certainly should be using GT_GetIMsg() and GT_ReplyIMsg() only, and not GT_FilterIMsg() and GT_PostFilterIMsg().
Performs any clean-up necessitated by a previous call to
GT_FilterIMsg(). The original IntuiMessage is now yours to handle.
Do not interpret the fields of the original IntuiMessage, but
rather use only the one you got from GT_FilterIMsg(). You
may only do message related things at this point, such as queueing
it up or replying it. Since you got the message with
exec.library/GetMsg(), your responsibilities do include replying
it with exec.library/ReplyMsg(). This function may be safely
called with a NULL parameter.
Inputs
modimsg - a modified IntuiMessage obtained with GT_FilterIMsg(), or NULL in which case this function does nothing and returns NULL
Results
imsg - a pointer to the original IntuiMessage, if GT_FilterIMsg() returned non-NULL.
Notes
Be sure to use exec.library/ReplyMsg() on the original IntuiMessage you obtained with GetMsg(), (which is the what you passed to GT_FilterIMsg()), and not on the parameter of this function.
Starting with V39, this function actually expects and returns
pointers to ExtIntuiMessage structures, but the prototype was not
changed for source code compatibility with older software.
See also
GT_RefreshWindow()¶
GT_RefreshWindow -- refresh all GadTools gadgets in a window. (V36)
Synopsis
GT_RefreshWindow(win, req)
A0 A1
VOID GT_RefreshWindow(Window*,Requester*);
Function
Perform the initial refresh of all the GadTools gadgets you have created. After you have opened your window, you must call this function. Or, if you have opened your window without gadgets, you add the gadgets with intuition.library/AddGList(), refresh them using intuition.library/RefreshGList(), then call this function. You should not need this function at other times.
Inputs
win - pointer to the Window containing GadTools gadgets. req - reserved for future use, should always be NULL
See also
GT_ReplyIMsg()¶
GT_ReplyIMsg -- reply a message obtained with GT_GetIMsg(). (V36)
Synopsis
GT_ReplyIMsg(imsg)
A1
VOID GT_ReplyIMsg(IntuiMessage*);
Function
Reply a modified IntuiMessage obtained with GT_GetIMsg(). If you use GT_GetIMsg(), use this function where you would normally have used exec.library/ReplyMsg(). You may safely call this routine with a NULL pointer (nothing will be done).
Inputs
imsg - a modified IntuiMessage obtained with GT_GetIMsg(), or NULL in which case this function does nothing
Notes
When using GadTools, you MUST explicitly GT_ReplyIMsg() all messages you receive. You cannot depend on CloseWindow() to handle messages you have not replied.
Starting with V39, this function actually expects a pointer to an
ExtIntuiMessage structure, but the prototype was not changed for
source code compatibility with older software.
See also
GT_SetGadgetAttrsA()¶
GT_SetGadgetAttrsA -- change the attributes of a GadTools gadget. (V36) GT_SetGadgetAttrs -- varargs stub for GT_SetGadgetAttrsA(). (V36)
Synopsis
GT_SetGadgetAttrsA(gad, win, req, tagList)
A0 A1 A2 A3
VOID GT_SetGadgetAttrsA(Gadget*,Window*,
Requester*,TagItem*);
GT_SetGadgetAttrs(gad, win, req, firsttag, ...)
VOID GT_SetGadgetAttrs(Gadget*,Window*,
Requester*, Tag, ...);
Function
Change the attributes of the specified gadget, according to the attributes chosen in the tag list. If an attribute is not provided in the tag list, its value remains unchanged.
Inputs
gad - pointer to the gadget in question. Starting with V39, this value may be NULL in which case this function does nothing win - pointer to the window containing the gadget. Starting with V39, this value may be NULL in which case the internal attributes of the gadgets are altered but no rendering occurs. req - reserved for future use, should always be NULL tagList - pointer to an array of tags providing optional extra parameters, or NULL.
Notes
This function may not be called inside of a GT_BeginRefresh() / GT_EndRefresh() session. (As always, restrict yourself to simple rendering functions).
The function set by the GTSL_DispFunc tag will be called with its
two parameters passed on the stack. Note that these parameters
are not passed in dedicated registers and you should make no
assumptions about the register contents when it is called. Both
parameters are passed as 32 bit values:
LONG (*function)(struct Gadget *g, LONG level)
The level value is a signed 32 bit integer whose range is limited
to -32768..32767. Previous versions of this documentation
suggested that the level value may have been a signed 16 bit integer
but this has never been the case.
See also
LayoutMenuItemsA()¶
LayoutMenuItemsA -- position all the menu items. (V36) LayoutMenuItems -- varargs stub for LayoutMenuItemsA(). (V36)
Synopsis
success = LayoutMenuItemsA(menuitem, vi, tagList)
D0 A0 A1 A2
BOOL LayoutMenuItemsA(MenuItem*, APTR,TagItem*);
success = LayoutMenuItems(menuitem, vi, firsttag, ...)
BOOL LayoutMenuItemsA(MenuItem*, APTR, Tag, ...);
Function
Lays out all the menu items and sub-items according to the supplied visual information and tag parameters. You would use this if you used CreateMenusA() to make a single menu-pane (with sub-items, if any), instead of a whole menu strip. This routine attempts to columnize and/or shift the MenuItems in the event that a menu would be too tall or too wide.
Inputs
menuitem - pointer to first MenuItem in a linked list of items. vi - pointer returned by GetVisualInfoA(). tagList - pointer to an array of tags providing optional extra parameters, or NULL.
Results
success - TRUE if successful, FALSE otherwise (signifies that the TextAttr wasn't openable).
Bugs
If a menu ends up being wider than the whole screen, it will run off the right-hand side.
See also
CreateMenusA(), GetVisualInfoA()
LayoutMenusA()¶
LayoutMenusA -- position all the menus and menu items. (V36) LayoutMenus -- varargs stub for LayoutMenusA(). (V36)
Synopsis
success = LayoutMenusA(menu, vi, tagList)
D0 A0 A1 A2
BOOL LayoutMenusA(Menu*, APTR,TagItem*);
success = LayoutMenus(menu, vi, firsttag, ...)
BOOL LayoutMenus(Menu*, APTR, Tag, ...);
Function
Lays out all the menus, menu items and sub-items in the supplied menu according to the supplied visual information and tag parameters. This routine attempts to columnize and/or shift the MenuItems in the event that a menu would be too tall or too wide.
Inputs
menu - pointer to menu obtained from CreateMenusA(). vi - pointer returned by GetVisualInfoA(). tagList - pointer to an array of tags providing optional extra parameters, or NULL.
Results
success - TRUE if successful, FALSE otherwise (signifies that the TextAttr wasn't openable).
Notes
When using this function, there is no need to also call LayoutMenuItemsA().
Bugs
If a menu ends up being wider than the whole screen, it will run off the right-hand side.
See also
CreateMenusA(), GetVisualInfoA()
ScaleGadgetRectA()¶
ScaleGadgetRectA -- scale a gadget rectangle to multiples of font grid boxes
Synopsis
ok = ScaleGadgetRectA(newgadget,tags)
A0 A1
LONG ScaleGadgetRectA(APTR,struct NewGadget*ng,TagItem*tags);
LONG ScaleGadgetRectA(APTR,struct NewGadget*ng,...);
Function
ScaleGadgetRectA() checks the NG_GRIDLAYOUT flag in the NewGadget structure and, if set, performs a font-sensitive scaling of gadget coordinates where the font used for scaling has been defined by SetDesignFontA(). This should best be identical to the font in ng->ng_TextAttr. The upper 12 bits of the gadget positions define multiples of the font width or height divided by four, the lower 4 bits a signed pixel offset (i.e. 0 is no offset, 15 is -1, and 7 is +7, the largest positive offset). After scaling has been performed, NG_GRIDLAYOUT is cleared. This function is also used internally by GadTools for computing the size and position of all gadgets created by CreateGadgetA(), but is present here to pre-compute dimensions, e.g. the size of a window to be opened.
Inputs
ng - pointer to a NewGadget structure that is to be scaled. tags - additional tags for setting the design font.
Results
ok - set if scaling has been performed, 0 if ng remained untouched.
Example
The following code computes the pixel coordinates of 1x1 font cell at position 2,3:
ng.ng_LeftEdge = 2 << 6;
ng.ng_TopEdge = 3 << 6;
ng.ng_Width = 1 << 6;
ng.ng_Height = 1 << 6;
ng.ng_Flags = NG_GRIDLAYOUT;
ScaleGadgetRect(&ng,TAG_DONE);
The lower 4 bits are pixel offsets we do not need,
the next 2 bits are fractional font cell locations,
the bits from 6 bit up are integer font cell sizes.
Thus, integer cell positions are upshifted by 6 bits.
As a general rule of thumb, typical buttons are 7 << 4
positions high, i.e. 1.75 cell positions high, and
checkbox gadgets are 6 << 4, i.e. 1.5 font cells high
and 13 << 4, i.e. 12.25 cell positions wide.
Horizontal sliders should be 5 << 4, i.e. 1.25 cell
positions high.
See also
GetVisualInfoA(), SetDesignFontA()
SetDesignFontA()¶
SetDesignFontA -- define a font for grid layout computation. (V47)
Synopsis
ok = SetDesignFontA(vi,textattr,tags)
A0 A1 A2
LONG SetDesignFontA(APTR,TextAttr*ta,TagItem*tags);
LONG SetDesignFont(APTR,TextAttr*ta,...);
Function
SetDesignFontA() defines a font to be used as basis for grid layout functions for gadget placement with the NG_GRIDLAYOUT flag set. If so, the gadget dimensions and position will be derived from the font sizes. The upper 12 bit define a scaling factor that is multiplied by the width or height of the font divided by 4, the lower 4 bit a pixel offset that is added or subtracted. Without this call, the scaling is based on 8x8 font cells, i.e. topaz.8.
Inputs
vi - pointer that was obtained by calling GetVisualInfoA(). This value may not be NULL. ta - pointer to a TextAttr structure defining the font. This structure is not used any further and may be released after calling SetDesignFontA() tags - additional tags for setting the design parameters or NULL.
Results
ok - boolean success indicator. 0 on failure.
See also
GetVisualInfoA(), ScaleGadgetRectA()