Previous topic

efl.ecore Module

Next topic

efl.ecore.Animator Class

efl.ecore.Timer Class

class efl.ecore.Timer

Bases: efl.eo.Eo

Creates a timer to call the given function in the given period of time.

This class represents a timer that will call the given func every interval seconds. The function will be passed any extra parameters given to constructor.

When the timer func is called, it must return a value of either True or False (remember that Python returns None if no value is explicitly returned and None evaluates to False). If it returns True, it will be called again at the next interval, or if it returns False it will be deleted automatically making any references/handles for it invalid.

Timers should be stopped/deleted by means of delete() or returning False from func, otherwise they’ll continue alive, even if the current python context delete it’s reference to it.

Parameters:
  • interval (float) – interval in seconds.
  • func

    function to callback when timer expires. The function signature is:

    func(*args, **kargs): bool
delay(float add)

Delay the execution of the timer by the given amount

Parameters:add (double) – seconds to add to the timer

New in version 1.8.

delete()

Stop callback emission and free internal resources.

freeze()

Pauses a running timer.

interval

The interval (in seconds) between each call of the timer

Type :double
pending

The pending time for the timer to expire

Type :double

New in version 1.8.

reset()

Reset the counter of the timer

New in version 1.8.

stop()

Alias for delete()

thaw()

Resumes a frozen (paused) timer.