OnClientGUIChanged: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(change 'theElement' to 'element')
Line 5: Line 5:
==Parameters==  
==Parameters==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
element theElement
element element
</syntaxhighlight>  
</syntaxhighlight>  
* '''theElement''': The GUI [[element]] which was changed.
* '''element''': The GUI [[element]] which was changed.


==Source==
==Source==

Revision as of 19:01, 17 July 2020

This event is fired when a memo or an editbox has changed (either by the user or by guiSetText).

Parameters

element element
  • element: The GUI element which was changed.

Source

The source of this event is the element which was changed.

Example

This example creates an editbox and prints a message when it has changed

editBox = guiCreateEdit(0.3,0.1,0.4,0.1,"",true)
addEventHandler("onClientGUIChanged", editBox, function(element) 
   outputChatBox("The box now reads: " .. guiGetText(element))
end)

Or

editBox = guiCreateEdit(0.3,0.1,0.4,0.1,"",true)
addEventHandler("onClientGUIChanged", editBox, function() 
   outputChatBox("The box now reads: " .. guiGetText(source))
end)

See Also

Input

GUI


Client event functions