Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » removing child widget from composite; inserting widget in middle of others
removing child widget from composite; inserting widget in middle of others [message #455865] Fri, 20 May 2005 19:23 Go to next message
Eclipse UserFriend
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.
eclipse no longer crashes. Still, how do I insert widgets in middle of a list? [message #455866 is a reply to message #455865] Fri, 20 May 2005 19:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lyubomir.stanford.edu

ok, the crashing on disposal behavior went away once I started calling
pack(true) on the parent composite. That's solved.

Still, is there a way to insert widgets in middle of the list? Anybody
knows?
Re: removing child widget from composite; inserting widget in middle of others [message #455867 is a reply to message #455865] Fri, 20 May 2005 19:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

You add at the end using the normal way, and then use
control.moveAbove(control) or control.moveBelow(control) to get it in
the middle.



--
Thanks,
Rich Kulp
Re: removing child widget from composite; inserting widget in middle of others [message #455868 is a reply to message #455865] Fri, 20 May 2005 19:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lyubomir.stanford.edu

I have solved the disposal problem already by calling packed(true) on the
parent.

But can somebody still give me advice on inserting in middle of a list?
Re: removing child widget from composite; inserting widget in middle of others [message #455869 is a reply to message #455867] Fri, 20 May 2005 19:57 Go to previous message
Eclipse UserFriend
Originally posted by: lyubomir.stanford.edu

got it, thanks a lot!

Sorry about the other message, it is because from caching it looked like
my comment got lost.
Previous Topic:FormText robustness?
Next Topic:Table / Gutter - Markers
Goto Forum:
  


Current Time: Sat Apr 27 05:17:50 GMT 2024

Powered by FUDForum. Page generated in 0.02990 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top