aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2014-08-01 13:35:50 +0200
committerdavemds <dave@gurumeditation.it>2014-08-01 13:35:50 +0200
commit401145f4fa5eb54ba962b59de79390dc9cec19dc (patch)
tree56d1c4f3461a7a741c80fe098b4dd45767c7d2f0 /examples
parentCtxpopup: new getters for items and the item_prepend method, with tests (diff)
downloadpython-efl-401145f4fa5eb54ba962b59de79390dc9cec19dc.tar.gz
Toolbar: new un/selected signals, with tests
Diffstat (limited to 'examples')
-rw-r--r--examples/elementary/test_toolbar.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/elementary/test_toolbar.py b/examples/elementary/test_toolbar.py
index bd82038..67f4372 100644
--- a/examples/elementary/test_toolbar.py
+++ b/examples/elementary/test_toolbar.py
@@ -48,6 +48,20 @@ def tb_4a(obj, it, ph):
def tb_5(obj, it, ph):
ph.file = None
+def cb_clicked(tb):
+ print("CLICKED")
+ print(tb)
+
+def cb_item_focused(tb, item):
+ print("ITEM FOCUSED")
+ print(tb)
+ print(item)
+
+def cb_selected(tb, item):
+ print("SELECTED")
+ print(tb)
+ print(item)
+
def toolbar_clicked(obj, item=None):
win = StandardWindow("toolbar", "Toolbar", autodel=True, size=(320, 300))
if obj is None:
@@ -62,6 +76,9 @@ def toolbar_clicked(obj, item=None):
tb = Toolbar(win, homogeneous=False, size_hint_weight=(0.0, 0.0),
size_hint_align=(EVAS_HINT_FILL, 0.0))
+ tb.callback_clicked_add(cb_clicked)
+ tb.callback_selected_add(cb_selected)
+ tb.callback_item_focused_add(cb_item_focused)
ph1 = Photo(win, size=40, file=os.path.join(img_path, "plant_01.jpg"),
size_hint_weight=EXPAND_BOTH, size_hint_align=ALIGN_CENTER)