[SWT] Remove children from a composite (special case) [message #560118] |
Tue, 21 September 2010 09:15 |
Cedric Moonen Messages: 274 Registered: August 2009 |
Senior Member |
|
|
Hello,
I know that this question has already been asked very often but none of the solutions could be applied in my case.
Let me first explain what I am trying to do: I would like to create a widget that display graphical elements (to simplify, it will be a "list" of images, all images are put next to each other). This content of the list will of course change at runtime (some images will be added, other will be removed, an image can be moved inside the list, ...). I made this list a ScrolledComposite with a single composite as content. Then I add the images (a Label for now, but it will probably be a custom composite later) to this composite. I made my own layout in order to position the images properly (according to a specific size for instance).
Now, how could I manage the removal of images on the list ? I tried to call the dispose method of the Label. This works only partially because the composite is not visible anymore but it is still taken into account by my layout (so, I have a blank image instead). I need to remove the composite from the list of children, is there a way to do that ? Or am I abusing SWT here ? How would you implement something like that ?
Thanks
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02273 seconds