summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2014-05-29 19:43:12 +0300
committerKai Huuhko <kai.huuhko@gmail.com>2014-05-29 19:43:12 +0300
commit6431873fcd453e0b2c97d40c60bb3af6e61e3abd (patch)
treed369b3b309a974e66b658f4abb73b848639bae7e
parent0c258e323b936fa13dbafd7bc1514dccb2f0333a (diff)
Elementary: Add more signals to web example
-rw-r--r--examples/elementary/test_web.py75
1 files changed, 61 insertions, 14 deletions
diff --git a/examples/elementary/test_web.py b/examples/elementary/test_web.py
index a48ca38..5c220fe 100644
--- a/examples/elementary/test_web.py
+++ b/examples/elementary/test_web.py
@@ -5,7 +5,6 @@ from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
5from efl import ecore 5from efl import ecore
6from efl import elementary 6from efl import elementary
7from efl.elementary.window import StandardWindow 7from efl.elementary.window import StandardWindow
8from efl.elementary.background import Background
9from efl.elementary.box import Box 8from efl.elementary.box import Box
10from efl.elementary.button import Button 9from efl.elementary.button import Button
11from efl.elementary.entry import Entry 10from efl.elementary.entry import Entry
@@ -16,6 +15,7 @@ EXPAND_HORIZ = EVAS_HINT_EXPAND, 0.0
16FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL 15FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
17FILL_HORIZ = EVAS_HINT_FILL, 0.5 16FILL_HORIZ = EVAS_HINT_FILL, 0.5
18 17
18
19def web_clicked(obj): 19def web_clicked(obj):
20 if not elementary.need_web(): 20 if not elementary.need_web():
21 print("EFL-webkit not available!") 21 print("EFL-webkit not available!")
@@ -29,34 +29,79 @@ def web_clicked(obj):
29 win.resize_object_add(vbx) 29 win.resize_object_add(vbx)
30 vbx.show() 30 vbx.show()
31 31
32 web = Web(win, url="http://enlightenment.org/", 32 web = Web(
33 win, url="http://enlightenment.org/",
33 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH, 34 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
34 size_hint_min=(100, 100)) 35 size_hint_min=(100, 100)
36 )
35 vbx.pack_end(web) 37 vbx.pack_end(web)
36 web.show() 38 web.show()
37 39
38 # Debug: 40 # Debug:
39 def dbg(*args): 41 def dbg(*args):
40 print(("DEBUG: %s" % args[-1], " ".join(repr(x) for x in args[1:-1]))) 42 print("DEBUG: %s %s" % (
41 web.callback_link_hover_in_add(dbg, "link in") 43 args[-1], " ".join(repr(x) for x in args[1:-1])
42 web.callback_link_hover_out_add(dbg, "link out") 44 ))
43 45
44 web.callback_uri_changed_add(dbg, "uri") 46 #web.callback_download_request_add(dbg, "download request")
45 web.callback_title_changed_add(dbg, "title") 47 web.callback_editorclient_contents_changed_add(
48 dbg, "editor client contents changed")
49 web.callback_editorclient_selection_changed_add(
50 dbg, "editor client selection changed")
51 #web.callback_frame_created_add(dbg, frame created)
52 web.callback_icon_received_add(dbg, "icon received")
53 web.callback_inputmethod_changed_add(dbg, "input method changed")
54 web.callback_js_windowobject_clear_add(dbg, "js window object clear")
55 web.callback_link_hover_in_add(dbg, "link hover in")
56 web.callback_link_hover_out_add(dbg, "link hover out")
57
58 #web.callback_load_document_finished_add(dbg, "load document finished")
59 web.callback_load_error_add(dbg, "load error")
46 web.callback_load_finished_add(dbg, "load finished") 60 web.callback_load_finished_add(dbg, "load finished")
47 web.callback_load_finished_add(dbg, "load error") 61 web.callback_load_newwindow_show_add(dbg, "load new window show")
48 web.callback_load_progress_add(dbg, "load progress") 62 web.callback_load_progress_add(dbg, "load progress")
49 web.callback_load_provisional_add(dbg, "load provisional") 63 web.callback_load_provisional_add(dbg, "load provisional")
50 web.callback_load_started_add(dbg, "load started") 64 web.callback_load_started_add(dbg, "load started")
51 65
66 #web.callback_menubar_visible_get_add(dbg, "menubar visible get")
67 web.callback_menubar_visible_set_add(dbg, "menubar visible set")
68
69 #web.callback_popup_created_add(dbg, "popup created")
70 #web.callback_popup_willdelete_add(dbg, "popup will delete")
71
72 web.callback_ready_add(dbg, "ready")
73
74 #web.callback_scrollbars_visible_get_add(dbg, "scrollbars visible get")
75 web.callback_scrollbars_visible_set_add(dbg, "scrollbars visible set")
76
77 web.callback_statusbar_text_set_add(dbg, "statusbar text set")
78 #web.callback_statusbar_visible_get_add(dbg, "statusbar visible get")
79 web.callback_statusbar_visible_set_add(dbg, "statusbar visible set")
80
81 web.callback_title_changed_add(dbg, "title changed")
82
83 #web.callback_toolbars_visible_get_add(dbg, "toolbars visible get")
84 web.callback_toolbars_visible_set_add(dbg, "toolbars visible set")
85
86 web.callback_tooltip_text_set_add(dbg, "tooltip text set")
87 web.callback_uri_changed_add(dbg, "uri changed")
88 web.callback_view_resized_add(dbg, "view resized")
89 web.callback_windows_close_request_add(dbg, "windows close request")
90 web.callback_zoom_animated_end_add(dbg, "zoom animated end")
91
92 web.callback_focused_add(dbg, "focused")
93 web.callback_unfocused_add(dbg, "unfocused")
94
52 # JS debug to console: 95 # JS debug to console:
53 def console_msg(obj, msg, line, src): 96 def console_msg(obj, msg, line, src):
54 print(("CONSOLE: %s:%d %r" % (src, line, msg))) 97 print(("CONSOLE: %s:%d %r" % (src, line, msg)))
55 web.console_message_hook_set(console_msg) 98 web.console_message_hook_set(console_msg)
56 99
57 # navigation bar: 100 # navigation bar:
58 hbx = Box(win, horizontal=True, size_hint_weight=EXPAND_HORIZ, 101 hbx = Box(
59 size_hint_align=FILL_HORIZ) 102 win, horizontal=True, size_hint_weight=EXPAND_HORIZ,
103 size_hint_align=FILL_HORIZ
104 )
60 vbx.pack_start(hbx) 105 vbx.pack_start(hbx)
61 hbx.show() 106 hbx.show()
62 107
@@ -80,8 +125,10 @@ def web_clicked(obj):
80 hbx.pack_end(bt) 125 hbx.pack_end(bt)
81 bt.show() 126 bt.show()
82 127
83 en = Entry(win, scrollable=True, editable=True, single_line=True, 128 en = Entry(
84 size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH) 129 win, scrollable=True, editable=True, single_line=True,
130 size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH
131 )
85 hbx.pack_end(en) 132 hbx.pack_end(en)
86 en.show() 133 en.show()
87 134