Community
Participate
Working Groups
Created attachment 130661 [details] Bug demo Build ID: M20080911-1700 Steps To Reproduce: 1. Create a tree with style SWT.NO_SCROLL 2. Call Tree.setTopItem (e.g. by a button) More information: The method for tables (Table.setTopIndex) is working for tables with SWT.NO_SCROLL.
Steve, on windows the SWT.NO_SCROLL Tree doesn't scroll at all (arrow down moves the selection but doesn't scroll to ensure the selection is visible). Is that by design ? (note, GTK behaves differently) Apparently, OS.SendMessage (handle, OS.TVM_SELECTITEM, OS.TVGN_FIRSTVISIBLE, hItem); is a no-op when OS.TVS_NOSCROLL is set. I was able the fix setItemCount() using this: OS.SetWindowLong(handle, OS.GWL_STYLE, style & ~OS.TVS_NOSCROLL); OS.SendMessage (handle, OS.TVM_SELECTITEM, OS.TVGN_FIRSTVISIBLE, hItem); OS.SetWindowLong(handle, OS.GWL_STYLE, style); Maybe the same fix is needed in all places we send OS.TVM_SELECTITEM.
This is not by design.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.