summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2014-06-02 11:03:39 +0300
committerKai Huuhko <kai.huuhko@gmail.com>2014-06-02 20:17:28 +0300
commit3f0aea9cb69207eb08ee9b86a5fa5346c6da585d (patch)
treef10d3e7806295ec87f2f5f9836749ad068da8c1a
parent4a57a7deaa97119dc54aec4ef18c3db5f39d1790 (diff)
Examples: Elementary test.py pep-8 (formatting) cleanup
-rwxr-xr-xexamples/elementary/test.py473
1 files changed, 263 insertions, 210 deletions
diff --git a/examples/elementary/test.py b/examples/elementary/test.py
index d99dadd..b18149b 100755
--- a/examples/elementary/test.py
+++ b/examples/elementary/test.py
@@ -19,12 +19,9 @@ eolog.setLevel(logging.INFO)
19evaslog = logging.getLogger("efl.evas") 19evaslog = logging.getLogger("efl.evas")
20evaslog.setLevel(logging.INFO) 20evaslog.setLevel(logging.INFO)
21 21
22import os
23
24from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL 22from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
25from efl import elementary 23from efl import elementary
26from efl.elementary.window import StandardWindow 24from efl.elementary.window import StandardWindow
27from efl.elementary.background import Background
28from efl.elementary.box import Box, ELM_BOX_LAYOUT_FLOW_HORIZONTAL 25from efl.elementary.box import Box, ELM_BOX_LAYOUT_FLOW_HORIZONTAL
29from efl.elementary.button import Button 26from efl.elementary.button import Button
30from efl.elementary.frame import Frame 27from efl.elementary.frame import Frame
@@ -42,220 +39,264 @@ EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
42FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL 39FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
43 40
44items = [ 41items = [
45 ("Core Libs", [ 42 ("Core Libs", [
46 ("Evas Objects", "test_core_evas_objects", "core_evas_objects_clicked"), 43 (
47 ("Evas Canvas Callbacks", "test_core_evas_canvas_callbacks", "core_evas_canvas_callbacks_clicked"), 44 "Evas Objects",
48 ("Evas Object Callbacks", "test_core_evas_object_callbacks", "core_evas_object_callbacks_clicked"), 45 "test_core_evas_objects",
49 ("Evas Textgrid", "test_evas_textgrid", "evas_textgrid_clicked"), 46 "core_evas_objects_clicked"
50 ("Evas Smart Object", "test_core_evas_smart", "core_evas_smart_clicked"), 47 ),
51 ]), 48 (
52 ("3D", [ 49 "Evas Canvas Callbacks",
53 ("Evas Map 3D", "test_3d", "evas3d_clicked"), 50 "test_core_evas_canvas_callbacks",
54 ]), 51 "core_evas_canvas_callbacks_clicked"
55 ("Booleans", [ 52 ),
56 ("Check", "test_check", "check_clicked"), 53 (
57 #TODO: ("Toggle", "test_check", "toggle_clicked"), 54 "Evas Object Callbacks",
58 ]), 55 "test_core_evas_object_callbacks",
59 ("Boundaries", [ 56 "core_evas_object_callbacks_clicked"),
60 ("Bubble", "test_bubble", "bubble_clicked"), 57 ("Evas Textgrid", "test_evas_textgrid", "evas_textgrid_clicked"),
61 ("Separator", "test_separator", "separator_clicked"), 58 (
62 ]), 59 "Evas Smart Object",
63 ("Buttons", [ 60 "test_core_evas_smart",
64 ("Button", "test_button", "buttons_clicked"), 61 "core_evas_smart_clicked"
65 ]), 62 ),
66 ("Containers", [ 63 ]),
67 ("Box Horiz", "test_box", "box_horiz_clicked"), 64 ("3D", [
68 ("Box Vert", "test_box", "box_vert_clicked"), 65 ("Evas Map 3D", "test_3d", "evas3d_clicked"),
69 ("Box Vert2", "test_box", "box_vert2_clicked"), 66 ]),
70 ("Box Layout", "test_box", "box_layout_clicked"), 67 ("Booleans", [
71 ("Box Layout Transition", "test_box", "box_transition_clicked"), 68 ("Check", "test_check", "check_clicked"),
72 ("Frame", "test_frame", "frame_clicked"), 69 #TODO: ("Toggle", "test_check", "toggle_clicked"),
73 ("Grid", "test_grid", "grid_clicked"), 70 ]),
74 ("Layout", "test_layout", "layout_clicked"), 71 ("Boundaries", [
75 ("Table", "test_table", "table_clicked"), 72 ("Bubble", "test_bubble", "bubble_clicked"),
76 ("Table Homogeneous", "test_table", "table2_clicked"), 73 ("Separator", "test_separator", "separator_clicked"),
77 ("Table 3", "test_table", "table3_clicked"), 74 ]),
78 ("Table 4", "test_table", "table4_clicked"), 75 ("Buttons", [
79 ("Table 5", "test_table", "table5_clicked"), 76 ("Button", "test_button", "buttons_clicked"),
80 ("Table 6", "test_table", "table6_clicked"), 77 ]),
81 ("Table 7", "test_table", "table7_clicked"), 78 ("Containers", [
82 ]), 79 ("Box Horiz", "test_box", "box_horiz_clicked"),
83 ("Cursors", [ 80 ("Box Vert", "test_box", "box_vert_clicked"),
84 ("Cursor", "test_cursor", "cursor_clicked"), 81 ("Box Vert2", "test_box", "box_vert2_clicked"),
85 ("Cursor2", "test_cursor", "cursor2_clicked"), 82 ("Box Layout", "test_box", "box_layout_clicked"),
86 ("Cursor3", "test_cursor", "cursor3_clicked"), 83 ("Box Layout Transition", "test_box", "box_transition_clicked"),
87 ]), 84 ("Frame", "test_frame", "frame_clicked"),
88 ("Dividers", [ 85 ("Grid", "test_grid", "grid_clicked"),
89 ("Panel", "test_panel", "panel_clicked"), 86 ("Layout", "test_layout", "layout_clicked"),
90 ("Panes", "test_panes", "panes_clicked"), 87 ("Table", "test_table", "table_clicked"),
91 ]), 88 ("Table Homogeneous", "test_table", "table2_clicked"),
92 # ("Drag & Drop", [ 89 ("Table 3", "test_table", "table3_clicked"),
93 # ("Genlist DnD Default Anim", "test_dnd", "dnd_genlist_default_anim_clicked"), 90 ("Table 4", "test_table", "table4_clicked"),
94 # ("Genlist DnD User Anim", "test_dnd", "dnd_genlist_user_anim_clicked"), 91 ("Table 5", "test_table", "table5_clicked"),
95 # ("Genlist + Gengrid DnD", "test_dnd", "dnd_genlist_gengrid_clicked"), 92 ("Table 6", "test_table", "table6_clicked"),
96 # ]), 93 ("Table 7", "test_table", "table7_clicked"),
97 ("Edje External", [ 94 ]),
98 ("Ext Button", "test_external", "edje_external_button_clicked"), 95 ("Cursors", [
99 ("Ext ProgressBar", "test_external", "edje_external_pbar_clicked"), 96 ("Cursor", "test_cursor", "cursor_clicked"),
100 ("Ext Scroller", "test_external", "edje_external_scroller_clicked"), 97 ("Cursor2", "test_cursor", "cursor2_clicked"),
101 ("Ext Slider", "test_external", "edje_external_slider_clicked"), 98 ("Cursor3", "test_cursor", "cursor3_clicked"),
102 ("Ext Video", "test_external", "edje_external_video_clicked"), 99 ]),
103 ]), 100 ("Dividers", [
104 ("Effects", [ 101 ("Panel", "test_panel", "panel_clicked"),
105 ("Flip", "test_flip", "flip_clicked"), 102 ("Panes", "test_panes", "panes_clicked"),
106 ("Flip Interactive", "test_flip", "flip_interactive_clicked"), 103 ]),
107 ("Transit", "test_transit", "transit_clicked"), 104 # ("Drag & Drop", [
108 ("Transit Resize", "test_transit", "transit2_clicked"), 105 # (
109 ("Transit Flip", "test_transit", "transit3_clicked"), 106 # "Genlist DnD Default Anim",
110 ("Transit Zoom", "test_transit", "transit4_clicked"), 107 # "test_dnd",
111 ("Transit Blend", "test_transit", "transit5_clicked"), 108 # "dnd_genlist_default_anim_clicked"
112 ("Transit Fade", "test_transit", "transit6_clicked"), 109 # ),
113 ("Transit Resizable", "test_transit", "transit7_clicked"), 110 # (
114 ("Transit Custom", "test_transit", "transit8_clicked"), 111 # "Genlist DnD User Anim",
115 ("Transit Chain", "test_transit", "transit9_clicked"), 112 # "test_dnd",
116 ]), 113 # "dnd_genlist_user_anim_clicked"
117 ("Entries", [ 114 # ),
118 ("Entry", "test_entry", "entry_clicked"), 115 # (
119 ("Entry Scrolled", "test_entry", "entry_scrolled_clicked"), 116 # "Genlist + Gengrid DnD",
120 ("Entry Anchor", "test_entry", "entry_anchor_clicked"), 117 # "test_dnd",
121 ("MultiButtonEntry", "test_multibuttonentry", "multibuttonentry_clicked"), 118 # "dnd_genlist_gengrid_clicked"
122 ]), 119 # ),
123 ("Focus", [ 120 # ]),
124 ("Focus", "test_focus", "focus_clicked"), 121 ("Edje External", [
125 ("Focus 2", "test_focus", "focus2_clicked"), 122 ("Ext Button", "test_external", "edje_external_button_clicked"),
126 ("Focus 3", "test_focus", "focus3_clicked"), 123 ("Ext ProgressBar", "test_external", "edje_external_pbar_clicked"),
127 ("Focus 4", "test_focus", "focus4_clicked"), 124 ("Ext Scroller", "test_external", "edje_external_scroller_clicked"),
128 ("Focus Custom", "test_focus", "focus5_clicked"), 125 ("Ext Slider", "test_external", "edje_external_slider_clicked"),
129 ]), 126 ("Ext Video", "test_external", "edje_external_video_clicked"),
130 ("Geographic", [ 127 ]),
131 ("Map", "test_map", "map_clicked"), 128 ("Effects", [
132 ]), 129 ("Flip", "test_flip", "flip_clicked"),
133 ("Images", [ 130 ("Flip Interactive", "test_flip", "flip_interactive_clicked"),
134 ("Icon", "test_icon", "icon_clicked"), 131 ("Transit", "test_transit", "transit_clicked"),
135 ("Icon Transparent", "test_icon", "icon_transparent_clicked"), 132 ("Transit Resize", "test_transit", "transit2_clicked"),
136 ("Image", "test_image", "image_clicked"), 133 ("Transit Flip", "test_transit", "transit3_clicked"),
137 ("Photo", "test_photo", "photo_clicked"), 134 ("Transit Zoom", "test_transit", "transit4_clicked"),
138 ("Photocam", "test_photocam", "photocam_clicked"), 135 ("Transit Blend", "test_transit", "transit5_clicked"),
139 ("Slideshow", "test_slideshow", "slideshow_clicked"), 136 ("Transit Fade", "test_transit", "transit6_clicked"),
140 ("Thumb", "test_thumb", "thumb_clicked"), 137 ("Transit Resizable", "test_transit", "transit7_clicked"),
141 ("Video", "test_video", "video_clicked"), 138 ("Transit Custom", "test_transit", "transit8_clicked"),
142 ]), 139 ("Transit Chain", "test_transit", "transit9_clicked"),
143 ("Input", [ 140 ]),
144 ("Input events", "test_input_events", "elm_input_events_clicked"), 141 ("Entries", [
145 ("Gesture Layer", "test_gesture_layer", "gesture_layer_clicked"), 142 ("Entry", "test_entry", "entry_clicked"),
146 ]), 143 ("Entry Scrolled", "test_entry", "entry_scrolled_clicked"),
147 ("Lists", [ 144 ("Entry Anchor", "test_entry", "entry_anchor_clicked"),
148 ("Gengrid", "test_gengrid", "gengrid_clicked"), 145 (
149 ("Genlist", "test_genlist", "genlist_clicked"), 146 "MultiButtonEntry",
150 ("Genlist 2", "test_genlist", "genlist2_clicked"), 147 "test_multibuttonentry",
151 ("Genlist Group", "test_genlist", "genlist3_clicked"), 148 "multibuttonentry_clicked"
152 ("Genlist Sorted", "test_genlist", "genlist4_clicked"), 149 ),
153 ("Genlist Iteration", "test_genlist", "genlist5_clicked"), 150 ]),
154 ("Genlist Decorate Item Mode", "test_genlist", "genlist10_clicked"), 151 ("Focus", [
155 ("Genlist Decorate All Mode", "test_genlist", "genlist15_clicked"), 152 ("Focus", "test_focus", "focus_clicked"),
156 ("List", "test_list", "list_clicked"), 153 ("Focus 2", "test_focus", "focus2_clicked"),
157 ("List 2", "test_list", "list2_clicked"), 154 ("Focus 3", "test_focus", "focus3_clicked"),
158 ("List 3", "test_list", "list3_clicked"), 155 ("Focus 4", "test_focus", "focus4_clicked"),
159 ]), 156 ("Focus Custom", "test_focus", "focus5_clicked"),
160 ("Miscellaneous", [ 157 ]),
161 # ("Accessibility", "test_access", "access_clicked"), 158 ("Geographic", [
162 # ("Accessibility 2", "test_access", "access2_clicked"), 159 ("Map", "test_map", "map_clicked"),
163 # ("Accessibility 3", "test_access", "access3_clicked"), 160 ]),
164 ("Configuration", "test_config", "config_clicked"), 161 ("Images", [
165 ("Copy And Paste", "test_cnp", "cnp_clicked"), 162 ("Icon", "test_icon", "icon_clicked"),
166 ("Floating Objects", "test_floating", "floating_clicked"), 163 ("Icon Transparent", "test_icon", "icon_transparent_clicked"),
167 ("Themes", "test_theme", "theme_clicked"), 164 ("Image", "test_image", "image_clicked"),
168 ]), 165 ("Photo", "test_photo", "photo_clicked"),
169 ("Naviframe", [ 166 ("Photocam", "test_photocam", "photocam_clicked"),
170 ("Naviframe", "test_naviframe", "naviframe_clicked"), 167 ("Slideshow", "test_slideshow", "slideshow_clicked"),
171 ]), 168 ("Thumb", "test_thumb", "thumb_clicked"),
172 ("Popups", [ 169 ("Video", "test_video", "video_clicked"),
173 ("Ctxpopup", "test_ctxpopup", "ctxpopup_clicked"), 170 ]),
174 ("Hover", "test_hover", "hover_clicked"), 171 ("Input", [
175 ("Hover 2", "test_hover", "hover2_clicked"), 172 ("Input events", "test_input_events", "elm_input_events_clicked"),
176 ("Notify", "test_notify", "notify_clicked"), 173 ("Gesture Layer", "test_gesture_layer", "gesture_layer_clicked"),
177 ("Popup", "test_popup", "popup_clicked"), 174 ]),
178 ("Tooltip", "test_tooltip", "tooltip_clicked"), 175 ("Lists", [
179 ]), 176 ("Gengrid", "test_gengrid", "gengrid_clicked"),
180 ("Range Values", [ 177 ("Genlist", "test_genlist", "genlist_clicked"),
181 ("Progressbar", "test_progressbar", "progressbar_clicked"), 178 ("Genlist 2", "test_genlist", "genlist2_clicked"),
182 ("Slider", "test_slider", "slider_clicked"), 179 ("Genlist Group", "test_genlist", "genlist3_clicked"),
183 ("Spinner", "test_spinner", "spinner_clicked"), 180 ("Genlist Sorted", "test_genlist", "genlist4_clicked"),
184 ]), 181 ("Genlist Iteration", "test_genlist", "genlist5_clicked"),
185 ("Scroller", [ 182 ("Genlist Decorate Item Mode", "test_genlist", "genlist10_clicked"),
186 ("Scroller", "test_scroller", "scroller_clicked"), 183 ("Genlist Decorate All Mode", "test_genlist", "genlist15_clicked"),
187 ]), 184 ("List", "test_list", "list_clicked"),
188 ("Selectors", [ 185 ("List 2", "test_list", "list2_clicked"),
189 ("Action Slider", "test_actionslider", "actionslider_clicked"), 186 ("List 3", "test_list", "list3_clicked"),
190 ("Color Selector", "test_colorselector", "colorselector_clicked"), 187 ]),
191 ("Day Selector", "test_dayselector", "dayselector_clicked"), 188 ("Miscellaneous", [
192 ("Disk Selector", "test_diskselector", "diskselector_clicked"), 189 # ("Accessibility", "test_access", "access_clicked"),
193 ("File Selector", "test_fileselector", "fileselector_clicked"), 190 # ("Accessibility 2", "test_access", "access2_clicked"),
194 ("Fileselector button", "test_fileselector_button", "fileselector_button_clicked"), 191 # ("Accessibility 3", "test_access", "access3_clicked"),
195 ("Fileselector entry", "test_fileselector_entry", "fileselector_entry_clicked"), 192 ("Configuration", "test_config", "config_clicked"),
196 ("Flip Selector", "test_flipselector", "flipselector_clicked"), 193 ("Copy And Paste", "test_cnp", "cnp_clicked"),
197 ("Hoversel", "test_hoversel", "hoversel_clicked"), 194 ("Floating Objects", "test_floating", "floating_clicked"),
198 ("Index", "test_index", "index_clicked"), 195 ("Themes", "test_theme", "theme_clicked"),
199 ("Menu", "test_menu", "menu_clicked"), 196 ]),
200 ("Radios", "test_radio", "radio_clicked"), 197 ("Naviframe", [
201 ("Segment Control", "test_segment_control", "segment_control_clicked"), 198 ("Naviframe", "test_naviframe", "naviframe_clicked"),
202 ]), 199 ]),
203 ("Standardization", [ 200 ("Popups", [
204 ("Conformant", "test_conform", "conformant_clicked"), 201 ("Ctxpopup", "test_ctxpopup", "ctxpopup_clicked"),
205 ("Conformant 2", "test_conform", "conformant2_clicked"), 202 ("Hover", "test_hover", "hover_clicked"),
206 ]), 203 ("Hover 2", "test_hover", "hover2_clicked"),
207 ("Stored Surface Buffer", [ 204 ("Notify", "test_notify", "notify_clicked"),
208 ("Launcher", "test_mapbuf", "mapbuf_clicked"), 205 ("Popup", "test_popup", "popup_clicked"),
209 ]), 206 ("Tooltip", "test_tooltip", "tooltip_clicked"),
210 ("System", [ 207 ]),
211 ("Notification", "test_sys_notify", "sys_notify_clicked"), 208 ("Range Values", [
212 ]), 209 ("Progressbar", "test_progressbar", "progressbar_clicked"),
213 ("Text", [ 210 ("Slider", "test_slider", "slider_clicked"),
214 ("Label", "test_label", "label_clicked"), 211 ("Spinner", "test_spinner", "spinner_clicked"),
215 ]), 212 ]),
216 ("Times & Dates", [ 213 ("Scroller", [
217 ("Calendar", "test_calendar", "calendar_clicked"), 214 ("Scroller", "test_scroller", "scroller_clicked"),
218 ("Calendar 2", "test_calendar", "calendar2_clicked"), 215 ]),
219 ("Calendar 3", "test_calendar", "calendar3_clicked"), 216 ("Selectors", [
220 ("Clock", "test_clock", "clock_clicked"), 217 ("Action Slider", "test_actionslider", "actionslider_clicked"),
221 ("Datetime", "test_datetime", "datetime_clicked"), 218 ("Color Selector", "test_colorselector", "colorselector_clicked"),
222 ]), 219 ("Day Selector", "test_dayselector", "dayselector_clicked"),
223 ("Toolbars", [ 220 ("Disk Selector", "test_diskselector", "diskselector_clicked"),
224 ("Toolbar", "test_toolbar", "toolbar_clicked"), 221 ("File Selector", "test_fileselector", "fileselector_clicked"),
225 ("Toolbar Item States", "test_toolbar", "toolbar5_clicked"), 222 (
226 ]), 223 "Fileselector button",
227 ("Web", [ 224 "test_fileselector_button",
228 ("Web", "test_web", "web_clicked"), 225 "fileselector_button_clicked"
229 ]), 226 ),
230 ("Window / Background", [ 227 (
231 ("Bg Plain", "test_bg", "bg_plain_clicked"), 228 "Fileselector entry",
232 ("Bg Image", "test_bg", "bg_image_clicked"), 229 "test_fileselector_entry",
233 ("InnerWindow", "test_inwin", "inner_window_clicked"), 230 "fileselector_entry_clicked"
234 ("Window States", "test_win", "window_states_clicked"), 231 ),
235 ]) 232 ("Flip Selector", "test_flipselector", "flipselector_clicked"),
236 ] 233 ("Hoversel", "test_hoversel", "hoversel_clicked"),
234 ("Index", "test_index", "index_clicked"),
235 ("Menu", "test_menu", "menu_clicked"),
236 ("Radios", "test_radio", "radio_clicked"),
237 ("Segment Control", "test_segment_control", "segment_control_clicked"),
238 ]),
239 ("Standardization", [
240 ("Conformant", "test_conform", "conformant_clicked"),
241 ("Conformant 2", "test_conform", "conformant2_clicked"),
242 ]),
243 ("Stored Surface Buffer", [
244 ("Launcher", "test_mapbuf", "mapbuf_clicked"),
245 ]),
246 ("System", [
247 ("Notification", "test_sys_notify", "sys_notify_clicked"),
248 ]),
249 ("Text", [
250 ("Label", "test_label", "label_clicked"),
251 ]),
252 ("Times & Dates", [
253 ("Calendar", "test_calendar", "calendar_clicked"),
254 ("Calendar 2", "test_calendar", "calendar2_clicked"),
255 ("Calendar 3", "test_calendar", "calendar3_clicked"),
256 ("Clock", "test_clock", "clock_clicked"),
257 ("Datetime", "test_datetime", "datetime_clicked"),
258 ]),
259 ("Toolbars", [
260 ("Toolbar", "test_toolbar", "toolbar_clicked"),
261 ("Toolbar Item States", "test_toolbar", "toolbar5_clicked"),
262 ]),
263 ("Web", [
264 ("Web", "test_web", "web_clicked"),
265 ]),
266 ("Window / Background", [
267 ("Bg Plain", "test_bg", "bg_plain_clicked"),
268 ("Bg Image", "test_bg", "bg_image_clicked"),
269 ("InnerWindow", "test_inwin", "inner_window_clicked"),
270 ("Window States", "test_win", "window_states_clicked"),
271 ])
272 ]
237 273
238 274
239def selected_cb(o, mod, func): 275def selected_cb(o, mod, func):
240 exec("from {0} import {1}; {1}(o)".format(mod, func)) 276 exec("from {0} import {1}; {1}(o)".format(mod, func))
241 277
278
242def menu_create(search, win): 279def menu_create(search, win):
243 tbx.clear() 280 tbx.clear()
244 for category in items: 281 for category in items:
245 frame = Frame(win, size_hint_weight=EXPAND_BOTH, 282 frame = Frame(
246 size_hint_align=FILL_BOTH, text=category[0]) 283 win, size_hint_weight=EXPAND_BOTH,
284 size_hint_align=FILL_BOTH, text=category[0]
285 )
247 frame.show() 286 frame.show()
248 tbx.pack_end(frame) 287 tbx.pack_end(frame)
249 288
250 tbx2 = Box(win, layout=ELM_BOX_LAYOUT_FLOW_HORIZONTAL, 289 tbx2 = Box(
290 win, layout=ELM_BOX_LAYOUT_FLOW_HORIZONTAL,
251 size_hint_weight=(EVAS_HINT_EXPAND, 0.0), 291 size_hint_weight=(EVAS_HINT_EXPAND, 0.0),
252 size_hint_align=(EVAS_HINT_FILL, 0.0)) 292 size_hint_align=(EVAS_HINT_FILL, 0.0)
293 )
253 frame.content_set(tbx2) 294 frame.content_set(tbx2)
254 tbx2.show() 295 tbx2.show()
255 296
256 cnt = 0 297 cnt = 0
257 for test in category[1]: 298 for test in category[1]:
258 if (search == None) or (test[0].lower().find(search.lower()) > -1): 299 if search is None or test[0].lower().find(search.lower()) > -1:
259 bt = Button(win, text=test[0]) 300 bt = Button(win, text=test[0])
260 bt.callback_clicked_add(selected_cb, test[1], test[2]) 301 bt.callback_clicked_add(selected_cb, test[1], test[2])
261 bt.show() 302 bt.show()
@@ -265,19 +306,24 @@ def menu_create(search, win):
265 if cnt < 1: 306 if cnt < 1:
266 frame.delete() 307 frame.delete()
267 308
309
268def destroy(obj, str1, str2, str3, str4): 310def destroy(obj, str1, str2, str3, str4):
269 elementary.exit() 311 elementary.exit()
270 312
313
271def cb_mirroring(toggle): 314def cb_mirroring(toggle):
272 elm_conf.mirrored = toggle.state 315 elm_conf.mirrored = toggle.state
273 316
317
274def cb_filter(en, win): 318def cb_filter(en, win):
275 menu_create(en.text_get(), win) 319 menu_create(en.text_get(), win)
276 320
277if __name__ == "__main__": 321if __name__ == "__main__":
278 elementary.init() 322 elementary.init()
279 win = StandardWindow("test", "Python EFL test application") 323 win = StandardWindow("test", "Python EFL test application")
280 win.callback_delete_request_add(destroy, "test1", "test2", str3="test3", str4="test4") 324 win.callback_delete_request_add(
325 destroy, "test1", "test2", str3="test3", str4="test4"
326 )
281 327
282 box0 = Box(win, size_hint_weight=EXPAND_BOTH) 328 box0 = Box(win, size_hint_weight=EXPAND_BOTH)
283 win.resize_object_add(box0) 329 win.resize_object_add(box0)
@@ -299,8 +345,10 @@ if __name__ == "__main__":
299 box0.pack_end(tg) 345 box0.pack_end(tg)
300 tg.show() 346 tg.show()
301 347
302 bx1 = Box(win, size_hint_weight=(EVAS_HINT_EXPAND, 0.0), 348 bx1 = Box(
303 size_hint_align=(EVAS_HINT_FILL, 0.0), horizontal=True) 349 win, size_hint_weight=(EVAS_HINT_EXPAND, 0.0),
350 size_hint_align=(EVAS_HINT_FILL, 0.0), horizontal=True
351 )
304 box0.pack_end(bx1) 352 box0.pack_end(bx1)
305 bx1.show() 353 bx1.show()
306 354
@@ -308,21 +356,27 @@ if __name__ == "__main__":
308 bx1.pack_end(lb) 356 bx1.pack_end(lb)
309 lb.show() 357 lb.show()
310 358
311 en = Entry(win, single_line=True, scrollable=True, 359 en = Entry(
312 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) 360 win, single_line=True, scrollable=True,
361 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH
362 )
313 en.part_text_set("guide", "Type widget name here to search.") 363 en.part_text_set("guide", "Type widget name here to search.")
314 en.callback_changed_add(cb_filter, win) 364 en.callback_changed_add(cb_filter, win)
315 bx1.pack_end(en) 365 bx1.pack_end(en)
316 en.show() 366 en.show()
317 en.focus_set(True) 367 en.focus_set(True)
318 368
319 sc = Scroller(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH, 369 sc = Scroller(
320 bounce=(False, True)) 370 win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
371 bounce=(False, True)
372 )
321 sc.show() 373 sc.show()
322 box0.pack_end(sc) 374 box0.pack_end(sc)
323 375
324 tbx = Box(win, size_hint_weight=(EVAS_HINT_EXPAND, 0.0), 376 tbx = Box(
325 size_hint_align=(EVAS_HINT_FILL, 0.0)) 377 win, size_hint_weight=(EVAS_HINT_EXPAND, 0.0),
378 size_hint_align=(EVAS_HINT_FILL, 0.0)
379 )
326 sc.content_set(tbx) 380 sc.content_set(tbx)
327 tbx.show() 381 tbx.show()
328 382
@@ -332,4 +386,3 @@ if __name__ == "__main__":
332 win.show() 386 win.show()
333 elementary.run() 387 elementary.run()
334 elementary.shutdown() 388 elementary.shutdown()
335