Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] replace widget in an composite?


0) If not using a layout, use getBounds() to remember the position of the old widget.
1) Use "dispose()" to get rid if the old widget.
2) Use "new" to create the new Widget.
3) Are you using a layout?  If not, use setBounds() to position the new widget and you are done. If using a layout, you'll need to set the layout data for the new widget.
4) Depending on the (layout ie. FormLayout doesn't need this but GridLayout does) position the new widget to be at the same Z-order (using moveBelow() or moveAbove()).
5) Call "parent.layout()" to position the new widget.



"Tobias Hinze" <Stefflatz@xxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

11/19/2003 09:48 AM
Please respond to platform-swt-dev

       
        To:        platform-swt-dev@xxxxxxxxxxx
        cc:        
        Subject:        [platform-swt-dev] replace widget in an composite?



hi,
i want to replace a widget by another in an composite. the widget is placed
in an composite.  first i try to delete the widget by setting the parent
composite to null and now redraw and update the composite. but the widget doesn't
disappears. is it possible to clear the composite or remove the widget from
the composite? for example: i wanna change a widget (CheckButton)  to a new
widget(List).
what's the best way?
thanks

--
GMX Weihnachts-Special: Seychellen-Traumreise zu gewinnen!

Rentier entlaufen. Finden Sie Rudolph! Als Belohnung winken
tolle Preise. http://www.gmx.net/de/cgi/specialmail/

+++ GMX - die erste Adresse für Mail, Message, More! +++

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev


Back to the top