OnClientGUIAccepted: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 6: Line 6:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
element editBox
element editBox
</syntaxhighlight>  
</syntaxhighlight>
* '''editBox''':  The editbox which had focus.
* '''editBox''':  The editbox which had focus.
==Source==
<!-- What's the source? -->
==Example==  
==Example==  
This example creates an editbox and prints a message when enter is pressed.
This example creates an editbox and prints a message when enter is pressed.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
editBox = guiCreateEdit(0.3,0.1,0.4,0.1,"",true)
editBox = guiCreateEdit ( 0.3, 0.1, 0.4, 0.1, "", true )
addEventHandler("onClientGUIAccepted", editBox, function(element)  
addEventHandler( "onClientGUIAccepted", editBox,
  outputChatBox(guiGetText(element))
    function( theElement )  
end)
        outputChatBox( guiGetText( theElement ) )
    end
)
</syntaxhighlight>
</syntaxhighlight>


Line 22: Line 28:
===Client event functions===
===Client event functions===
{{Client_event_functions}}
{{Client_event_functions}}
[[Category:Incomplete]]

Revision as of 14:30, 2 June 2008

This event is fired when enter is pressed on an editbox.

Parameters

element editBox
  • editBox: The editbox which had focus.

Source

Example

This example creates an editbox and prints a message when enter is pressed.

editBox = guiCreateEdit ( 0.3, 0.1, 0.4, 0.1, "", true )
addEventHandler( "onClientGUIAccepted", editBox,
    function( theElement ) 
        outputChatBox( guiGetText( theElement ) )
    end
)

See Also

GUI events

Input

GUI


Client event functions