OptionGadget()

Syntax

Result = OptionGadget(#Gadget, x, y, Width, Height, Text$)
Description
Creates an OptionGadget in the current GadgetList. If #PB_Any is used as '#Gadget' parameter, the new gadget identifier will be returned as 'Result'. The first time this function is called, a group is created and all following calls of OptionGadget() will add a gadget to this group. To finish the group, just create a gadget of another type. These kind of gadgets are very useful as only one gadget from the group can be selected at any time.

You can add a 'mini help' to this gadget by using GadgetToolTip().

Example:
  If OpenWindow(0,0,0,140,110,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"OptionGadget") And CreateGadgetList(WindowID(0))
    OptionGadget(0, 30, 20, 60, 20, "Option 1")
    OptionGadget(1, 30, 45, 60, 20, "Option 2")
    OptionGadget(2, 30, 70, 60, 20, "Option 3")
    SetGadgetState(1,1)   ; set second option as active one
    Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
  EndIf

Supported OS

All

<- OpenTreeGadgetNode() - Gadget Index - PanelGadget() ->