Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Problem Accessing the SWT parent of a AWT control.


It is possible to get the Frame associated with an SWT Composite by calling
SWT_AWT.getFrame(Composite), but this is not exactly what you want. I see
two options:

1) you traverse the whole SWT shell hierarchy checking if any child is a SWT.EMBEDDED
Composite and if SWT_AWT.getFrame(Composite) for that composite is your frame. This
can be a bit expensive depending on the depth/size of the hierarchy.

2) If you have control over the code that created the Frame when calling SWT_AWT.new_Frame(),
you can remember the composite used as the parent somehow. In SWT, you can associated
data with a widget by calling Widget.setData(key, value). Is there something similar in AWT?

Silenio



"Solomon Paul Kancharla" <solomonpaul55@xxxxxxxxx>
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx

05/25/2006 07:29 AM

Please respond to
"Eclipse Platform SWT component developers list."

To
platform-swt-dev@xxxxxxxxxxx
cc
Subject
[platform-swt-dev] Problem Accessing the SWT parent of a AWT        control.





Hi all ,

    I am embedding an AWT frame into a SWT composite of a Dialog, using
   SWT_AWT.newFrame().And using a listener of a component inside the AWT
   component(which is added to the frame),I tried accessing the parent of the
   embedded frame.I need to get hold of the composite and its parent which
   is a Dialog and dispose it.

   I tried accessing the parent of the frame by accessing the parent of the
 
   using the instance of the parent,but in vain.

   Can any body please help me solve this problem?

Thanks and Best Regards,
SOLOMON
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


Back to the top