[vtkusers] Problem VTK4 + python 2.2
David Gobbi
dgobbi at irus.rri.ca
Mon Jan 14 16:11:59 EST 2002
Hi Prabhu,
On Tue, 15 Jan 2002, Prabhu Ramachandran wrote:
> There were two lines that needed changing for me.
>
> $ diff wxVTKRenderWindow.py /tmp/wxVTKRenderWindow.py
> 197c197
> < self._RenderWindow.SetSize(size[0], size[1])
> ---
> > self._RenderWindow.SetSize(size.width, size.height)
> 237c237
> < width, height = event.GetSize()
> ---
> > width, height = event.GetSize().asTuple()
I'll fix these. They have to do with differences between the
wxPython 2.2.x and wxPython 2.3.x, I want the wxVTKRenderWindow
to work with both if possible.
> Once these were done it worked well. I looked through your code and
> it looks nice. Its a good idea to use the GL Canvas. I believe Dave
> Reed found that using a GLCanvas in the GtkRenderWindow also helped a
> lot. One design question. The way my wxVTKRenderWindow was written
> was with a base and derived class. This was done so that it would be
> easier for a user to incorporate their custom interaction. Any
> reasons why you didnt do it this way?
Because it's easy enough for people to just override the methods they
want to change the behaviour of. The documentation in the file clearly
specifies what the default interaction is set to, and what methods
have to be overridden to change it.
> There is one small bug that I found. If you just fire up
> wxVTKRenderWindow.py and then hit any key (before you move the mouse)
> it will raise an exception. This is because UpdateRenderer is not
> called untill the mouse is pressed so there is no
> self._CurrentRenderer. One way to fix this is to call UpdateRenderer
> on OnEnter. What do you think?
I'll fix this.
> The other issue is that if you call Render on the window before it is
> realized then parenting doesnt occur properly. i dont know if your
> loop that calls the parent's Show handles this case? I guess it does.
This gets into the whole wxGTK mess and also the WindowId mess. I don't
plan on looking any deeper into this, myself.
Okay, I just did the fixes and committed.
- David
More information about the vtkusers
mailing list