GuiRadioButtonSetSelected: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Add missing OOP info)
m (typo)
 
Line 7: Line 7:
bool guiRadioButtonSetSelected ( element guiRadioButton, bool state )
bool guiRadioButtonSetSelected ( element guiRadioButton, bool state )
</syntaxhighlight>  
</syntaxhighlight>  
{{OOP||[[Element/GUI/Radio button|GuiRadioButton]]:setSelected|selected|guiRadioButtongetSelected}}
{{OOP||[[Element/GUI/Radio button|GuiRadioButton]]:setSelected|selected|guiRadioButtonGetSelected}}


===Required Arguments===  
===Required Arguments===  

Latest revision as of 19:31, 6 September 2021

This function selects or unselects a radio button.

Syntax

bool guiRadioButtonSetSelected ( element guiRadioButton, bool state )

OOP Syntax Help! I don't understand this!

Method: GuiRadioButton:setSelected(...)
Variable: .selected
Counterpart: guiRadioButtonGetSelected


Required Arguments

  • guiRadioButton: The GUI radio button in which you wish to change the selection state of
  • state: The state of the radio button, where true indicates selected, and false indicates unselected.

Returns

Returns true if the radio button's selection state was successfully set, false otherwise.

Example

This example creates a radio button then checks if one is selected and if it is, then it's output the title and sets the next radio button selected. (TESTED!)

hi = guiCreateRadioButton(243,204,36,16,"Hi",false)
guiRadioButtonSetSelected(hi,true)
bye = guiCreateRadioButton(243,224,41,16,"Bye",false)

if(guiRadioButtonGetSelected(hi))then
	outputChatBox("Hi "..getPlayerName(localPlayer))
	guiRadioButtonSetSelected(bye,true)
else
	outputChatBox("Bye "..getPlayerName(localPlayer))
	guiRadioButtonSetSelected(hi,true)
end

See Also

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI