[vtkusers] RenderWindow question...

Tuhin tk.sinha at vanderbilt.edu
Thu Feb 27 16:57:49 EST 2003


> In short, you have to take care of it.

Gotcha,  that's what I figured.  VTK Gods, if you are listening, it might be 
worth the time to put a "Warning" on the class documentation that briefly 
states this fact.  It seems to me there are a few people making the same 
types of errors relating to the correct use of vtkRenderWindow in C++.  
Thanks again Charl for clearing things up.

Tuhin

On Thursday 27 February 2003 15:51, Charl P. Botha wrote:
> On Thu, Feb 27, 2003 at 03:29:34PM -0600, Tuhin wrote:
> > > How do you delete this window?
> >
> > The user deletes it, by clicking on the window decoration close button. 
> > The only way (that I know) to catch this is to have the window manager
> > send you an event (i.e. WM_DESTROY_WINDOW).  If VTK catches this event,
> > then that's great.... however, on my inspection of the code i can't find
> > where this callback is setup.  Also, I'm not using XOpenGLRenderWindow
> > directly, but I think that's where the code and the problem should be.
>
> Because VTK uses reference counting on all objects, you have to catch this
> event and do something sane with it.  In my FLTK projects, I take care of
> the whole pipeline leading up to the embedded RenderWindow in my window
> close handler.  In my wxPython projects, I reparent the RenderWindow in my
> close handler and make sure that there are no references to any component
> of the VTK instance chain leading up to that RenderWindow.
>
> In short, you have to take care of it.  It would be near impossible to
> create an elegant and generic close handler (in VTK) that would be
> intelligent enough to take care of all possibilities, especially with
> regards to references that the user *might* have hanging around.

-- 
Graduate Research Assistant
Dept. Of BME
Vanderbilt University
615-343-8261



More information about the vtkusers mailing list