ctrlAddEventHandler: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
(Undo revision 87874 by Longbow (talk) ctrlSET indeed does not support code, but this is ctrlADD page)
Line 51: Line 51:
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_GUI_Control|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_GUI_Control|{{uc:{{PAGENAME}}}}]]
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on March 2, 2015 - 07:41 (UTC)</dd>
<dt class="note">[[User:Longbow|Longbow]]</dt>
<dd class="note">
As for Arma 3 1.38 code is not supported for ctrlSetEventHandler, from rpt logs:
12:44:50  Error position: <ctrlSetEventHandler ["LBSelChanged",{tru>
12:44:50  Error Type code, expected String
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 11:11, 2 March 2015

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:
displayAddEventHandlerctrlRemoveEventHandlerctrlRemoveAllEventHandlers

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]

Bottom Section