aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2017-07-15 10:44:58 +0200
committerDave Andreoli <dave@gurumeditation.it>2017-07-15 10:44:58 +0200
commit6bd7daa8834dadc2582a460cb7a834154e8903cc (patch)
tree2ae1d0d40c8d219dc188561b9c68df43f9106e66
parentDocumentation: Add better documentation about object lifetime (diff)
downloadpython-efl-6bd7daa8834dadc2582a460cb7a834154e8903cc.tar.gz
New 1.20 API: elm.Spinner min/max,reached events
with test
-rw-r--r--doc/elementary/spinner.rst2
-rw-r--r--efl/elementary/spinner.pxi22
-rw-r--r--examples/elementary/test_spinner.py2
3 files changed, 26 insertions, 0 deletions
diff --git a/doc/elementary/spinner.rst b/doc/elementary/spinner.rst
index 3f0d236..68a1ed5 100644
--- a/doc/elementary/spinner.rst
+++ b/doc/elementary/spinner.rst
@@ -33,6 +33,8 @@ Emitted signals
so it avoids possibly expensive reactions to the value change.
- ``spinner,drag,start`` - When dragging has started.
- ``spinner,drag,stop`` - When dragging has stopped.
+- ``min,reached`` - Called when spinner value reached min (since 1.20)
+- ``max,reached`` - Called when spinner value reached max (since 1.20)
Available styles
diff --git a/efl/elementary/spinner.pxi b/efl/elementary/spinner.pxi
index 27fc60d..5d80c8b 100644
--- a/efl/elementary/spinner.pxi
+++ b/efl/elementary/spinner.pxi
@@ -387,5 +387,27 @@ cdef class Spinner(LayoutClass):
def callback_drag_stop_del(self, func):
self._callback_del("spinner,drag,stop", func)
+ def callback_min_reached_add(self, func, *args, **kwargs):
+ """When spinner value reached min.
+
+ .. versionadded:: 1.20
+
+ """
+ self._callback_add("min,reached", func, args, kwargs)
+
+ def callback_min_reached_del(self, func):
+ self._callback_del("min,reached", func)
+
+ def callback_max_reached_add(self, func, *args, **kwargs):
+ """When spinner value reached max.
+
+ .. versionadded:: 1.20
+
+ """
+ self._callback_add("max,reached", func, args, kwargs)
+
+ def callback_max_reached_del(self, func):
+ self._callback_del("max,reached", func)
+
_object_mapping_register("Elm.Spinner", Spinner)
diff --git a/examples/elementary/test_spinner.py b/examples/elementary/test_spinner.py
index 6b9457a..727cc41 100644
--- a/examples/elementary/test_spinner.py
+++ b/examples/elementary/test_spinner.py
@@ -34,6 +34,8 @@ def spinner_clicked(obj):
sp = Spinner(win, label_format="Percentage %%%1.2f something",
step=5.0, min_max=(0.0, 100.0), size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_HORIZ)
+ sp.callback_min_reached_add(lambda o: print("Min reached"))
+ sp.callback_max_reached_add(lambda o: print("Max reached"))
bx.pack_end(sp)
sp.show()