summaryrefslogtreecommitdiff
path: root/examples/elementary/test_systray.py
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/test_systray.py
parentd141a912e5856dcf30ff2d8a38172b8dcfcfcad3 (diff)
Elementary: Add module systray
Test/example needs more work
Diffstat (limited to '')
-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 @@
1#!/usr/bin/python
2
3from efl.ecore import ECORE_CALLBACK_DONE
4import efl.elementary as elm
5elm.init()
6if not elm.need_systray():
7 raise SystemExit("systray support missing")
8
9from efl.elementary.window import StandardWindow
10from efl.elementary.systray import Systray, on_systray_ready
11from efl.elementary.menu import Menu
12
13
14def ready_cb(event):
15 print(tray.register())
16
17 return ECORE_CALLBACK_DONE
18
19
20win = StandardWindow("test", "systray test", size=(400, 400))
21win.callback_delete_request_add(lambda x: elm.exit())
22
23on_systray_ready(ready_cb)
24
25menu = Menu(win)
26menu.item_add(None, "it works!")
27
28tray = Systray(win)
29tray.icon_name = "elementary"
30tray.att_icon_name = "elementary"
31tray.menu = menu
32
33win.show()
34
35elm.run()
36elm.shutdown()