[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Adding widgets to a composite after creation.

For an example of this see
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet98.java?view=co .
Note that pageComposite does not have to be disposed/recreated on each
button press, it just happens in this example because the full "page" is
being replaced each time.

Grant


"Michal Dobisek" <Michal.Dobisek@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:fupip2$26e$1@xxxxxxxxxxxxxxxxxxxx
> Hi Mark,
>
> your approach is perfectly fine - you can add or remove (by disposing
> them) children to a composite at any time - exactly as you did.
>
> The possible reason, why it did not seem to work for you is that you
> didn't call
>
> storedParent.layout();
>
> without this, the children are there, but no one takes care to
> position/draw them.
>
> Michal
>
> > At the moment I have tried what I thought was the most obvious path,
> > which is to store off the parent passed to 'createPartControl' then just
> > use it from the actions like you would normally do during creation (new
> > Label(storedParent, SWT...). But obviously that does not work or I
> > wouldn't have to ask?