/*======================================================================== Utilmen.c - Utility menu functions are in this module. Might want to break it up into two pieces later. For now, we keep just one ========================================================================*/ /* The usual header files to be inserted later */ #include #include #include #include #include #include #include #include #include #include #include /* constants */ /* external functions */ /* external variables */ extern struct Gadget *gads[]; extern char *gadnames[]; extern int nextgad; extern struct Window *w; extern int link; /* Do not add gadget unless told to */ /* global vars */ int nextlink = 0; /* Next link */ /*---------------------------------------------------------------------- Link Gadgets to the window. Sets a global var "lastlinked", so it can keep track of what was already linked to the list. -----------------------------------------------------------------------*/ linkgadgets() { int i; if (nextgad != NULL || link == TRUE) { for (i= nextlink; iGadgetType > 0 || gads[i]->GadgetType < 4 ) { AddGadget(w, gads[i], -1L); nextlink++; } else { kprintf("Enter gadget type first!!!\n"); link = FALSE; return(); } } if (link) { RefreshGadgets(gads[0], w, NULL); } link = FALSE; } else { kprintf("Bad news!!! nextgad is %d\n", nextgad); } }