Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » how do you walk down the swt child chain for a swing frame?
how do you walk down the swt child chain for a swing frame? [message #441753] Mon, 23 August 2004 18:42 Go to next message
David Scott is currently offline David ScottFriend
Messages: 19
Registered: July 2009
Junior Member
what connects the embedded composite to the swing frame?
Re: how do you walk down the swt child chain for a swing frame? [message #441755 is a reply to message #441753] Mon, 23 August 2004 20:02 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
In SWT_AWT:

/**
* Creates a new <code>Shell</code>. This Shell is the root for
* the SWT widgets that will be embedded within the AWT canvas.
*
* @param display the display for the new Shell
* @param parent the parent <code>java.awt.Canvas</code> of the new Shell
* @return a <code>Shell</code> to be the parent of the embedded SWT widgets
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the display is null</li>
* <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
* </ul>
*
* @since 3.0
*/
public static Shell new_Shell (final Display display, final Canvas parent)


The SWT widgets are created as children of the Shell returned by this
method. Shell.getChildren() can be used to walk the child tree.

Given a Swing Canvas, I do not think that there is a way to find an
associated SWT Shell.

"David Scott" <user@example.net> wrote in message
news:cgddpt$8m2$1@eclipse.org...
> what connects the embedded composite to the swing frame?
>
Re: how do you walk down the swt child chain for a swing frame? [message #441756 is a reply to message #441755] Mon, 23 August 2004 20:29 Go to previous message
David Scott is currently offline David ScottFriend
Messages: 19
Registered: July 2009
Junior Member
i was interested in the other way:

given a Composite - how do you use Composite.getChildren to find the
swing Frame created with SWT_AWT.newFrame(Composite)? I have an menu
action to pass to a (swing) Editor - and the hooks are there to find the
active editor and its Composite - can i walk down Composite.getChildren?
it looks like i can find the "embedded" component with
Composite.getStyle - can i get the Frame from the embedded component?
for now, i just tagged the editor with an interface that saves off the
frame - and i moved on.

thanks for taking the time to respond-
david

Veronika Irvine wrote:

> In SWT_AWT:
>
> /**
> * Creates a new <code>Shell</code>. This Shell is the root for
> * the SWT widgets that will be embedded within the AWT canvas.
> *
> * @param display the display for the new Shell
> * @param parent the parent <code>java.awt.Canvas</code> of the new Shell
> * @return a <code>Shell</code> to be the parent of the embedded SWT widgets
> *
> * @exception IllegalArgumentException <ul>
> * <li>ERROR_NULL_ARGUMENT - if the display is null</li>
> * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
> * </ul>
> *
> * @since 3.0
> */
> public static Shell new_Shell (final Display display, final Canvas parent)
>
>
> The SWT widgets are created as children of the Shell returned by this
> method. Shell.getChildren() can be used to walk the child tree.
>
> Given a Swing Canvas, I do not think that there is a way to find an
> associated SWT Shell.
>
> "David Scott" <user@example.net> wrote in message
> news:cgddpt$8m2$1@eclipse.org...
>
>>what connects the embedded composite to the swing frame?
>>
>
>
>
Previous Topic:Loose focus?
Next Topic:taking control over SWT Browser widget
Goto Forum:
  


Current Time: Sat Apr 27 00:22:04 GMT 2024

Powered by FUDForum. Page generated in 0.03396 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top