Copy link to clipboard
Copied
I'm trying to make a multi selection listbox, but the scroll bar wont show up. According to the ScriptUI Guide it should be generated automatically when I force the list in a container that's too small for its number of elements. But even with a forced "scrolling: true", nothing appears. Scrolling with the mousewheel works, but Id like to have clickable arrows or a small scrollbar.
Initially I had this element layouted as dropdown list, but as I moved to the possibility to select more than one item the listbox was my next step:
Additionaly, the elements are not exactly centered vertically in the box, but should be. It's not by much, but you can see the text in the last element is a little bit higher than the first one:
And here is the code:
myPanel = new Window ('dialog {orientation:"row"}');
var selectableTypes = ["Test 1","Test 2","Test 3","Test 4","Test 5"];
var myGrp = myPanel.add('group {orientation:"row", alignChildren:"fill"}');
var myDropdownLabel = myGrp.add('statictext {text:"Filter: "}');
var myDropdown = myGrp.add("listbox", [0,0,200,20], selectableTypes, {scrolling: true, multiselect: true});
var InverterCheck = myGrp.add('checkbox {text:"Invert"}');
var myButton = myGrp.add("button",[0,0,100,20],"Select Layer");
var creditsButton = myGrp.add("button",[0,0,20,20],"?");
myPanel.center();
myPanel.show();
Found the answer this morning by myself: the problem was
alignChildren:"fill"
in the group. Changed that to "left" and there it was, a beautiful scrollbar.
Copy link to clipboard
Copied
Found the answer this morning by myself: the problem was
alignChildren:"fill"
in the group. Changed that to "left" and there it was, a beautiful scrollbar.