SantoJ 0 Posted August 10, 2019 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
sabot10.5mm 47 Posted August 10, 2019 onLoad = "[] spawn {execVM 'listBox.sqf';};"; 2 Share this post Link to post Share on other sites
SantoJ 0 Posted August 10, 2019 i changed the onLoad to what you suggested but still get the same error: https://gyazo.com/380cb42c4a4060f007a84d1b9f14f977 Share this post Link to post Share on other sites
POLPOX 779 Posted August 10, 2019 _listBox = _display displayCtrl 1002; 1 Share this post Link to post Share on other sites
jts_2009 96 Posted August 10, 2019 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 1 Share this post Link to post Share on other sites
SantoJ 0 Posted August 10, 2019 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
jts_2009 96 Posted August 10, 2019 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