SashForm: how to replace children [message #451553] |
Wed, 02 March 2005 20:27 |
Rich Messages: 7 Registered: July 2009 |
Junior Member |
|
|
I want to have an explorer-type window with a tree on the left, a divider,
and a display on the right. I want the right side to change depending on
what is selected on the left side.
I created a SashForm and created a Tree for the left side, along with the
listeners and whatnot to know when something is selected. I can create one
widget for the right side, maybe a Table or something, but I can't figure
out how to replace the right side widget with something else when a
different item is selected in the tree. For example, I might want to
display a table when the root node is selected, but display a tree when
another item is selected.
I haven't found a way to do this in SWT. In Swing and wxWidgets there's a
replaceWindow() type API that can be used to replace the widget in a split
frame. How can this be done in SWT?
One solution I thought of was to put a Composite on the right side and
replace the contents of the Composite. But I couldn't figure out how to do
that, either.
Thanks,
Rich
|
|
|
Re: SashForm: how to replace children [message #451554 is a reply to message #451553] |
Wed, 02 March 2005 20:46 |
Veronika Irvine Messages: 1272 Registered: July 2009 |
Senior Member |
|
|
You have two (at least) options
1) Dispose the widget on the right, create a new one and call
SashForm.layout(true)
2) On the right create a Composite and give it a StackLayout (in
org.eclipse.swt.custom). The Composite can parent the widgets on the right
and you can flip between which one is showing using StackLayout.topControl
and calling Composite.layout(true);
"Rich" <bogus_user@hotmail.com> wrote in message
news:d057k4$347$1@www.eclipse.org...
>I want to have an explorer-type window with a tree on the left, a divider,
>and a display on the right. I want the right side to change depending on
>what is selected on the left side.
>
> I created a SashForm and created a Tree for the left side, along with the
> listeners and whatnot to know when something is selected. I can create one
> widget for the right side, maybe a Table or something, but I can't figure
> out how to replace the right side widget with something else when a
> different item is selected in the tree. For example, I might want to
> display a table when the root node is selected, but display a tree when
> another item is selected.
>
> I haven't found a way to do this in SWT. In Swing and wxWidgets there's a
> replaceWindow() type API that can be used to replace the widget in a split
> frame. How can this be done in SWT?
>
> One solution I thought of was to put a Composite on the right side and
> replace the contents of the Composite. But I couldn't figure out how to do
> that, either.
>
> Thanks,
> Rich
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02843 seconds