[vtkusers] How to close an open vtk-Window by program-code

Bill Lorensen bill.lorensen at gmail.com
Wed Jul 21 19:39:21 EDT 2010


I don't think that it kills the app. But that may be platform
specific... We'll have to experiment.

Bill

On Wed, Jul 21, 2010 at 2:09 PM, André Prins <a.h.prins at gmail.com> wrote:
> Dear Bill,
>
> Just a question about the TerminateApp() method. The name suggests
> that it will "kill the app". When I look at the implementation of the
> vtkWin32RenderWindowInteractor it calls PostQuitMessage( 0 )... does
> this kill the thread or the application?
>
> Sometimes I wish to close the vtk-window and then reopen another one.
> Will this still work with TerminateApp()
>
> Regards,
> Andre
>
> On Wed, Jul 21, 2010 at 1:38 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>> How about: iren->TerminateApp();
>>
>> TerminateApp() notifies the event loop to exit.
>>
>> On Wed, Jul 21, 2010 at 12:22 PM, André Prins <a.h.prins at gmail.com> wrote:
>>> Dear David & Rainer,
>>>
>>> I have had success with calling Finalize() on the RenderWindow. What I
>>> usually do is wrap a RenderWindow and Interactor in a simple
>>> viewer-class, which can be constructed on the stack and which has a
>>> "close" method. In there I simply call window->Finalize(). However I
>>> just tried it on your CloseWindow example... It does close/remove the
>>> window, but the event-loop keeps running.
>>>
>>> Regards,
>>> Andre
>>>
>>> On Wed, Jul 21, 2010 at 12:17 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>>> SetRenderWindow(NULL)  works for me.
>>>>
>>>> On Wed, Jul 21, 2010 at 12:13 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
>>>>> On Wed, Jul 21, 2010 at 12:08 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>>>>> Try
>>>>>>  iren->SetRenderWindow(NULL);
>>>>>> rather than
>>>>>> iren->GetRenderWindow()->Delete();
>>>>>
>>>>> Once SetRenderWindow(NULL) is performed, it crashes as soon as the
>>>>> window is attempted to be updated.
>>>>>
>>>>> Rainer - did you ever get this to work?
>>>>>
>>>>> Alex - was that just a thought that you recommended or have you done
>>>>> this using Delete()?
>>>>>
>>>>> David
>>>>>
>>>> _______________________________________________
>>>> Powered by www.kitware.com
>>>>
>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>>
>>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>
>



More information about the vtkusers mailing list