cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar

ScriptBox scrolling

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(char(i) || "\!N");
// I would like to set a scroll to end here, so that the last written string is visible.
);

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

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: ScriptBox scrolling

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);
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: ScriptBox scrolling

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);
-Jarmo

Re: ScriptBox scrolling

Thanks, it works!

 

Matteo

Recommended Articles