Hi,
I am running wxPython (pyCrust !) embedded inside a wxWindows(C++) App for
more than a year by now - it works great (Thanks Robin ! [and others...])
Now though, I ran into a problem that I could track down as follows:
If I don't create any wxGLCanvas on the C++ side my wxPython class derived
from wxGLCanvas is well behaved.
<code snipplet>
import wx
from wxPython import glcanvas as wxgl
from OpenGL.GL import *
class GLViewer(wxgl.wxGLCanvas):
def __init__(self, parent, imgArr, size):
wxgl.wxGLCanvas.__init__(self, parent, -1, size=size)
<snip>
def view(array, title, size):
frame = wx.Frame(None, -1, title)
canvas = GLViewer(frame, array, size)
<snip - sizer stuff>
return canvas
</code snipplet>
If I run it, I get this:
m = view(arr,'',(100,100))
m
<Priithon.mviewer.GLViewer instance; proxy of C++ wxGLCanvas instance at
_1e96a58_wxGLCanvas_p>
m.GetParent()
<wxPython.frames.wxFrame instance; proxy of C++ wxFrame instance at
_d8b190_wxFrame_p>
type(m.GetParent())
<type 'instance'>
type(m)
<type 'instance'>
But as soon as I put pack the wxGLCanvas on the C++ side, I get an
empty (wxPython) frame with zero height (only title visible) and this
output:
m = view(arr,'',(100,100))
m
<Priithon.mviewer.GLViewer instance; proxy of C++ wxGLCanvas instance at
_10694458_wxGLCanvas_p>
m.GetParent()
type(m.GetParent())
<type 'NoneType'>
type(m)
<type 'instance'>
This is using wx2.4.0 on windows2000. (On Linux(GTK) everything actually
works fine...)
maybe there is a problem with my setup.h ?
I'm thankful for any hints,
Sebastian Haase