ctrlAddEventHandler: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Arma[ _]2(\|.*)\]\]" to "{{GameCategory|arma2|Scripting Commands}}") |
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
||
Line 1: | Line 1: | ||
{{Command|Comments= | {{Command|Comments= | ||
| arma2 |Game name= | | arma2 |Game name= | ||
Line 8: | Line 7: | ||
|gr1= GUI Control - Event Handlers |GROUP1= | |gr1= GUI Control - Event Handlers |GROUP1= | ||
|gr2= Event Handlers |GROUP2= | |gr2= Event Handlers |GROUP2= | ||
| Add an event handler ([[User Interface Event Handlers]]) to the given control. Returns id of the handler or -1 when failed.<br><br> | | Add an event handler ([[User Interface Event Handlers]]) to the given control. Returns id of the handler or -1 when failed.<br><br> | ||
Line 14: | Line 12: | ||
<br> | <br> | ||
{{Important|When using the event names listed [[User Interface Event Handlers|here]] with the [[ctrlAddEventHandler]], [[ctrlSetEventHandler]], [[displayAddEventHandler]] or [[displaySetEventHandler]] commands, the prefix "on" in the event name must be removed (e.g. ''''ButtonDown'''' instead of ''''onButtonDown'''').}} |DESCRIPTION= | {{Important|When using the event names listed [[User Interface Event Handlers|here]] with the [[ctrlAddEventHandler]], [[ctrlSetEventHandler]], [[displayAddEventHandler]] or [[displaySetEventHandler]] commands, the prefix "on" in the event name must be removed (e.g. ''''ButtonDown'''' instead of ''''onButtonDown'''').}} |DESCRIPTION= | ||
| control '''ctrlAddEventHandler''' [handler,function] |SYNTAX= | | control '''ctrlAddEventHandler''' [handler,function] |SYNTAX= | ||
Line 33: | Line 30: | ||
| [[displayAddEventHandler]], [[ctrlRemoveEventHandler]], [[ctrlRemoveAllEventHandlers]] |SEEALSO= | | [[displayAddEventHandler]], [[ctrlRemoveEventHandler]], [[ctrlRemoveAllEventHandlers]] |SEEALSO= | ||
| |MPBEHAVIOUR= | | |MPBEHAVIOUR= | ||
}} | }} | ||
Revision as of 00:32, 17 January 2021
Description
- Description:
- Add an event handler (User Interface Event Handlers) to the given control. Returns id of the handler or -1 when failed.
- Groups:
- GUI Control - Event HandlersEvent Handlers
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]