ctrlAddEventHandler: Difference between revisions
Jump to navigation
Jump to search
m (Bot: Reverted to revision 110463 by killzone_kid on 2018-11-11T21:55:21Z) |
m (template:command argument fix) |
||
Line 13: | Line 13: | ||
| control '''ctrlAddEventHandler''' [handler,function] |= Syntax | | control '''ctrlAddEventHandler''' [handler,function] |= Syntax | ||
|p1= control: [[Control]] |= | |p1= control: [[Control]] |PARAMETER1= | ||
|p2= [handler,function]: [[Array]] |= | |p2= [handler,function]: [[Array]] |PARAMETER2= | ||
|p3= handler: [[String]] - handler name|= | |p3= handler: [[String]] - handler name|PARAMETER3= | ||
|p4= function: [[String]] or [[Code]] - script|= | |p4= function: [[String]] or [[Code]] - script|PARAMETER4= | ||
| [[Number]] |= | | [[Number]] |RETURNVALUE= | ||
|x1= <code>_map [[ctrlAddEventHandler]] ["draw","_this call BIS_fnc_strategicMapOpen_draw"];</code>|= | |x1= <code>_map [[ctrlAddEventHandler]] ["draw","_this call BIS_fnc_strategicMapOpen_draw"];</code>|EXAMPLE1= | ||
|x2= <code>_map [[ctrlAddEventHandler]] ["draw",{[[hintSilent]] [[str]] _this}];</code>|= | |x2= <code>_map [[ctrlAddEventHandler]] ["draw",{[[hintSilent]] [[str]] _this}];</code>|EXAMPLE1= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[displayAddEventHandler]], [[ctrlRemoveEventHandler]], [[ctrlRemoveAllEventHandlers]] |= | | [[displayAddEventHandler]], [[ctrlRemoveEventHandler]], [[ctrlRemoveAllEventHandlers]] |SEEALSO= | ||
| |= | | |MPBEHAVIOUR= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
}} | }} |
Revision as of 10:30, 7 April 2019
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
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 October 30, 2013 - 11:14
- Killzone_Kid
- As of Arma 3 v1.05.111658 ctrlAddEventHandler and displayAddEventHandler support script Code in addition to String [1]