Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Set scrollbar selection
Set scrollbar selection [message #502786] Wed, 09 December 2009 12:01 Go to next message
jorge is currently offline jorge
Messages: 2
Registered: December 2009
Junior Member
Hi,

I want to modify the horizontal scroll bar position of a Tree using:

tree.getHorizontalBar().setSelection(selection);

I get the horizontal scroll bar point to that position, but the corresponding scroll of the Tree is not done.

I have tried Tree.redraw(), but I don't get it done.

Thanks in advance,

Re: Set scrollbar selection [message #503074 is a reply to message #502786] Thu, 10 December 2009 13:57 Go to previous message
Grant Gayed is currently offline Grant Gayed
Messages: 2149
Registered: July 2009
Senior Member
Hi,

The Table/Tree does not respond to programmatic changes in its scrollbar.
To programmatically scroll a Tree you need to either:

- use a Tree API such as setTopItem(), showItem(), showSelection()
- or use a ScrolledComposite so that you're controlling the scrolling, for
an example of this see
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet296.java?view=co

Grant


<jorge.jose.martin@cgi.com> wrote in message
news:hfol62$i2o$1@build.eclipse.org...
> Hi,
>
> I want to modify the horizontal scroll bar position of a Tree using:
>
> tree.getHorizontalBar().setSelection(selection);
>
> I get the horizontal scroll bar point to that position, but the
corresponding scroll of the Tree is not done.
>
> I have tried Tree.redraw(), but I don't get it done.
>
> Thanks in advance,
>
>
Previous Topic:Cocoa, SWT.Password and listeners
Next Topic:Custom Native Widgets
Goto Forum:
  


Current Time: Sat Aug 30 08:31:31 EDT 2014

Powered by FUDForum. Page generated in 0.11067 seconds