Jump to content
Sign in to follow this  

Recommended Posts

Im trying to add a few things to a list box however im getting errors relating to missing ; 

 

_display = findDisplay 1400;
_listBox = displayCtrl 1002;
_listBox lbAdd "Trainee Gear";
_listBox lbAdd "Instructor Gear";
_listBox lbAdd "Auto Rifleman";
_listBox lbAdd "Anti-Tank";
_listBox lbAdd "EOD";
_listBox lbAdd "Marksman";
_listBox lbAdd "Sniper";
_listBox lbAdd "Medic";
_listBox lbAdd "Helicopter Pilot";

this is listBox.sqf being called through onLoad within the dialoag.hpp.
 

onLoad = "[] spawn {execVM 'listBox.sqf';};";

 

Share this post


Link to post
Share on other sites
_listBox = _display displayCtrl 1002;

 

  • Like 1

Share this post


Link to post
Share on other sites
7 minutes ago, SantoJ said:

i changed the onLoad to what you suggested but still get the same error: 

 

_listbox = (findDisplay 1400) displayCtrl 1002; // get dialog IDD and IDC of listbox. listbox control is now in variable _listbox

{_listBox lbAdd _x} foreach
  [
  "Trainee Gear",
  "Instructor Gear",
  "Auto Rifleman",
  "Anti-Tank",
  "EOD",
  "Marksman",
  "Sniper",
  "Medic",
  "Helicopter Pilot"
  }; // add stuff to listbox

 

onLoad = "[] spawn {execVM 'listBox.sqf'}"; // execute script

 

  • Like 1

Share this post


Link to post
Share on other sites
5 minutes ago, jts_2009 said:

 


_listbox = (findDisplay 1400) displayCtrl 1002;
_listBox lbAdd "Trainee Gear";
_listBox lbAdd "Instructor Gear";
_listBox lbAdd "Auto Rifleman";
_listBox lbAdd "Anti-Tank";
_listBox lbAdd "EOD";
_listBox lbAdd "Marksman";
_listBox lbAdd "Sniper";
_listBox lbAdd "Medic";
_listBox lbAdd "Helicopter Pilot";

 


onLoad = "[] spawn {execVM 'listBox.sqf'}";

 

Works perfectly with this method thank you!

Share this post


Link to post
Share on other sites

I also edited my post. Better use foreach, so you don't have to write that line again and again

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  

×