Hi, I would like to scroll the following script box to the end, so that the last string written is always visible.
w=new window("a", sb=script box());
for (i=1, i<=100, i++,
sb<<APPEND text=""></APPEND> // I would like to set a scroll to end here, so that the last written string is visible.<BR />);By instpect the the display box tree, I see that a "scroll box" is automatically created around the script box, but I have not found a way to access it.
Any suggestion?
thanks
Matteo
For script box you can use Set Line to go to specific line
Names Default To Here(1);
w = New Window("a", sb = Script Box());
maxcount = 100;
For(i = 1, i <= maxcount, i++,
sb << append text(Char(i) || "\!N"); // I would like to set a scroll to end here, so that the last written string is visible.
);
lines = sb << get lines;
sb << Set Line Text(N Items(lines), Char(lines[N Items(lines)]));
The scrollbox which wraps script box seems to be some sort of weird scrollbox (it is still scriptbox..)
Names Default To Here(1);
nw = New Window("a", sb = Script Box());
maxcount = 100;
For(i = 1, i < maxcount, i++,
sb << append text(Char(i) || "\!N"); // I would like to set a scroll to end here, so that the last written string is visible.
);
scroll = nw[ScrollBox(1)];
Show(scroll << Class Name);