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

  1. FUNCTION  killgadget()  -  Remove and de-allocate a gadget
  2.  
  3.        killgadget(win, gadg)
  4.      struct Window    *win;
  5.      struct Gadget    *gadg;
  6.  
  7.     This function will remove a gadget from your window and de-allocate all
  8. of its resources.  After this call, gadg will be invalid and will no
  9. longer appear in your window.
  10.  
  11.     Unfortunately this call is not orthogonal to the rest of the kill()
  12. functions, as it needs to know the window from whence it came (to be able
  13. to make the gadget go away).
  14.  
  15.     In case you would want to do this on your own, the memory that is freed
  16. is as follows (in reverse order from how it was allocated) :
  17.  
  18.        gadg->GadgetRender->XY   :  10 * sizeof(SHORT)
  19.        gadg->GadgetRender        :  sizeof(struct Border)
  20.        gadg->IText            :  sizeof(struct IntuiText)
  21.        gadg             :  sizeof(struct Gadget)
  22.  
  23.  
  24.     You should make sure that any dynamically allocated text that may be in
  25. your gadget is managed properly (by having a backup pointer or freeing it
  26. before this call).
  27.  
  28.     After this call, the specified gadget should no longer appear in your
  29. window.
  30.  
  31. TODO : maybe not require the window pointer.  could stuff the value in the
  32.        user data field, but then the user can't use that field.
  33.  
  34. BUGS : shouldn't be
  35.  
  36. SEE ALSO : makeboolgadet(), create_boolgadget(), getyn(), getstring()
  37.  
  38.  
  39.