aboutsummaryrefslogtreecommitdiffstats
path: root/examples/elementary/test_notify.py
diff options
context:
space:
mode:
authorDavide Andreoli <dave@gurumeditation.it>2013-03-01 21:01:50 +0000
committerDavide Andreoli <dave@gurumeditation.it>2013-03-01 21:01:50 +0000
commit0873fe162131bf672245e51d2670fc1ce822cfdd (patch)
tree4fa8667a51105ad846560dafe7e8fe64d935e616 /examples/elementary/test_notify.py
parentpython-efl: Skip build related code in setup.py when only generating (diff)
downloadpython-efl-0873fe162131bf672245e51d2670fc1ce822cfdd.tar.gz
Do not import EVERY widget while importing efl.elementary
Now the user is responsable of importing the widget used one by one, this should be a great speedup in the launch of the app. You have to import stuff in this way: from efl import evas from efl import elementary from efl.elementary.window import Window from efl.elementary.layout import Layout ...sorry for the inconvenience SVN revision: 84402
Diffstat (limited to 'examples/elementary/test_notify.py')
-rw-r--r--examples/elementary/test_notify.py41
1 files changed, 24 insertions, 17 deletions
diff --git a/examples/elementary/test_notify.py b/examples/elementary/test_notify.py
index 28f2c24..e7150e7 100644
--- a/examples/elementary/test_notify.py
+++ b/examples/elementary/test_notify.py
@@ -1,31 +1,38 @@
#!/usr/bin/env python
# encoding: utf-8
-from efl import elementary
from efl import evas
+from efl import elementary
+from efl.elementary.window import Window
+from efl.elementary.background import Background
+from efl.elementary.box import Box
+from efl.elementary.button import Button
+from efl.elementary.label import Label
+from efl.elementary.notify import Notify
+from efl.elementary.table import Table
def notify_close(bt, notify):
notify.hide()
def notify_show(bt, win, orient):
- notify = elementary.Notify(win)
+ notify = Notify(win)
notify.repeat_events_set(False)
notify.timeout_set(5)
notify.orient_set(orient)
- bx = elementary.Box(win)
+ bx = Box(win)
bx.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
bx.horizontal_set(True)
notify.content_set(bx)
bx.show()
- lb = elementary.Label(win)
+ lb = Label(win)
lb.text_set("Text notification")
bx.pack_end(lb)
lb.show()
- bt = elementary.Button(win)
+ bt = Button(win)
bt.text_set("Close")
bt.callback_clicked_add(notify_close, notify)
bx.pack_end(bt)
@@ -33,7 +40,7 @@ def notify_show(bt, win, orient):
notify.show()
def notify_clicked(obj):
- win = elementary.Window("notify", elementary.ELM_WIN_BASIC)
+ win = Window("notify", elementary.ELM_WIN_BASIC)
win.title_set("Notify test")
win.autodel_set(True)
win.size_hint_min_set(160, 160)
@@ -42,65 +49,65 @@ def notify_clicked(obj):
if obj is None:
win.callback_delete_request_add(lambda o: elementary.exit())
- bg = elementary.Background(win)
+ bg = Background(win)
win.resize_object_add(bg)
bg.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
bg.show()
- tb = elementary.Table(win)
+ tb = Table(win)
tb.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
win.resize_object_add(tb)
tb.show()
- bt = elementary.Button(win)
+ bt = Button(win)
bt.text_set("Top")
bt.callback_clicked_add(notify_show, win, elementary.ELM_NOTIFY_ORIENT_TOP)
tb.pack(bt, 1, 0, 1, 1)
bt.show()
- bt = elementary.Button(win)
+ bt = Button(win)
bt.text_set("Center")
bt.callback_clicked_add(notify_show, win, elementary.ELM_NOTIFY_ORIENT_CENTER)
tb.pack(bt, 1, 1, 1, 1)
bt.show()
- bt = elementary.Button(win)
+ bt = Button(win)
bt.text_set("Bottom")
bt.callback_clicked_add(notify_show, win, elementary.ELM_NOTIFY_ORIENT_BOTTOM)
tb.pack(bt, 1, 2, 1, 1)
bt.show()
- bt = elementary.Button(win)
+ bt = Button(win)
bt.text_set("Left")
bt.callback_clicked_add(notify_show, win, elementary.ELM_NOTIFY_ORIENT_LEFT)
tb.pack(bt, 0, 1, 1, 1)
bt.show()
- bt = elementary.Button(win)
+ bt = Button(win)
bt.text_set("Top Left")
bt.callback_clicked_add(notify_show, win, elementary.ELM_NOTIFY_ORIENT_TOP_LEFT)
tb.pack(bt, 0, 0, 1, 1)
bt.show()
- bt = elementary.Button(win)
+ bt = Button(win)
bt.text_set("Bottom Left")
bt.callback_clicked_add(notify_show, win, elementary.ELM_NOTIFY_ORIENT_BOTTOM_LEFT)
tb.pack(bt, 0, 2, 1, 1)
bt.show()
- bt = elementary.Button(win)
+ bt = Button(win)
bt.text_set("Right")
bt.callback_clicked_add(notify_show, win, elementary.ELM_NOTIFY_ORIENT_RIGHT)
tb.pack(bt, 2, 1, 1, 1)
bt.show()
- bt = elementary.Button(win)
+ bt = Button(win)
bt.text_set("Top Right")
bt.callback_clicked_add(notify_show, win, elementary.ELM_NOTIFY_ORIENT_TOP_RIGHT)
tb.pack(bt, 2, 0, 1, 1)
bt.show()
- bt = elementary.Button(win)
+ bt = Button(win)
bt.text_set("Bottom Right")
bt.callback_clicked_add(notify_show, win, elementary.ELM_NOTIFY_ORIENT_BOTTOM_RIGHT)
tb.pack(bt, 2, 2, 1, 1)