Answered
Dialogue with list box: listbox stays empty although there is a group defined
Dear friends, I need your sharp eyes!
I have two - IMHO identical - functions to set up a dialogue with list box. One works, one presents the listbox empty...
What is wrong here?
// Test_DebugMenu.jsx ====== UTF-8 ========================================
var KLD_Z = KLD_Z || {}; // global script object
KLD_Z.ThisWorks = function () { // ========================================
var asColours = ["black", "blue", "brown", "green", "mauve", "red", "violet", "white"], wPalC;
wPalC = new Window("dialog", "Colours in this document", undefined);
wPalC.g1 = wPalC.add ("group", undefined, undefined);
wPalC.g1.lis1 = wPalC.g1.add ("listbox", undefined, asColours);
wPalC.g1.lis1.preferredSize.width = 200;
wPalC.g1.lis1.preferredSize.height = 100;
wPalC.show();} //--- end ThisWorks --------------------------------------
KLD_Z.DebugMenu = function () { //=== Invoke individul menu items =========
var aMenuItems, wDlgD;
aMenuItems = ["Fgr_OpenHelpFile", "Fgr_IdentifyObject", "Fgr_AssignProperties"];
wDlgD = new Window("dialog", "Test Debug menu", undefined);
wDlgD.g1 = wDlgD.add ("group", undefined, undefined);
wDlgD.g1.lis1 = wDlgD.add ("listbox", undefined, aMenuItems);
wDlgD.g1.lis1.preferredSize.width = 200;
wDlgD.g1.lis1.preferredSize.height = 100;
wDlgD.show();
} //--- end DebugMenu -----------------------------------------------------
KLD_Z.ThisWorks ();
KLD_Z.DebugMenu ();

