Skip to content
doyousketch2 edited this page Sep 6, 2019 · 14 revisions

Button:

Corresponds to: Fl_Button

Inherits from: Widget

  • fl.Button( int X, int Y, int W, int H, *str label ) ==> userdata
  • fl.Button{ table } ==> userdata (table constructor syntax)
  • obj:clear() ==> bool (same as .value = 0)
  • obj:set() ==> bool (same as value = 1)
  • obj:setonly() (button on + others in group off)
  • methods defined for the Widget userdata type
  • obj.type ==> str mode get (see below)
  • obj.type = str mode set (see below)
  • obj.value ==> bool v get (1 on, 0 off)
  • obj.value = bool v set (1 on, 0 off)
  • obj.down_box ==> str [Fl_Boxtype](https://www.fltk.org/doc-1.3/Enumerations_8H.html#ae48bf9070f8541de17829f54ccacc6bc) get
  • obj.down_box = str [Fl_Boxtype](https://www.fltk.org/doc-1.3/Enumerations_8H.html#ae48bf9070f8541de17829f54ccacc6bc) set
  • obj.shortcut ==> userdata (shortcut key)
  • obj.shortcut = int|str|userdata (shortcut key)
  • obj.down_color ==> userdata get Fl_Color
  • obj.down_color = int|userdata set Fl_Color
  • properties defined for the Widget userdata type

Different behavior for the button can be selected by setting its type mode to one of:

  • "FL_NORMAL_BUTTON" (the default)
  • "FL_TOGGLE_BUTTON"
  • "FL_RADIO_BUTTON"
Clone this wiki locally