aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2014-09-17 22:21:50 +0300
committerKai Huuhko <kai.huuhko@gmail.com>2014-09-17 22:21:50 +0300
commit953a77dcaf415c5af1e3d0e1dddd2bdfdad8fd0b (patch)
treeb11dae1a9c144f3b280513edd9849aaf78e776a3 /examples
parentRelease 1.11.0 (diff)
downloadpython-efl-953a77dcaf415c5af1e3d0e1dddd2bdfdad8fd0b.tar.gz
Examples: set hoversel text in a callback
Diffstat (limited to 'examples')
-rw-r--r--examples/elementary/test_hoversel.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/elementary/test_hoversel.py b/examples/elementary/test_hoversel.py
index d761c5c..27936ff 100644
--- a/examples/elementary/test_hoversel.py
+++ b/examples/elementary/test_hoversel.py
@@ -3,6 +3,7 @@
import os
+from efl.ecore import Timer
from efl.evas import EVAS_HINT_EXPAND
from efl import elementary
from efl.elementary.window import StandardWindow
@@ -26,12 +27,18 @@ def hoversel_clicked(obj):
win.resize_object_add(bx)
bx.show()
+ def _sel_label_cb(hoversel, item):
+ text = hoversel.text
+ hoversel.text = item.text
+ Timer(2.0, lambda: hoversel.text_set("Labels"))
+
bt = Hoversel(win, hover_parent=win, text="Labels",
size_hint_weight=WEIGHT_ZERO, size_hint_align=ALIGN_CENTER)
bt.item_add("Item 1")
bt.item_add("Item 2")
bt.item_add("Item 3")
bt.item_add("Item 4 - Long Label Here")
+ bt.callback_selected_add(_sel_label_cb)
bx.pack_end(bt)
bt.show()