[SWT] Remove children from a composite (special case) [message #560118] |
Tue, 21 September 2010 05:15  |
Eclipse User |
|
|
|
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
|
|
|
|
Re: [SWT] Remove children from a composite (special case) [message #560125 is a reply to message #560118] |
Tue, 21 September 2010 05:34  |
Eclipse User |
|
|
|
No, as I said I created my own layout manager.
And I don't really want to use the same technique because the images will be updated regularly and I don't want to end up with a huge list of children in which only a couple are still valid. It feels very wrong.
But maybe, as I said, I am abusing SWT here. How would you implement something like that ?
|
|
|
Powered by
FUDForum. Page generated in 0.38200 seconds