home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 432b.lha / EzLib / doc / create_boolgadget.doc < prev    next >
Text File  |  1990-11-10  |  2KB  |  53 lines

  1. FUNCTION   create_boolgadget()  -  create a fully spec'ed Boolean gadget
  2.  
  3. struct Gadget *create_boolgadget(l_edge, t_edge, flags, activation, text, id)
  4.          SHORT l_edge, t_edge;
  5.          USHORT flags, activation;
  6.          UBYTE *text;
  7.          USHORT id;
  8.  
  9.     This function gives you total control for easily creating boxed boolean
  10. gadgets of all types.  You specify exactly the flags and activation types
  11. of the gadget and where the top corner should be, and the rest is taken
  12. care of.  The text you specify is centered in the gadget and the gadget has
  13. the ID you give.
  14.  
  15.     You can specify any types of flags you would like, however not much
  16. error checking is done on these values.  Be careful for silly combinations.
  17. You should also remember that you MUST specify either GADGHBOX or GADGHCOMP
  18. for the flags argument.  It is also useful to at minimum specify RELVERIFY
  19. for the Activation argument.  Finally, you should make sure that your
  20. window is listening for Gadget messages (either gadget UP or gadget DOWN).
  21.  
  22.     This function will NOT add the gadget to your window.  This is
  23. something you must do afterwards else you will never see your gadget.  The
  24. only thing this function does is to allocate space and return a pointer to
  25. the properly filled out structure.
  26.  
  27.     The following example will create a boolean gadget at 100,25
  28. which is highlighted by a box.    The text inside the gadget will be
  29. "Don't have a cow dude" and the gadget will have an id of 42.
  30.  
  31.        struct Window *win;        /* assume opened earlier */
  32.        struct Gadget *gadg;
  33.        char *string = "Don't have a cow dude";
  34.  
  35.        gadg = create_boolgadget(100,25, GADGHBOX, RELVERIFY, string, 42);
  36.        if (gadg == NULL)
  37.      error_no_gadg();
  38.  
  39.        /* add it to the window and make it appear */
  40.        AddGadget(gadg, win, NULL);
  41.        RefreshGList(gadg, win, NULL, 1);
  42.  
  43.  
  44. TODO : should provide a way for specifying custom imagery.  Most likely
  45.        that will have to be a seperate call.
  46.  
  47. BUGS : maybe, maybe not (preferably the latter).
  48.  
  49. SEE ALSO : makeboolgadget(), killgadget(), getyn(), getstring(),
  50.        makewindow()
  51.  
  52.  
  53.