GuiGetText: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 32: Line 32:
==See Also==
==See Also==
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc -->
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc -->
{{FunctionArea_functions}}
{{GUI_functions}}
[[Category:Need_Syntax]]  -- leave this until syntax is available. Cannot document the function or event without syntax.
[[Category:Incomplete]] -- leave this unless you complete the function

Revision as of 14:09, 30 July 2007

This function is used to get text from GUI elements like edit boxes, labels, buttons, etc.

Syntax

string guiGetText ( element guiElement )

Required Arguments

  • guiElement: element you wish to get text of.

Returns

Returns a string containing the requested element's text, or false if the gui element passed to the function is invalid.

Example

This example gets the text of a pre-made gui element and outputs it to chat box.

function test ()
	--we create a dummy gui label to get text of
	local dummyGuiElement = guiCreateLabel ( 0.45, 0.48, 0.10, 0.04, "Hello world", true )
	--output the text of the label to chat box
	outputChatBox ( "Text in the GUI label: "..guiGetText ( dummyGuiElement ) )
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