Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Scrolling programmatically
Scrolling programmatically [message #399140] Tue, 16 December 2003 22:52 Go to next message
Eclipse User
Originally posted by: jockep.hotmail.com

I'd like to scroll ScrolledComposites programmatically (scroll up/down
using the arrow up/down keys), but using ScrollBar.setSelection(foo); only
moves the handle up and down, it doesn't scroll the content. I did a
search, and apparently there is a problem with this. Or has been, since
the posts I found regarding this were pretty old. I'm wondering if this is
still the case or if there's a way/workaround to accomplish this now?

/Jocke
Re: Scrolling programmatically [message #399611 is a reply to message #399140] Thu, 18 December 2003 14:21 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika Irvine
Messages: 1272
Registered: July 2009
Senior Member
See ScrolledComposite.setOrigin:

/**
* Scrolls the content so that the specified point in the content is in the
top
* left corner. If no content has been set, nothing will occur.
*
* Negative values will be ignored. Values greater than the maximum scroll
* distance will result in scrolling to the end of the scrollbar.
*
* @param x the x coordinate of the content to appear in the top left corner
*
* @param y the y coordinate of the content to appear in the top left corner
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that
created the receiver</li>
* </ul>
*
* @since 2.0
*/
public void setOrigin(int x, int y)


"Joakim Persson" <jockep@hotmail.com> wrote in message
news:bro2bn$n3d$1@eclipse.org...
> I'd like to scroll ScrolledComposites programmatically (scroll up/down
> using the arrow up/down keys), but using ScrollBar.setSelection(foo); only
> moves the handle up and down, it doesn't scroll the content. I did a
> search, and apparently there is a problem with this. Or has been, since
> the posts I found regarding this were pretty old. I'm wondering if this is
> still the case or if there's a way/workaround to accomplish this now?
>
> /Jocke
>
Re: Scrolling programmatically [message #400305 is a reply to message #399611] Mon, 22 December 2003 14:12 Go to previous message
Eclipse User
Originally posted by: jockep.hotmail.com

Veronika Irvine wrote:

> See ScrolledComposite.setOrigin:

Thank you, this works perfectly.

/Jocke
Previous Topic:Eclipse on Panther with JDK 1.4.2 DP1
Next Topic:SWT Designer v1.2.3 Beta Available - M6 Support, Morphing, etc.
Goto Forum:
  


Current Time: Sat Oct 25 03:31:15 GMT 2014

Powered by FUDForum. Page generated in 0.07993 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software