|Tree.setTopItem fails? [message #502515]
||Tue, 08 December 2009 11:15
| Steffen Harbich
Registered: September 2009
found something strange with the tree widget:
1.) If I set a tree item as top item that can't be the top item because there are not enough items below it (for example the last item visible) then the tree jumps to the top root item, i.e. it scrolls to the top. Is this a bug or feature? I think it would be more logical to scroll to the end of the tree.
2.) I call Tree.setTopItem and thereafter the method Tree.getTopItem and sometimes the items differ. The tree item I want to have as top item wasn't set as desired. This occurs even when the tree item is at the middle of the large tree, i.e. there are enough tree items below it such that it should be possible to set it as top item. (note: setting the top item is done after a refresh and a reveal of that item in the tree viewer)
The behavior is observed under Windows 2k and Eclipse 3.2 in a large tree which is managed by TreeViewer, scroll bars are both shown.
Any ideas what's the problem?
|Re: Tree.setTopItem fails? [message #503064 is a reply to message #502672]
||Thu, 10 December 2009 07:58
| Grant Gayed
Registered: July 2009
It should be safe to enclose invocations like these within
setRedraw(false/true) and still get the correct results. I've tried with
swt's 3.4.2 release and cannot make a case of this that fails either, so
it's difficult to investigate further. Maybe the use of TreeViewer is
somehow involved? Are you able to hack your application that shows the
problem to not use the TreeViewer and see if this makes a difference?
"Steffen Harbich" <email@example.com> wrote in message
> Observed also for SWT 3.4.1.
> And I found a possible reason for this: If I do not use Control.setRedraw
enclosing the setTopItem method, then it works as aspected!
> Unfortunately, I can't provide a clean example that shows the issue
because my clean example does not show the wrong behavoir.
> Hope this helps to find out what's going wrong here.
Powered by FUDForum
. Page generated in 0.09459 seconds