wxOSX/Carbon: wxGLCanvas mouse offset in non-floating window classes

Posted by srose on Stack Overflow See other posts from Stack Overflow or by srose
Published on 2010-03-21T17:42:04Z Indexed on 2010/03/21 21:01 UTC
Read the original article Hit count: 590

Filed under:
|
|
|
|

Hi All,

I mainly program plugins using wxWidgets within a Carbon bundle which is loaded at runtime. The host-applications where my plugins are running in provide a native window handle (WindowRef), which I can use to add my custom, wxWidgets-based GUI-classes.

To use the native window handle with wxWidgets classes I had to write a wxTopLevelWindow wrapper class, which does all the WindowRef encapsulation. So far, this works pretty well, but under some circumstances I got vertical mouse offsets within a wxGLCanvas if the window class of the native window handle is not of the type "kFloatingWindowClass". I am able to bypass the problem if I display an info panel (wxPanel) over the whole wxGlCanvas and if the user hides the info panel then the mouse offset is gone.

Now my questions:

  1. Is there a "simple" explanation for this behaviour?
  2. Is it possible to use certain method calls to imitate info panel effect without using the panel itself? I tried several combinations of Update() and Refresh() calls of all involved components, but none of them worked so far. Even the use of wxSizer couldn't help here.

Window hierarchy used by plugin-applications:

wxCustomTopLevelWindow (WindowRef provided by host-application)
 wxPanel (parent window for all application panel)
  wxPanel (application info panel)
  wxPanel (application main panel)
   wxPanel (opengl main panel)
    wxGlCanvas (main opengl canvas)

Any ideas? Any help is very appreciated.

© Stack Overflow or respective owner

Related posts about wxwidgets

Related posts about wxglcanvas