wxVTKRenderWindow inside wxSplitterWindow

Marcus Stojek stojek at part-gmbh.de
Thu Mar 7 09:21:02 EST 2002


HI,

I want to use a wxSplitterWindow to render two different
body with VTK. Here is what I tried



#---------------------------------------------------------------------------
class ViewSplitter(wxSplitterWindow):
    def __init__(self, parent, ID):
        wxSplitterWindow.__init__(self, parent, ID)
        EVT_SPLITTER_SASH_POS_CHANGED(self, self.GetId(),
self.OnSashChanged)
        EVT_SPLITTER_SASH_POS_CHANGING(self, self.GetId(),
self.OnSashChanging)

    def OnSashChanged(self, evt):
        i=1
       # some stuff

    def OnSashChanging(self, evt):
        i=1
       # more stuff
#---------------------------------------------------------------------------
def ShowCmModel(frame,title):

        f = wxFrame(frame, -1, title, size=(450, 300),

style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)

#Without splitting everything works fine
        #win = vtk.wxVTKRenderWindow(f, -1) 

# Now trying to create two different RenderWindows in SplitterWindow
        splitter = ViewSplitter(f, -1)
        CMwin = wxWindow(splitter, -1)
        ABAwin = wxWindow(splitter, -1)
        splitter.SplitVertically(CMwin, ABAwin)

        win1 = vtk.wxVTKRenderWindow(CMwin, -1)
        win2 = vtk.wxVTKRenderWindow(ABAwin, -1)

# All the rendering stuff.....
#-------------------------------------------------------------------------

My problem is the size of the two Render Areas. I cant make
them fit the two splitted windows (they are very small) and they are
not resized when I change the window size. As I didn't find any doc on
wxVTKRenderWindow, I don't know what to do.
I tried 

win1=vtk.wxVTKRenderWindow(CMwin, -1, size=CMwin.GetSizeTuple())

but that didn't work either.

Any idea ?

Thanks,
Marcus




More information about the Python-list mailing list