GuiGetProperties: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:
table guiGetProperties ( element guiElement )
table guiGetProperties ( element guiElement )
</syntaxhighlight>
</syntaxhighlight>
{{OOP||[[GUI widgets|GuiElement]]:getProperties|properties|}}


===Required Arguments===
===Required Arguments===
Line 31: Line 32:
==See Also==
==See Also==
{{GUI functions}}
{{GUI functions}}
{{GUI_events}}

Latest revision as of 17:17, 21 November 2018

This function gets a list of the CEGUI property names and values of a GUI element. To find out what the different properties mean, check out the CEGUI properties page.

Syntax

table guiGetProperties ( element guiElement )

OOP Syntax Help! I don't understand this!

Method: GuiElement:getProperties(...)
Variable: .properties


Required Arguments

  • guiElement: the GUI element you wish to get the properties of.

Returns

If the function succeeds, the return value is a table. Its keys are property names, the corresponding values are the values of the properties (both names and values are always strings). If the function fails, it returns false.

Example

The following example code will create a button and lists its properties in the console if the /btn command is entered.

addCommandHandler("btn",
    function()
        local btn = guiCreateButton(20, 200, 150, 30, "Test", false)
        local props = guiGetProperties(btn)
        for propName,propVal in pairs(props) do
            outputConsole(propName .. " = " .. propVal)
        end
    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