ctrlAddEventHandler: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 17: Line 17:


|p3= handler: [[String]] - handler name|= PARAMETER3  
|p3= handler: [[String]] - handler name|= PARAMETER3  
|p4= function: [[String]] - script|= PARAMETER4  
|p4= function: [[String]] or [[Code]] - script|= PARAMETER4  


| [[Number]] |= RETURNVALUE  
| [[Number]] |= RETURNVALUE  
Line 23: Line 23:


|x1= <code>_map [[ctrlAddEventHandler]] ["draw","_this call BIS_fnc_strategicMapOpen_draw"];</code>|= EXAMPLE1  
|x1= <code>_map [[ctrlAddEventHandler]] ["draw","_this call BIS_fnc_strategicMapOpen_draw"];</code>|= EXAMPLE1  
|x2= <code>_map [[ctrlAddEventHandler]] ["draw",{[[hintSilent]] [[str]] _this}];</code>|= EXAMPLE1


____________________________________________________________________________________________
____________________________________________________________________________________________
Line 35: Line 37:
<dl class='command_description'>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on July 03, 2013 - 15:35
<dt class="note">'''[[User:Killzone_Kid|Killzone_Kid]]'''<dd class="note">As of Arma 3 v1.05.111658 [[ctrlAddEventHandler]] and [[displayAddEventHandler]] support script [[Code]] in addition to [[String]] [http://forums.bistudio.com/showthread.php?149636-Development-Branch-Changelog&p=2546439&viewfull=1#post2546439]<br/>


<!-- Note Section END -->
<!-- Note Section END -->

Revision as of 12:15, 30 October 2013

Hover & click on the images for description

Description

Description:
Add an event handler (User Interface Event Handlers) to the given control. Returns id of the handler or -1 when failed.
Groups:
Uncategorised

Syntax

Syntax:
control ctrlAddEventHandler [handler,function]
Parameters:
control: Control
[handler,function]: Array
handler: String - handler name
function: String or Code - script
Return Value:
Number

Examples

Example 1:
_map ctrlAddEventHandler ["draw","_this call BIS_fnc_strategicMapOpen_draw"];
Example 2:
_map ctrlAddEventHandler ["draw",{hintSilent str _this}];

Additional Information

See also:
displayAddEventHandler

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Posted on July 03, 2013 - 15:35
Killzone_Kid
As of Arma 3 v1.05.111658 ctrlAddEventHandler and displayAddEventHandler support script Code in addition to String [1]

Bottom Section