summaryrefslogtreecommitdiff
path: root/examples/elementary/test_diskselector.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_diskselector.py
parente02e6491d4d7902df7c326e98d5a061a6bc3fccf (diff)
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_diskselector.py')
-rw-r--r--examples/elementary/test_diskselector.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/examples/elementary/test_diskselector.py b/examples/elementary/test_diskselector.py
index e898d70..953013c 100644
--- a/examples/elementary/test_diskselector.py
+++ b/examples/elementary/test_diskselector.py
@@ -1,16 +1,20 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2# encoding: utf-8 2# encoding: utf-8
3 3
4from efl import elementary
5from efl import evas 4from efl import evas
6 5from efl import elementary
6from efl.elementary.window import Window
7from efl.elementary.background import Background
8from efl.elementary.box import Box
9from efl.elementary.icon import Icon
10from efl.elementary.diskselector import Diskselector
7 11
8months=["January", "February", "March", "April", "May", "June", "August", "September", "October", "November", "December"] 12months=["January", "February", "March", "April", "May", "June", "August", "September", "October", "November", "December"]
9weekdays=["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] 13weekdays=["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
10months_short=["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] 14months_short=["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
11 15
12def disk_create(win, rnd): 16def disk_create(win, rnd):
13 di = elementary.Diskselector(win) 17 di = Diskselector(win)
14 for m in months: 18 for m in months:
15 if m == "August": 19 if m == "August":
16 it = di.item_append(m) 20 it = di.item_append(m)
@@ -27,18 +31,18 @@ def cb_sel(ds, item):
27 31
28 32
29def diskselector_clicked(obj): 33def diskselector_clicked(obj):
30 win = elementary.Window("diskselector", elementary.ELM_WIN_BASIC) 34 win = Window("diskselector", elementary.ELM_WIN_BASIC)
31 win.title = "Diskselector test" 35 win.title = "Diskselector test"
32 win.autodel = True 36 win.autodel = True
33 if obj is None: 37 if obj is None:
34 win.callback_delete_request_add(lambda o: elementary.exit()) 38 win.callback_delete_request_add(lambda o: elementary.exit())
35 39
36 bg = elementary.Background(win) 40 bg = Background(win)
37 win.resize_object_add(bg) 41 win.resize_object_add(bg)
38 bg.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) 42 bg.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
39 bg.show() 43 bg.show()
40 44
41 vbox = elementary.Box(win) 45 vbox = Box(win)
42 vbox.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) 46 vbox.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
43 win.resize_object_add(vbox) 47 win.resize_object_add(vbox)
44 vbox.show() 48 vbox.show()
@@ -67,9 +71,9 @@ def diskselector_clicked(obj):
67 di.show() 71 di.show()
68 di.side_text_max_length = 4 72 di.side_text_max_length = 4
69 73
70 ic = elementary.Icon(win) 74 ic = Icon(win)
71 ic.file = "images/logo_small.png" 75 ic.file = "images/logo_small.png"
72 di = elementary.Diskselector(win) 76 di = Diskselector(win)
73 di.item_append("Sunday", ic) 77 di.item_append("Sunday", ic)
74 for day in weekdays: 78 for day in weekdays:
75 di.item_append(day) 79 di.item_append(day)
@@ -79,9 +83,9 @@ def diskselector_clicked(obj):
79 vbox.pack_end(di) 83 vbox.pack_end(di)
80 di.show() 84 di.show()
81 85
82 ic = elementary.Icon(win) 86 ic = Icon(win)
83 ic.file = "images/logo_small.png" 87 ic.file = "images/logo_small.png"
84 di = elementary.Diskselector(win) 88 di = Diskselector(win)
85 di.item_append("머리스타일", ic) 89 di.item_append("머리스타일", ic)
86 for lan in ["プロが伝授する", "生上访要求政府", "English", "والشريعة", "עִבְרִית", "Grüßen"]: 90 for lan in ["プロが伝授する", "生上访要求政府", "English", "والشريعة", "עִבְרִית", "Grüßen"]:
87 di.item_append(lan) 91 di.item_append(lan)
@@ -92,7 +96,7 @@ def diskselector_clicked(obj):
92 vbox.pack_end(di) 96 vbox.pack_end(di)
93 di.show() 97 di.show()
94 98
95 di = elementary.Diskselector(win) 99 di = Diskselector(win)
96 di.display_item_num = 5 100 di.display_item_num = 5
97 for m in months_short: 101 for m in months_short:
98 di.item_append(m) 102 di.item_append(m)
@@ -104,7 +108,7 @@ def diskselector_clicked(obj):
104 di.show() 108 di.show()
105 di.last_item.selected = True 109 di.last_item.selected = True
106 110
107 di = elementary.Diskselector(win) 111 di = Diskselector(win)
108 di.display_item_num = 7 112 di.display_item_num = 7
109 for i in range(31): 113 for i in range(31):
110 di.item_append(str(i)) 114 di.item_append(str(i))