Skip to main content


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 17:01 Go to next message
Jorge Martin is currently offline Jorge MartinFriend
Messages: 5
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 18:57 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
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 Apr 27 01:04:56 GMT 2024

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

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

Back to the top