Jump to content

Recommended Posts

I've got my dialogs running now, save for one item.

 

To set the text of a button, I can use...

ctrlSetText [idc, text]

...but to set the tooltip, I have to use something entirely different...

control ctrlSetTooltip text

So how do I get a handle on the control? Is it _control = display displayCtrl idc? It seems odd to call displayCtrl when the controls are already displayed as per the class I created.

 

Share this post


Link to post
Share on other sites

the first syntax is not entirely safe. if you have multiple dialogs open it might not change the text of the control you are aiming for. the other syntax with "_ctrl ctrlSetText "text"; " is the better option. 

2 hours ago, HereIsJones said:

So how do I get a handle on the control? Is it _control = display displayCtrl idc?

yes.

2 hours ago, HereIsJones said:

It seems odd to call displayCtrl when the controls are already displayed as per the class I created.

config and sqf are two very different worlds. unfortunately, getting control handles is tedious. the usual concept would be:

  • Use _display = findDisplay IDD; to get the display (or use the params from the onLoad UIEH*)
  • Then use _ctrl = _display displayCtrl IDC; to get your control
  • Always use the syntax with _ctrl COMMAND rightArguments instead of relying on the idc

*Using the onLoad UIEH and params is the most elegant way. i am going to add some info to https://community.bistudio.com/wiki/GUI_Tutorial on how BI structures their UI scripts.

  • Like 1
  • Thanks 1

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

×