Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Cocoa SWT GLCanvas Event Handling Problems

Stefan,

Have you tried the 32-bit build? Or are you targeting 1.6?

Someone else here can correct me, but I¹m pretty sure you don¹t want to
create an NSOpenGLView directly. The SWT doesn¹t know it¹s a Widget subclass
so it won¹t receive SWT events. Instead you would use JOGL or a related
technology and wrap the GLCanvas around that. See this snippet:
<http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/e
clipse/swt/snippets/Snippet209.java?view=co>  This is how I tested the
OpenGL support.

-- Scott

On 3/3/09 3:12 AM, "Stefan Müller Arisona" <sma@xxxxxxxxxxxxxx> wrote:

> As we are on the way to prepare our applications for Eclipse 3.5, we've tried
> out the Cocoa 64bit builds. As it seems, there is a problem with event
> handling of GLCanvas: When registering Mouse Listeners to the Canvas, mouse
> events are not received. The problem seems to be around here (Constructor of
> GLCanvas.java):
> 
> glView = (NSOpenGLView)new NSOpenGLView().alloc();
> if (glView == null) {
> dispose ();
> SWT.error (SWT.ERROR_UNSUPPORTED_DEPTH);
> }
> glView.initWithFrame(parent.view.bounds(), pixelFormat);
> glView.setAutoresizingMask(OS.NSViewWidthSizable | OS.NSViewHeightSizable);
> parent.view.addSubview(glView);
> 
> 
> 
> Since the glView is added to the parent's view, mouse event still go to the
> view of GLCanvas (I guess...). I've been able to receive mouse events, when i
> change the last line to:
> 
> view.addSubview(glView)
> 
> But then autoresizing isnt working, and I havent been able to find a solution
> for this so far.


--------------- 
Scott Kovatch
Flex Engineering
Adobe Systems, Inc.
skovatch@xxxxxxxxx

I am Scott Kovatch, and I approved this message.



Back to the top