home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / e / EasyGUI_v33b2.lha / Docs / button.doc < prev    next >
Text File  |  1996-12-04  |  3KB  |  69 lines

  1. Button PLUGIN
  2. -------------
  3. A flexible button gadget in three flavours: normal (momentary), toggle and
  4. push (sticky).  Uses the 'button.gadget' which needs to be in the normal
  5. place of libs:gadgets/ (usually libs: is also assigned to sys:classes/, and
  6. .gadget files should be stored in the sys:classes/gadgets/ directory).
  7.  
  8. Constructors:
  9.  
  10.     button(text,resizex=FALSE,resizey=FALSE,disabled=FALSE)
  11.         text     -> The button's label
  12.         resizex  -> Whether this button can resize in width
  13.         resizey  -> Whether this button can resize in height
  14.         disabled -> Whether this gadget is disabled
  15.  
  16.     togglebutton(text,selected=FALSE,resizex=FALSE,resizey=FALSE,
  17.                  disabled=FALSE)
  18.         text     -> The button's label
  19.         selected -> Whether this button is selected (on) initially
  20.         resizex  -> Whether this button can resize in width
  21.         resizey  -> Whether this button can resize in height
  22.         disabled -> Whether this gadget is disabled
  23.  
  24.     pushbutton(text,selected=FALSE,resizex=FALSE,resizey=FALSE,
  25.                disabled=FALSE)
  26.         text     -> The button's label
  27.         selected -> Whether this button is selected (on) initially
  28.         resizex  -> Whether this button can resize in width
  29.         resizey  -> Whether this button can resize in height
  30.         disabled -> Whether this gadget is disabled
  31.  
  32. Destructor:
  33.  
  34.     END *must* be called for each NEWed object.
  35.  
  36. Data (should be considered read-only):
  37.  
  38.     OBJECT button OF plugin
  39.       selected  -> Current state of the button (=0 is off, <>0 is on)
  40.       disabled  -> Disabled or enabled
  41.     PRIVATE ...
  42.     ENDOBJECT
  43.  
  44.     The selected element is useful only for toggle and push buttons.
  45.  
  46. New methods:
  47.  
  48.     setselected(selected=TRUE) -> Set the button on or off
  49.     settext(text)              -> Change the button label
  50.     setdisabled(disabled=TRUE) -> Disable/enable the gadget
  51.  
  52.     Note: setselected() is ignored for normal buttons.
  53.     Note: push buttons cannot be deselected by the user (they're sticky),
  54.           so use setselected() to deselect them when necessary.
  55.     Note: settext() does not check that the new label is not too wide...
  56.  
  57. Action functions:
  58.  
  59.     Your action function will be called (or your action value returned by
  60.     easygui()) in the following circumstances:
  61.       o When the button is pressed to select or deselect it.
  62.  
  63. Exceptions:
  64.  
  65.     "butt" will be raised by the constructor if the .gadget file can't be
  66.            opened.
  67.     "butt" will be raised by the render() method if the gadget can't be
  68.            created.
  69.