Jump to content
Sign in to follow this  
adanteh

Passing Argumetns Event Handler + Spawn

Recommended Posts

Hello everyone, I can't for the hell of this get this to work so here's a question:

How do I pass arguments with an event handler?

I have two functions in this case, where one function has this among other things:

(_dialog displayCtrl 8010) ctrlSetEventHandler ["MouseButtonClick","[_this, _partsCfg, _partsSelect] spawn VES_fnc_previewPart"];

Now for testing purposes VES_fnc_previewPart only has the following:

_previewCfg = _this select 1;
_previewSelect = _this select 2;
hint format ["cfg: %1, select: %2", _previewCfg, _previewSelect];

I would expect _this select 1 would select the second argument (Being _partsCfg), but that doesn't work. It just returns 'any'. Is there any way I can pass arguments with an event handler like that? I don't care much for the arguments of the button click thing itself, I just want to pass some arguments from the first function.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×