[vtkusers] How to have multipe renderwindows using wxPython (and other wx questions).
Maurice van de Rijzen
maurice at akst.tn.tudelft.nl
Fri Jul 18 06:10:46 EDT 2003
Dear all,
Recently I changed fvrom using tkInter to wxPython because. as I
understood from different sources, wxPython is considered to be more
'professional' and it has more widgets. I understood that wx support is
now in the recent versions of VTK. I can however not finf it the help files.
But besides this my problem is as follows.
Using tkinter I defined a renderWindow that had multiple renderers
assigned to different parts of the renderwindow using the viewport
commands. When I migrated to wx I had some problems using the
windowInteractor using the multiple renderers.
Then I had the idea to use the size properties of wx frame to create a
frame with two renderwindows. I did this with the following code (I
removed the viepwport settings):
frame = wxFrame(None, -1, "wxRenderWindow", size=wxSize(800,800))
widget = wxVTKRenderWindow(frame, -1, position=(1,1),size =
(400,800),style=wxSIMPLE_BORDER)
widget2 = wxVTKRenderWindow(frame, -1, position=(401,1), size =
(400,800),style=wxSIMPLE_BORDER)
widget.GetRenderWindow().AddRenderer(ren1)
widget2.GetRenderWindow().AddRenderer(ren2)
The problem now is that the in the left part of the window the correct
renderer is displayed but not centered, it looks like the size command
has no effect. Whereas the second widget is displayed correctly.
Is this a problem of VTK or wx?
How can I chech which version of VTK I'm using.
When I instaal the latest version of VTK(Nightly) does it standard
include wx or do I have to do something extra.
In the current example I include the definition of 'class
wxVTKRenderWindow' in my source beacuse otherwise I get an messgae it
doesn't know the wxVTKRenderWindow class. But I do use
from wxPython.wx import *
These are a lot of questions I hope someone is able to help me with some
of these questions.
Greetings,
Maurice
More information about the vtkusers
mailing list