Question
Scrollbar truncates contents (using ScriptUI)
I have problem with generating long dialog. I add scrollbar, create 41 rows, but in real created are only rows to 31. (I added higher scrollbar to see whole last elements)
var w = new Window('dialog');
w.maximumSize.height = 400;
var panel = w.add ('panel {alignChildren: "left"}');
var scrollGroup = panel.add ('group {orientation: "column"}');
var scrollBar = panel.add ('scrollbar {stepdelta: 10}');
for (var i = 0; i <= 40; i++) {
var group = scrollGroup.add ("group");
group.edit = group.add ("edittext", undefined, scrollGroup.children.length);
}
// Move the whole scroll group up or down
scrollBar.onChanging = function () {
scrollGroup.location.y = -2 * this.value;
}
w.onShow = function() {
// Set various sizes and locations when the window is drawn
panel.size.height = w.size.height-20;
scrollBar.size.height = w.size.height-20;
scrollBar.size.width = 20;
scrollBar.location = [panel.size.width-30, 8];
scrollBar.maxvalue = scrollGroup.size.height - panel.size.height + 15;
};
w.show();