cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

JMP Wish List

We want to hear your ideas for improving JMP. Share them here.
Choose Language Hide Translation Bar

Scroll Box to support the << Scroll Window() command

Just as the title says, it'd be nice if the Scroll Box() supported the << Scroll Window() command.  Key advantage is being able to put in a DisplayBox and have the Scroll Box go straight to it.

1 Comment

This can be accomplished with a combination of <<Get Offset and <<Set Scroll Position. If the box being scrolled to is nested in the display tree, multiple calls to <<Get Offset (adding up the sum of offsets) will be needed on each parent up to the scroll box container. Below is an example where the box is just one level deep in the scroll box.

New Window("scroll to offset example",
	sb = V Scroll Box(size(100), vlb = v list box()),
	button box("Scroll to Important stuff",
		<<set function(function({this},
			offset = tb << get offset();
			show(offset);
			sb << set scroll position(offset[1], offset[2])
		))
	)
);

append = Function({vlb, n, text},
	{i},
	for( i = 1, i <= n, i++,
		vlb << Append(text box(text))
	);
);
// append some boxes
append(vlb, 10, "placeholder");
vlb << append(tb = text box("important stuff"));
append(vlb, 10, "placeholder");

However, a new message for scrolling to a box might be useful, so we have sent this suggestion to our development team for review.