removing child widget from composite; inserting widget in middle of others [message #455865] |
Fri, 20 May 2005 19:23 |
Eclipse User |
|
|
|
Originally posted by: lyubomir.stanford.edu
Hi,
I have a several newbie questions on adding and removing widgets on a
composite panel. In terms of platform, this has to do specifically with
writing SWT guis for an Eclipse plugin.
First of all, how do I remove a widget from a panel? Right now, the only
way to widgets there I know of is something like
Text text = new Text(compositePanel, SWT.Options);
so the widget is created wedded to the panel from the start. I tried
calling dispose() on widget, as was suggested by an earlier thread, but
then my test workbench for the plugin crashed the next time I minimized
(by clicking on - button of the window) and again expanded the window. So
right now I am removing them by making a new composite and adding all
widgets again, but this is atrociously expensive. What is the right way to
do dynamic widget addition/removal at run time?
Also, how do I insert a widget between several already located widgets.
For instance if I have
text1
text3
located on a composite with grid layout numColumns == 1, how do I insert
text2 between them. Naturally, the question implies not a fixed list but
rather a dynamic one, hence there might be 50 widgets there when I start
trying to insert yet another one in the middle.
I hope somebody could help me out here. Thanks in advance for your
consideration.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02990 seconds