Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to remove children from a Composite?
How to remove children from a Composite? [message #455002] Wed, 04 May 2005 23:01 Go to next message
Johan Tibell is currently offline Johan TibellFriend
Messages: 14
Registered: July 2009
Junior Member
Hi,

Is it possible to remove children from a Composite? I'm making a custom
list widget that contains a list of Labels positioned using a
GridLayout. My widget has a setItems(String[] items) much like the List
widget and I want to remove all old labels and create a new one for each
string and add it to the composite.

Regards,

Johan Tibell
Re: How to remove children from a Composite? [message #455018 is a reply to message #455002] Thu, 05 May 2005 12:24 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
To permanently remove a child from a Composite you call dispose() on the
child.

Alternately, if you want to reuse the child later on, with GridData you can
set the "exclude" flag as shown in this snippet:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet175.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup


"Johan Tibell" <johtib@hotmail.com> wrote in message
news:d5bkif$i5k$1@news.eclipse.org...
> Hi,
>
> Is it possible to remove children from a Composite? I'm making a custom
> list widget that contains a list of Labels positioned using a GridLayout.
> My widget has a setItems(String[] items) much like the List widget and I
> want to remove all old labels and create a new one for each string and add
> it to the composite.
>
> Regards,
>
> Johan Tibell
Previous Topic:Minimumn Size for a component inside SashForm
Next Topic:Howto: Disable TabItem of a TabFolder
Goto Forum:
  


Current Time: Fri Apr 19 19:47:36 GMT 2024

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

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

Back to the top