<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16674" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=500564519-12082008><FONT face=Arial
size=2>David,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=500564519-12082008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=500564519-12082008><FONT face=Arial
size=2>thanks.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=500564519-12082008><FONT face=Arial size=2>I
do have this working now by adding an appropriate observer.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=500564519-12082008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=500564519-12082008><FONT face=Arial
size=2>Doing a Start was causing my app to crash and I haven't spent the time to
figure out why.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=500564519-12082008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=500564519-12082008><FONT face=Arial
size=2>regards</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=500564519-12082008><FONT face=Arial
size=2>Phil</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> David Cole
[mailto:david.cole@kitware.com] <BR><B>Sent:</B> August 12, 2008 10:25
AM<BR><B>To:</B> Phil Goddard<BR><B>Cc:</B>
vtkusers@vtk.org<BR><B>Subject:</B> Re: [vtkusers] Calling a custom function
when terminating vtkRenderWindowInteractor<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr>If your intent is simply to receive the 'q' or 'e' keypress
events, you can simply use AddObserver to listen for KeyPressEvent, CharEvent
or KeyReleaseEvent directly from the vtkRenderWindowInteractor.<BR><BR>
<DIV>A Win32 vtkRenderWindowInteractor will only call PostQuitMessage and
actually pop out of its own internal message loop if one was started by
calling the Start() method.</DIV>
<DIV><BR></DIV>
<DIV>If you are running inproc as a dll (as I think you are from your other
postings) then you are probably not calling Start() and are probably relying
on your containing application's Windows message loop... So you would need to
intercept the keystrokes and do whatever is appropriate to quit your
containing app.</DIV>
<DIV><BR></DIV>
<DIV>Does this help?</DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV>Hope so,</DIV>
<DIV>David</DIV>
<DIV><BR>
<DIV>
<DIV class=gmail_quote><BR></DIV>
<DIV class=gmail_quote>On Sat, Aug 9, 2008 at 2:21 AM, Phil Goddard <SPAN
dir=ltr><<A
href="mailto:philgoddard@telus.net">philgoddard@telus.net</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><BR><BR>I'm
wondering if someone can explain to me how to call my own custom<BR>function
when q or e is pressed on a vtkRenderWindowInteractor.<BR><BR>The doc for
vtkRenderWindowInteractor::TerminateApp says<BR>"This function is called on
'q','e' keypress if exitmethod is not specified<BR>and should be overridden
by platform dependent subclasses to provide a<BR>termination procedure if
one is required."<BR><BR>However there is no mention (that I can see) of how
to specify an<BR>exitmethod.<BR><BR>From searching old mailing-list messages
it seems that there used to be a<BR>SetExitMethod method that took a pointer
to a function in earlier versions,<BR>but it doesn't seem to exist any
more.<BR><BR>Can anyone shed some light on how I might go about
this?<BR><BR>I tried safedowncasting my interactor to a
vtkWin32renderWindowInteractor<BR>and using its SetClassExitMethod however
that seemed to have no
effect.<BR><BR>Thanks<BR>Phil.<BR><BR><BR>_______________________________________________<BR>This
is the private VTK discussion list.<BR>Please keep messages on-topic. Check
the FAQ at: <A href="http://www.vtk.org/Wiki/VTK_FAQ"
target=_blank>http://www.vtk.org/Wiki/VTK_FAQ</A><BR>Follow this link to
subscribe/unsubscribe:<BR><A
href="http://www.vtk.org/mailman/listinfo/vtkusers"
target=_blank>http://www.vtk.org/mailman/listinfo/vtkusers</A><BR></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></BLOCKQUOTE></BODY></HTML>