IUP/Controls/IupRadio: Difference between revisions

From Vendetta Lua
Jump to navigationJump to search
Created page with "__NOTOC__ __NOEDITSECTION__ {{IUP Controls}} Creates the radio element for grouping mutual exclusive toggles. Only one of its descendet toggles will be active at a time. The..."
 
No edit summary
 
Line 6: Line 6:
===Creation===
===Creation===


    iup.radio{'''element''': ihandle} -> ('''elem''': ihandle)
:<code>iup.radio{'''element''': ihandle} -> ('''elem''': ihandle)</code>


:'''element''': Identifier of an interface element. Usually it is a vbox or an hbox containing the toggles associated to the radio.
:'''element''': Identifier of an interface element. Usually it is a vbox or an hbox containing the toggles associated to the radio.

Latest revision as of 08:19, 12 May 2023


Controls

Dialog
Fill
Hbox
Vbox
Zbox
Cbox
Radio
Button
Canvas
Frame
Label
List
Multiline
Text
Toggle
Progress Bar
Matrix
Tree
Navmap

Creates the radio element for grouping mutual exclusive toggles. Only one of its descendet toggles will be active at a time. The toggles can be at any composion.

Creation

iup.radio{element: ihandle} -> (elem: ihandle)
element: Identifier of an interface element. Usually it is a vbox or an hbox containing the toggles associated to the radio.
This function returns the identifier of the created radio, or nil if an error occurs.

Attributes

VALUE: Identifier of the active toggle.

Examples

<source lang=lua> -- IupRadio Example in IupLua -- Creates a dialog for the user to select his/her gender. -- In this case, the radio element is essential to prevent the user from -- selecting both options.

male = iup.toggle{title="Male"} female = iup.toggle{title="Female"} exclusive = iup.radio {

 iup.vbox
 {
   male,
   female
 };
 value=female,
 tip="Two state button - Exclusive - RADIO"

}

frame = iup.frame{exclusive; title="Gender"}

dialog = iup.dialog {

 iup.hbox
 {
   iup.fill{},
   frame,
   iup.fill{}
 };
 title="IupRadio",
 size=140,
 resize="NO",
 minbox="NO",
 maxbox="NO"

}

dialog:show() </source>

See Also

IupToggle