GuiSetProperty
From Multi Theft Auto: Wiki
This function sets the value of a specific CEGUI property of a GUI element. For a list of properties and their meaning, see the CEGUI properties wiki page.
Syntax
bool guiSetProperty ( element guiElement, string property, string value )
Required Arguments
- guiElement: the GUI element you wish to get a property of.
- property: the name of of property you want the value of.
- value: the new value for the property.
Returns
If the function succeeds it returns true, if it fails it returns false.
Example
This example creates a button when the resource starts and defines a console command that toggles it between enabled (clickable) and disabled (not clickable).
function onStart() button = guiCreateButton( 20, 200, 150, 30, "Test", false ) end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), onStart ) function toogleButton() local currentState = guiGetProperty( button, "Disabled" ) if currentState == "False" then guiSetProperty( button, "Disabled", "True" ) else guiSetProperty( button, "Disabled", "False" ) end end addCommandHandler( "togglebtn", toogleButton )
See Also
- getChatboxLayout
- guiBringToFront
- guiCreateFont
- guiGetAlpha
- guiGetEnabled
- guiGetFont
- guiGetInputEnabled
- guiGetInputMode
- guiGetPosition
- guiGetProperties
- guiGetProperty
- guiGetScreenSize
- guiGetSize
- guiGetText
- guiGetVisible
- guiMoveToBack
- guiSetAlpha
- guiSetEnabled
- guiSetFont
- guiSetInputEnabled
- guiSetInputMode
- guiSetPosition
- guiSetProperty
- guiSetSize
- guiSetText
- guiSetVisible
- isChatBoxInputActive
- isConsoleActive
- isDebugViewActive
- isMainMenuActive
- isMTAWindowActive
- isTransferBoxActive
Buttons
Checkboxes
Comboboxes
- guiCreateComboBox
- guiComboBoxAddItem
- guiComboBoxClear
- guiComboBoxGetItemText
- guiComboBoxSetItemText
- guiComboBoxRemoveItem
- guiComboBoxGetSelected
- guiComboBoxSetSelected
Edit Fields
Gridlists
- guiCreateGridList
- guiGridListAddColumn
- guiGridListAddRow
- guiGridListAutoSizeColumn
- guiGridListClear
- guiGridListGetItemData
- guiGridListGetItemText
- guiGridListGetRowCount
- guiGridListGetSelectedItem
- guiGridListInsertRowAfter
- guiGridListRemoveColumn
- guiGridListRemoveRow
- guiGridListSetItemData
- guiGridListSetItemText
- guiGridListSetScrollBars
- guiGridListSetSelectedItem
- guiGridListSetSelectionMode
- guiGridListSetSortingEnabled
- guiGridListGetSelectedCount
- guiGridListGetSelectedItems
- guiGridListSetColumnWidth
- guiGridListGetColumnCount
- guiGridListGetItemColor
- guiGridListSetItemColor
- guiGridListGetHorizontalScrollPosition
- guiGridListSetHorizontalScrollPosition
- guiGridListGetVerticalScrollPosition
- guiGridListSetVerticalScrollPosition
Memos
Progressbars
Radio Buttons
Scrollbars
Scrollpanes
- guiCreateScrollPane
- guiScrollPaneGetHorizontalScrollPosition
- guiScrollPaneGetVerticalScrollPosition
- guiScrollPaneSetHorizontalScrollPosition
- guiScrollPaneSetScrollBars
- guiScrollPaneSetVerticalScrollPosition
Static Images
Tab Panels
Tabs
Text Labels
- guiCreateLabel
- guiLabelGetFontHeight
- guiLabelGetTextExtent
- guiLabelSetColor
- guiLabelSetHorizontalAlign
- guiLabelSetVerticalAlign
Windows