Community
Participate
Working Groups
build 20020920 Run the attached code. The left tree and text behave as they should on Windows and Linux. When you click anywhere in the tree the tree gets focus. Both widgets are children of the shell. The right tree and text only work on Windows. On Linux the text never loses focus when you click on the tree. The text widget is a child of the tree. This causes platform UI bug 2470. We can probably work around by creating the text editor as a sibling of the tree and moving it above the tree.
Created attachment 2031 [details] Test case
Can't work around because the TreeEditor requites that the setEditor parameter be a child of the tree. The workaround works regardless on Windows (i.e., everything still looks and works right), even though the editor parameter is a sibling of the tree. On Linux the editor is not placed properly on top of the tree item label but otherwise works. I'd like to either get this bug fixed or make the TreeEditor work with editors that are not children of the tree.
Assigning to VI. Note that there were weird focus issues on Motif involving "X hate when you assign focus to a parent window". Ask me, Grant or SSQ.
Can I expect a fix for this soon, within the M3 timeframe? This is blocking bug 2470 which is a P2. The goal is to fix all P2s for M3.
I will try to get around to it Knut. We are working hard on the Mac right now to get it back on line. SO i can't give you an exact time.
Putting a force focus in the mouseDown method of Tree seems to do the trick. A similar thing was done in CTabFolder which is also capable of having children. I need to continue to investigate if this is really the right way to go.
Platform UI Bug 16577 seems to be related. I have not been able to create a SWT test case for it but the scenario is similar. The Platform UI TaskList creates a Text widget as a child of a Table widget. When you click the task list title bar setFocus is called on the Table. The Table never gets focus. Focus "bounces back" to the original widget, e.g., StyledText widget if you were in an editor before clicking the task list title bar. Focus transfers properly when I create the Text widget as a sibling of the Table. In a test case, I create a Text widget as a child of a Table in a CTabFolder. When I set focus to the Table the Text widget gets focus which is different behavior from the TaskList.
- Fixed > 1108 by implementing Veronika's suggestion - I'll see if the underlying cause of bug 16577 is similar