[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]


   NAME
	CreateContext -- create a place for GadTools context data. (V36)

   SYNOPSIS
	gad = CreateContext(glistpointer);
	D0                  A0

	struct Gadget *CreateContext(struct 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.

   RESULT
	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);