You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would also be nice to add a function to get the observer priority, as I wrote in the discourse:
defGetObserverPriority(vtk_object, event_name: str) ->int:
'''Given a vtk object and an event name, return the priority of the observer In Python it is impossible to get an observer from the object programmatically, but the string representation of the object contains the observers with priority. This code reads the string representation and returns the priority as integer. '''string=str(vtk_object)
ss=string.split("vtkObserver")
eventObservers= []
forsinss:
lines=s.split("\n")
eo= {}
forlineinlines:
try:
k,v=line.split(":")
k=k.strip()
v=v.strip()
ifkin ['Event', 'EventName', 'Command', 'Priority', 'Tag']:
eo[k] =veventObservers.append(eo)
except:
passforelineventObservers:
ifel['EventName'] ==event_name:
returnint(el['Priority'])
The text was updated successfully, but these errors were encountered:
We defined lots of keyboard interaction in the viewer with
OnKeyPress
, but most of it should beOnChar
. See https://discourse.vtk.org/t/consume-a-vtk-event-in-python/13052/3CILViewer/Wrappers/Python/ccpi/viewer/CILViewer2D.py
Line 38 in 894fc7b
It would also be nice to add a function to get the observer priority, as I wrote in the discourse:
The text was updated successfully, but these errors were encountered: