[vtkusers] Documentation for event callback return values?
elvis.stansvik at orexplore.com
Thu Jun 16 02:31:33 EDT 2016
Den 15 juni 2016 5:45 em skrev "David Gobbi" <david.gobbi at gmail.com>:
> On Wed, Jun 15, 2016 at 9:30 AM, David Gobbi <david.gobbi at gmail.com>
>> On Wed, Jun 15, 2016 at 9:27 AM, David Gobbi <david.gobbi at gmail.com>
>>> On Wed, Jun 15, 2016 at 7:51 AM, Elvis Stansvik <
elvis.stansvik at orexplore.com> wrote:
>>>> Hi all,
>>>> I noticed in QVTKRenderWindowInteractor that it returns 1 in the
callback it sets up for DestroyTimerEvent:
>>>> def DestroyTimer(self, obj, evt):
>>>> return 1
>>>> So I suspect callbacks for this event are expected to return
something. But I can't find any info in the docs on which event callbacks
are expected to return something (and what), and which are not. Is this
info available somewhere?
>>> I checked the code for the Execute command in vtkPythonCommand.cxx, and
the return value for callbacks is ignored. So I'm not sure why this
callback returns a value. Prabhu might remember (he wrote the function),
but that was way back in 2002. It was probably a simple mistake due to
>>> If anything, a non-negative return value would indicate that the
callback had aborted, e.g. that the callback did not complete whatever
action it was meant to perform. But obviously that's not the intent for
>> Small typo in the above: I meant non-zero, not non-negative.
> Actually, please completely ignore the second paragraph that I wrote, it
just muddies what should be a clear statement:
> When you use VTK events in python, the callback's return value is ignored.
Excellent. I had my suspicion it might have been a mistake, thanks for
doing the digging.
> - David
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers