[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: Replace a component in a sashForm?

On 18.4.2003 15:23 Uhr, in article b7otri$ua2$1@xxxxxxxxxxxxx, "Mathieu
Fougeray" <mathieu.fougeray@xxxxxxxxxxxx> wrote:

> Hi all,
> 
> 
> I have a SashForm with Composite objects in it, and I would like to change
> one of these composite with another new Composite object, but I only can add
> at the end of the sashform whereas I would like to replace an existing
> component!
> 
> Indeed : Composite newComposite = new Composite(sashForm, SWT.NONE);
> puts this new composite at the end of the sashForm ;(
> 
> Does anybody have an idea how acn I specify the place where to put a new
> component in a sashForm?
> 
> Thanks for help!
> 
> Mathieu.
> 
> 

You can change the order of Controls (within a Composite) with these
methods: 
    Control.moveAbove (Control control)
and 
    Control.moveBelow (Control control)

So just add your Composite to the SashForm and then
call moveAbove (or moveBelow) on the newly added child to move it
into the desired position relative to an existing child.

--andre