Added key & focus signal handlers for webview, textarea and notebook
[luakit.git] / rc.lua
blob251abcd624ce43efc0dab25d290bf9b4884cdd94
1 -- Create main widgets
2 win = window{}
4 win:add_signal("destroy", function (w)
5 -- TODO Add some logic to check if this is the last window closing
6 -- before calling quit
7 luakit.quit()
8 end)
10 layout = widget{type = "vbox"}
11 win:set_child(layout)
13 -- Create tabbed notebook to store webviews
14 nbook = widget{type = "notebook"}
15 layout:pack_start(nbook, true, true, 0)
17 -- Create "status bar"
18 sbar = widget{type = "textarea"}
19 layout:pack_start(sbar, false, true, 0)
21 if #uris == 0 then
22 uris = { "http://github.com/mason-larobina/luakit" }
23 end
25 for _, uri in ipairs(uris) do
26 view = widget{type = "webview"}
27 nbook:append(view)
29 view:add_signal("property::title", function (v)
30 nbook:set_title(v, v.title)
31 sbar.text = v.title
32 win.title = v.title
33 end)
35 view.uri = uri
36 end