POLPOX 779 Posted July 30, 2017 I found ctrlCreate, then test some but ctrlAdd/SetEventHandler did nothing. Can we add Event Handler to a ctrlCreate'd control? Is it possible or impossible? disableSerialization ; _disp = findDisplay 46 createDisplay "RscDisplayEmpty" ; _slider1 = _disp ctrlCreate ["RscXSliderH",10001] ; _slider1 ctrlSetPosition [0,0.9,0.5,0.03] ; _slider1 ctrlSetEventHandler ["OnSliderPosChanged","hintsilent str _this"] ; ... Share this post Link to post Share on other sites
Grumpy Old Man 3546 Posted July 30, 2017 Did you try findDisplay 46 displayctrl _slider1 ctrlSetEventhandler? Cheers Share this post Link to post Share on other sites
POLPOX 779 Posted July 30, 2017 26 minutes ago, Grumpy Old Man said: Did you try findDisplay 46 displayctrl _slider1 ctrlSetEventhandler? Sorry, I just found how to do it. _slider1 ctrlAddEventHandler ["SliderPosChanged","hintsilent str _this"] ; _slider1 ctrlSetEventHandler ["SliderPosChanged","hintsilent str _this"] ; It works. Share this post Link to post Share on other sites
killzone_kid 1332 Posted July 30, 2017 Yeah, you should drop "On", used only in configs, dunno why OnSliderPosChanged Share this post Link to post Share on other sites