[vtkusers] wxPython & VTK: How to Destroy wxVTKRenderWindow without errors?

Charl Botha c.p.botha at tudelft.nl
Mon May 12 13:13:37 EDT 2008


Hi there Ken,

On Mon, May 12, 2008 at 6:53 AM, Kenneth Evans, Jr. <evans at aps.anl.gov> wrote:
> There is no such method in my version.  It generates an exception if you try
> to use it.  If you look at the code, there is, in fact, no such method.  I
> have attached the code.

As I said, it's not explicitly there, but it is available.  The trick
is in the __getattr__ method: when you call SetRenderWindow(),
__getattr__ is automatically invoked and finds it in the contained
vtkGenericRenderWindowInteractor instance.  Do you see now?

> In any event with these versions you can't replace the vtkRenderWindow* by
> wxVTKRenderWindow* in cone6.py, owing to the reasons I have stated.  I have
> found I _can_ make the cone6 tutorial interactor work by using
> wxVTKRenderWindowInteractor _in place of_ wxVTKRenderWindow instead of in
> addition to it as it was originally.

That's the whole point.  You're supposed to use either one or the
other, not both.  In other words, the idea is NOT that you instantiate
one of each and then assign the one to the other.   Use either the
wxVTKRWI exclusively, or the wxVTKRW exclusively.

> If you look at the attached code, what I said should make more sense.  We
> are clearly using different versions.  Looks that that should be resolved
> first, then it will probably all make sense.

No, I am using this version.  In fact, the last change (1.28) is a fix
from Nicolas P. that I slipped in via the friendly Berk Geveci (due to
the commit freeze).

I hope things are clear now.

See you,
Charl



More information about the vtkusers mailing list