ctrlAddEventHandler

From Bohemia Interactive Community
Jump to: navigation, search
Introduced with Arma 2 version 1.00
  

Click on the images for descriptions

Introduced in

Game:
Arma 2
Version:
1.00

Description

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

NOTE: Control EHs are processed in reversed order, i.e. last added: first, first added: last. So if you have an override it should be set up in the 1st added EH.

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

Multiplayer:
-
See also:
displayAddEventHandlerctrlRemoveEventHandlerctrlRemoveAllEventHandlers

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

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]

Bottom Section