path: root/efl/elementary/progressbar.pyx
diff options
authordavemds <dave@gurumeditation.it>2013-08-12 16:50:50 +0200
committerdavemds <dave@gurumeditation.it>2013-08-12 16:50:50 +0200
commit66e7f0030819125a1cab6d58af6550d9fb5ff65c (patch)
tree2c5289e9dba2157f6c77896ffbf43d80156686f4 /efl/elementary/progressbar.pyx
parentExamples/Elementary/Image: Fix rotation buttons. (diff)
PythonEFL: change the way progressbar pulse mode work.
Prior to this commit you enable (and start) the pulsing animation by doing: pb.pulse = True pb.pulse(True) Now you need to use the less-confusing syntax: pb.pulse_mode = True pb.pulse(True) Sorry for braking the API but was really confusing before.
Diffstat (limited to 'efl/elementary/progressbar.pyx')
1 files changed, 16 insertions, 18 deletions
diff --git a/efl/elementary/progressbar.pyx b/efl/elementary/progressbar.pyx
index f05d80b..83b267d 100644
--- a/efl/elementary/progressbar.pyx
+++ b/efl/elementary/progressbar.pyx
@@ -71,15 +71,6 @@ include "widget_header.pxi"
from layout_class cimport LayoutClass
from object cimport Object
-class ProgressbarPulseState(int):
- def __new__(cls, Object obj, int state):
- return int.__new__(cls, state)
- def __init__(self, Object obj, int state):
- self.obj = obj
- def __call__(self, int state):
- return self.obj._pulse(state)
cdef class Progressbar(LayoutClass):
@@ -88,7 +79,7 @@ cdef class Progressbar(LayoutClass):
def __init__(self, evasObject parent):
- property pulse:
+ property pulse_mode:
"""Whether a given progress bar widget is at "pulsing mode" or not.
By default, progress bars will display values from the low to high
@@ -101,24 +92,31 @@ cdef class Progressbar(LayoutClass):
start and stop this pulsing animation, one has to explicitly call
pulse(True) or pulse(False).
- :type pulse: bool
+ :type: bool
def __set__(self, pulse):
elm_progressbar_pulse_set(self.obj, pulse)
def __get__(self):
- return ProgressbarPulseState(self, elm_progressbar_pulse_get(self.obj))
+ return bool(elm_progressbar_pulse_get(self.obj))
- def _pulse(self, state):
- elm_progressbar_pulse(self.obj, state)
- def pulse_set(self, state):
+ def pulse_mode_set(self, state):
elm_progressbar_pulse_set(self.obj, state)
- def pulse_get(self):
+ def pulse_mode_get(self):
return bool(elm_progressbar_pulse_get(self.obj))
+ def pulse(self, state):
+ """Start (state=True) or stop (state=False) the pulsing animation.
+ Note that :py:attr:`pulse_mode` must be enabled for this to work.
+ :param state: Whenever to start or stop the pulse animation.
+ :type state: bool
+ """
+ elm_progressbar_pulse(self.obj, state)
property value:
"""The progress value (in percentage) on a given progress bar widget.