<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div dir="ltr">
      <div class="gmail_extra">
        <div class="gmail_quote"><span class=""></span>
          <div>In C++, a callback can return "true" to stop event
            propagation:</div>
          <div><br>
          </div>
          <div>  // Description:</div>
          <div>  // This method invokes an event and return whether the
            event was</div>
          <div>  // aborted or not. If the event was aborted, the return
            value is 1,</div>
          <div>  // otherwise it is 0.</div>
          <div>  int InvokeEvent(unsigned long event, void *callData);</div>
          <div>  int InvokeEvent(unsigned long event);</div>
          <div><br>
          </div>
          <div>When this feature was added for C++, it wasn't added to
            vtkPythonCommand.cxx (an oversight), so vtkPythonCommand.cxx
            would have to be modified to add this behavior for Python.</div>
          <div><br>
          </div>
          <div>Regarding calldata, see the following merge request (now
            merged):</div>
          <div><a moz-do-not-send="true"
              href="https://gitlab.kitware.com/vtk/vtk/merge_requests/1543/commits"
              target="_blank">https://gitlab.kitware.com/vtk/vtk/merge_requests/1543/commits</a><br>
          </div>
          <div>If Hasting happens to be reading this, please note that
            commit messages should be a wee bit more descriptive...</div>
          <div><br>
          </div>
          <div>I can't say much about the rest.  The interactors aren't
            my favorite part of VTK.</div>
        </div>
      </div>
    </div>
    <blockquote
cite="mid:CAE-7VJn5bRFX5tXGT_wi-5tk-ShdujfRkQoPXhyBTFa+=yVSzQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div><br>
            </div>
            <div>I'm also curious, if you don't mind me asking: Have you
              used a lot of PyQt+VTK? If so, did you use the interactor
              style system or did you forego using it completely?<br>
              <br>
            </div>
            <div>Elvis<br>
            </div>
            <div><br>
            </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div dir="ltr">
                <div class="gmail_extra">
                  <div class="gmail_quote"><span class="HOEnZb"><font
                        color="#888888">
                        <div><br>
                        </div>
                        <div> - David</div>
                      </font></span></div>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
    </blockquote>
    <br>
    <br>
    Hi Elvis,<br>
    <br>
    I am not entirely sure this answer is relevant.  One can customize
    the response to particular events in this way:<br>
    <br>
    1) by registering a call back command with a higher priority w.r.t.
    to default observers, with a statement like:<br>
    <br>
    cmd_id = interactor.AddObserver("LeftButtonPressEvent",
    self.MouseButtonCallback, 0.5) # use a priority of 0.5 which should
    be higher than default observers (0.0)<br>
    <br>
    2) by inspecting / acting on the event within the call back command,
    and if further processing of the event by other observers (for
    example the default interactor) needs to be prevented, by using
    something like:<br>
     <br>
    command = interactor.GetCommand(cmd_id)<br>
    command.SetAbortFlag(1)<br>
    <br>
    the above should stop any further handling of the event.<br>
    <br>
    This is therefore a possible way of overriding the default behavior
    of the interactor associated with render window.<br>
    <br>
    I am not entirely sure though whether this was the behavior your
    were looking for.<br>
    <br>
    Best,<br>
    <br>
    Andrea<br>
  </body>
</html>