[vtkusers] Moving a renderwindow to a new parent

John Platt jcplatt at dsl.pipex.com
Tue Nov 28 18:18:08 EST 2006


Hi Beau,

 

I seem to recall that SetParentID() eventually causes VTK to create a
new OpenGL window and install it's own WindowProc() so it can handle
mouse and keyboard events directly (not through the View). Have you
tried Windows ::SetParent() on the VTK window? You may also need
additional code in OnDestroy() of your CView derived class to prevent it
deleting the child VTK window .

 

HTH

 

John.

 

-----Original Message-----
From: vtkusers-bounces+jcplatt=dsl.pipex.com at vtk.org
[mailto:vtkusers-bounces+jcplatt=dsl.pipex.com at vtk.org] On Behalf Of
Beau Sapach
Sent: 28 November 2006 16:53
To: 'vtkusers'
Subject: [vtkusers] Moving a renderwindow to a new parent

 

Hello everyone,

 

Currently I attach vtkRenderWindows to MFC windows by passing the MFC
window's m_hWnd member to SetParentID.  I think this is the right way to
do it, but correct me if I'm wrong.  Now if I wish to "detach" a render
window, so to speak from its parent and say "move" it to another parent
window then what is the proper way of doing it?  I've tried calling
SetParentID(NULL) but that hasn't worked, the render window appears to
still be attached to its previous parent.  And the application breaks in
an MFC DLL when I try to delete the previous parent.

 

 

Beau

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061128/8fbe833b/attachment.htm>


More information about the vtkusers mailing list