summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2014-06-02 20:37:15 +0200
committerdavemds <dave@gurumeditation.it>2014-06-02 20:37:15 +0200
commit4f1efb1ee1c5263f17dc74338fe4d191a39195f3 (patch)
tree04d1bb3cd8872c9b07b02f0a9ff5c4bbd84e0c40
parent3f0aea9cb69207eb08ee9b86a5fa5346c6da585d (diff)
Use a more eflish code style (still pep-8 compliant)
-rwxr-xr-xexamples/elementary/test.py49
1 files changed, 17 insertions, 32 deletions
diff --git a/examples/elementary/test.py b/examples/elementary/test.py
index b18149b..b0014f6 100755
--- a/examples/elementary/test.py
+++ b/examples/elementary/test.py
@@ -279,18 +279,14 @@ def selected_cb(o, mod, func):
279def menu_create(search, win): 279def menu_create(search, win):
280 tbx.clear() 280 tbx.clear()
281 for category in items: 281 for category in items:
282 frame = Frame( 282 frame = Frame(win, size_hint_weight=EXPAND_BOTH,
283 win, size_hint_weight=EXPAND_BOTH, 283 size_hint_align=FILL_BOTH, text=category[0])
284 size_hint_align=FILL_BOTH, text=category[0]
285 )
286 frame.show() 284 frame.show()
287 tbx.pack_end(frame) 285 tbx.pack_end(frame)
288 286
289 tbx2 = Box( 287 tbx2 = Box(win, layout=ELM_BOX_LAYOUT_FLOW_HORIZONTAL,
290 win, layout=ELM_BOX_LAYOUT_FLOW_HORIZONTAL, 288 size_hint_weight=(EVAS_HINT_EXPAND, 0.0),
291 size_hint_weight=(EVAS_HINT_EXPAND, 0.0), 289 size_hint_align=(EVAS_HINT_FILL, 0.0))
292 size_hint_align=(EVAS_HINT_FILL, 0.0)
293 )
294 frame.content_set(tbx2) 290 frame.content_set(tbx2)
295 tbx2.show() 291 tbx2.show()
296 292
@@ -321,19 +317,16 @@ def cb_filter(en, win):
321if __name__ == "__main__": 317if __name__ == "__main__":
322 elementary.init() 318 elementary.init()
323 win = StandardWindow("test", "Python EFL test application") 319 win = StandardWindow("test", "Python EFL test application")
324 win.callback_delete_request_add( 320 win.callback_delete_request_add(destroy, "test1", "test2",
325 destroy, "test1", "test2", str3="test3", str4="test4" 321 str3="test3", str4="test4")
326 )
327 322
328 box0 = Box(win, size_hint_weight=EXPAND_BOTH) 323 box0 = Box(win, size_hint_weight=EXPAND_BOTH)
329 win.resize_object_add(box0) 324 win.resize_object_add(box0)
330 box0.show() 325 box0.show()
331 326
332 lb = Label(win) 327 lb = Label(win)
333 lb.text = ( 328 lb.text = ("Please select a test from the list below by clicking<br>"
334 "Please select a test from the list below by clicking<br>" 329 "the test button to show the test window.")
335 "the test button to show the test window."
336 )
337 lb.show() 330 lb.show()
338 331
339 fr = Frame(win, text="Information", content=lb) 332 fr = Frame(win, text="Information", content=lb)
@@ -345,10 +338,8 @@ if __name__ == "__main__":
345 box0.pack_end(tg) 338 box0.pack_end(tg)
346 tg.show() 339 tg.show()
347 340
348 bx1 = Box( 341 bx1 = Box(win, size_hint_weight=(EVAS_HINT_EXPAND, 0.0),
349 win, size_hint_weight=(EVAS_HINT_EXPAND, 0.0), 342 size_hint_align=(EVAS_HINT_FILL, 0.0), horizontal=True)
350 size_hint_align=(EVAS_HINT_FILL, 0.0), horizontal=True
351 )
352 box0.pack_end(bx1) 343 box0.pack_end(bx1)
353 bx1.show() 344 bx1.show()
354 345
@@ -356,27 +347,21 @@ if __name__ == "__main__":
356 bx1.pack_end(lb) 347 bx1.pack_end(lb)
357 lb.show() 348 lb.show()
358 349
359 en = Entry( 350 en = Entry(win, single_line=True, scrollable=True,
360 win, single_line=True, scrollable=True, 351 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
361 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH
362 )
363 en.part_text_set("guide", "Type widget name here to search.") 352 en.part_text_set("guide", "Type widget name here to search.")
364 en.callback_changed_add(cb_filter, win) 353 en.callback_changed_add(cb_filter, win)
365 bx1.pack_end(en) 354 bx1.pack_end(en)
366 en.show() 355 en.show()
367 en.focus_set(True) 356 en.focus_set(True)
368 357
369 sc = Scroller( 358 sc = Scroller(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
370 win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH, 359 bounce=(False, True))
371 bounce=(False, True)
372 )
373 sc.show() 360 sc.show()
374 box0.pack_end(sc) 361 box0.pack_end(sc)
375 362
376 tbx = Box( 363 tbx = Box(win, size_hint_weight=(EVAS_HINT_EXPAND, 0.0),
377 win, size_hint_weight=(EVAS_HINT_EXPAND, 0.0), 364 size_hint_align=(EVAS_HINT_FILL, 0.0))
378 size_hint_align=(EVAS_HINT_FILL, 0.0)
379 )
380 sc.content_set(tbx) 365 sc.content_set(tbx)
381 tbx.show() 366 tbx.show()
382 367