[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: Re-parenting an SWT control

The ViewForm is not reparented.  It is a direct child of the shell and all
that is changed when you move it around is it's position and size.

In many cases, the ViewForm is shown "inside" a CTabFolder tab.  What
Eclipse is doing, is adding a resize listener to the CTabFolder and
positioning the ViewForm above the client area of the CTabFolder.  Eclipse
tracks the tab selection events and hides/shows the ViewForm as required.

"Buddha" <BuddhaBuddy@xxxxxxxxxxx> wrote in message
news:b8uuj6$ln3$1@xxxxxxxxxxxxxxxx
> Veronika Irvine wrote:
>
> > (Oops, hit "send" too soon by mistake - trying again)
>
> > Please note what it says in the javadoc for setParent:
>
> > * Changes the parent of the widget to be the one provided if
> > * the underlying operating system supports this feature.
>
> > Many operating systems do not support this feature.  I would caution you
> > against using this API.  It has negative side effects even on Windows
where
> > it is supported by the OS.
>
> > "Ivan" <ivanooi@xxxxxxxxxxxx> wrote in message
> > news:3EA73D06.3010206@xxxxxxxxxxxxxxx
> > > this.setParent( Shell )
>
> How does Eclipse do this, then? In Eclipse, I can drag a ViewForm from one
> position to another. If it doesn't remove it from one form and add it to
> another, then how is it done? Is this because of some specialized layout?
>
>