こんにちは。次のスクリプト ボックスを最後までスクロールして、最後に書き込まれた文字列が常に表示されるようにしたいと思います。
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 />);表示ボックス ツリーを検査すると、スクリプト ボックスの周囲に「スクロール ボックス」が自動的に作成されることがわかりますが、それにアクセスする方法が見つかりません。
なにか提案を?
ありがとう
マテオ
スクリプトボックスでは、Set 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)]));
スクリプト ボックスを囲むスクロール ボックスは、ある種の奇妙なスクロール ボックスのようです (それでもスクリプト ボックスです)。
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);