aboutsummaryrefslogtreecommitdiffstats
path: root/examples/elementary/test_win_dialog.py
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2015-01-03 14:51:08 +0100
committerDave Andreoli <dave@gurumeditation.it>2015-01-03 14:51:08 +0100
commit64c1d33c9f69ec43e342337cb06920b83781cb86 (patch)
treedf83139281bbdeda2f57c263421ca2bd06be7a29 /examples/elementary/test_win_dialog.py
parentDocs for fdo icon names (diff)
downloadpython-efl-64c1d33c9f69ec43e342337cb06920b83781cb86.tar.gz
Added new convenience class: DialogWindow
With a new test for both StandardWindow and DialogWindow
Diffstat (limited to 'examples/elementary/test_win_dialog.py')
-rw-r--r--examples/elementary/test_win_dialog.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/examples/elementary/test_win_dialog.py b/examples/elementary/test_win_dialog.py
new file mode 100644
index 0000000..45a4224
--- /dev/null
+++ b/examples/elementary/test_win_dialog.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python
+# encoding: utf-8
+
+from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
+from efl import elementary
+from efl.elementary.window import StandardWindow, DialogWindow
+from efl.elementary.box import Box
+from efl.elementary.button import Button
+from efl.elementary.label import Label
+
+EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
+
+
+def clicked_cb(btn, parent):
+ dia = DialogWindow(parent, "window-dia", "DialogWindow",
+ size=(200,150), autodel=True)
+
+ lb = Label(dia, text="This is a DialogWindow",
+ size_hint_weight=EXPAND_BOTH)
+ dia.resize_object_add(lb)
+ lb.show()
+
+ dia.show()
+
+def window_dialog_clicked(obj):
+ win = StandardWindow("window-states", "This is a StandardWindow",
+ autodel=True, size=(400, 400))
+ if obj is None:
+ win.callback_delete_request_add(lambda o: elementary.exit())
+
+ box = Box(win, size_hint_weight=EXPAND_BOTH)
+ win.resize_object_add(box)
+ box.show()
+
+ bt = Button(win, text="Create a new dialog")
+ bt.callback_clicked_add(clicked_cb, win)
+ box.pack_end(bt)
+ bt.show()
+
+ win.show()
+
+
+if __name__ == "__main__":
+ elementary.init()
+
+ window_dialog_clicked(None)
+
+ elementary.run()
+ elementary.shutdown()
+