aboutsummaryrefslogtreecommitdiffstats
path: root/examples/elementary
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2015-02-21 05:39:28 +0200
committerKai Huuhko <kai.huuhko@gmail.com>2015-02-21 05:41:14 +0200
commit2ce228be96cc1aa5b412ec36468851f70e462c59 (patch)
treeded51f17a4fb38fc0cbc256583b83390dcac89f8 /examples/elementary
parentFix Photocam.internal_image to actually work (diff)
downloadpython-efl-2ce228be96cc1aa5b412ec36468851f70e462c59.tar.gz
Elementary: Add module systray
Test/example needs more work
Diffstat (limited to 'examples/elementary')
-rw-r--r--examples/elementary/test_systray.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/examples/elementary/test_systray.py b/examples/elementary/test_systray.py
new file mode 100644
index 0000000..81feb8b
--- /dev/null
+++ b/examples/elementary/test_systray.py
@@ -0,0 +1,36 @@
+#!/usr/bin/python
+
+from efl.ecore import ECORE_CALLBACK_DONE
+import efl.elementary as elm
+elm.init()
+if not elm.need_systray():
+ raise SystemExit("systray support missing")
+
+from efl.elementary.window import StandardWindow
+from efl.elementary.systray import Systray, on_systray_ready
+from efl.elementary.menu import Menu
+
+
+def ready_cb(event):
+ print(tray.register())
+
+ return ECORE_CALLBACK_DONE
+
+
+win = StandardWindow("test", "systray test", size=(400, 400))
+win.callback_delete_request_add(lambda x: elm.exit())
+
+on_systray_ready(ready_cb)
+
+menu = Menu(win)
+menu.item_add(None, "it works!")
+
+tray = Systray(win)
+tray.icon_name = "elementary"
+tray.att_icon_name = "elementary"
+tray.menu = menu
+
+win.show()
+
+elm.run()
+elm.shutdown()