[slicer-users] Timers in Python Interactive Modules
haehn at bwh.harvard.edu
Thu Jan 21 08:35:58 EST 2010
I once used Python callbacks in connection with a vtkKWWizard.
Here is a code snippet:
or you could pass arguments
"Invoke ShowUserInterface 'test'")
ShowUserInterface is just defined in the gui class as a
normal python method.
Maybe you can use something similar in connection with a timer.
On Wed, 20 Jan 2010 20:03:40 -0500, Ali Uneri <ali.uneri at jhu.edu> wrote:
> I'm trying to develop a Slicer Interactive module in Python, where I
> require to perform a periodic task which will in turn update the
> module. More specifically a value is read from an external device,
> after which both the GUI and scene will need to be updated.
> I've used vtkKWTkUtilities::CreateTimerHandler in the C++
> implementation of the module, however could not use this in Python as
> (I suspect) the last argument which takes the callback method as a
> string is not recognized in Python, i.e.
> self.utility = slicer.vtkKWTkUtilities()
> self.utility.CreateTimerHandler(self.GetApplication(), self.Interval,
> self, "ProcessTimerEvents")
> Is there another way to define such callback functions in Python?
> Better yet, is there a way to generate timer events and utilize the
> GUI observers?
> Thank you,
> slicer-users mailing list
> slicer-users at bwh.harvard.edu
> To unsubscribe: send email to
> slicer-users-request at massmail.spl.harvard.edu with unsubscribe as the
More information about the slicer-users