Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT_AWT bridge Mac OS X - component ordering issue with FormLayout
SWT_AWT bridge Mac OS X - component ordering issue with FormLayout [message #543812] Wed, 30 June 2010 12:05 Go to next message
No real name is currently offline No real name
Messages: 4
Registered: October 2009
Junior Member
I'm using SWT_AWT bridge to mix SWT and AWT controls in Eclipse 3.6.

The parent composite that the controls are going into uses FormLayout, and I am putting smaller SWT composites on top of the AWT control, which fills the entire parent composite.

In Windows, this works perfectly and the SWT controls are always on top.

In OS X 10.6, the SWT controls are draw behind the AWT control which is not acceptable. I can see them when I resize the window.

Here's the code, just to give you an idea of what is going on. The two composites created first manage their own layoutdata within the parent as they can be shown or hidden.

		Composite container = new Composite(parent, SWT.NONE);		
		container.setLayout(new FormLayout());
		
		{
			m_FeaturedDataComposite = new FeaturedDataComposite(container, SWT.NONE, this, 
					m_Listeners, Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
			m_FeaturedDataComposite.setTopOffset(20);
			m_FeaturedDataComposite.setRightOffset(20);
		}
		{
			m_LayersListComposite = new LayerListComposite(container, SWT.NONE, this, this, this, 
					m_Listeners);
		}
		{
			Composite globeContainer = new Composite(container, SWT.EMBEDDED | SWT.DOUBLE_BUFFERED);
			
			FormData formData = new FormData();
			formData.left = new FormAttachment(0);
			formData.right = new FormAttachment(100);
			formData.top = new FormAttachment(0);
			formData.bottom = new FormAttachment(100);
			
			globeContainer.setLayoutData(formData);
			globeContainer.setLayout(new FillLayout());
			
			java.awt.Frame worldFrame = SWT_AWT.new_Frame(globeContainer);
			
			// This is to stop the AWT canvas from flickering... 
			//    needed for placing SWT controls on top of AWT controls.
			try 
			{
				System.setProperty("sun.awt.noerasebackground","true");
			} 
			catch (NoSuchMethodError error) {}

			Panel panel = new Panel();
			panel.setLayout(new BorderLayout());
			panel.setBounds(0, 0, worldFrame.getSize().width, worldFrame.getSize().height);
			panel.add((WorldWindowGLCanvas)m_Globe, BorderLayout.CENTER);
			
			m_StatusBar = new StatusBarNative();
			((StatusBar)m_StatusBar).setEventSource(m_Globe);
			
			panel.add(m_StatusBar, BorderLayout.PAGE_END);
			
			worldFrame.add(panel);
		}


Any ideas?

[Updated on: Wed, 30 June 2010 12:23]

Report message to a moderator

Re: SWT_AWT bridge Mac OS X - component ordering issue with FormLayout [message #543889 is a reply to message #543812] Wed, 30 June 2010 19:28 Go to previous messageGo to next message
No real name is currently offline No real name
Messages: 4
Registered: October 2009
Junior Member
This seems to be related to the WorldWindGLCanvas control, which uses JOGL. If I replace it with an AWT button, it works fine...
Re: SWT_AWT bridge Mac OS X - component ordering issue with FormLayout [message #544067 is a reply to message #543889] Thu, 01 July 2010 09:53 Go to previous message
No real name is currently offline No real name
Messages: 4
Registered: October 2009
Junior Member
Narrowed it down further, it happens with an awt/jogl glcanvas as well. Sad
Previous Topic:org.eclipse.ui.forms
Next Topic:virtual table, rcp and libpango
Goto Forum:
  


Current Time: Mon Jul 28 12:28:30 EDT 2014

Powered by FUDForum. Page generated in 0.02318 seconds