你好,我想将以下脚本框滚动到末尾,以便最后写入的字符串始终可见。
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 />);通过检查显示框树,我看到脚本框周围自动创建了一个“滚动框”,但我还没有找到访问它的方法。
有什么建议吗?
谢谢
马泰奥
对于脚本框,您可以使用“设置行”转到特定行
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)]));
包裹脚本框的滚动框似乎是某种奇怪的滚动框(它仍然是脚本框..)
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);