add r
to accomodate widget reference loops
any widget declared before webview can refer to it as r.webview
This commit is contained in:
parent
a5ea2027d5
commit
dd109f4a4b
@ -42,6 +42,7 @@
|
|||||||
|
|
||||||
|
|
||||||
(let [current-url "https://terse.telent.net/admin/stream"
|
(let [current-url "https://terse.telent.net/admin/stream"
|
||||||
|
r {}
|
||||||
window (Gtk.Window {
|
window (Gtk.Window {
|
||||||
:title "Just browsing"
|
:title "Just browsing"
|
||||||
:default_width 800
|
:default_width 800
|
||||||
@ -54,7 +55,11 @@
|
|||||||
nav-bar (Gtk.Box {
|
nav-bar (Gtk.Box {
|
||||||
:orientation Gtk.Orientation.HORIZONTAL
|
:orientation Gtk.Orientation.HORIZONTAL
|
||||||
})
|
})
|
||||||
url (doto (Gtk.Entry)
|
url (doto (Gtk.Entry {
|
||||||
|
:on_activate
|
||||||
|
(fn [self]
|
||||||
|
(r.webview:load_uri self.text))
|
||||||
|
})
|
||||||
(: :set_text current-url))
|
(: :set_text current-url))
|
||||||
webview (WebKit2.WebView {
|
webview (WebKit2.WebView {
|
||||||
:on_notify
|
:on_notify
|
||||||
@ -74,11 +79,9 @@
|
|||||||
(webview:go_back)))
|
(webview:go_back)))
|
||||||
})
|
})
|
||||||
(: :set_image (named-image "go-previous")))]
|
(: :set_image (named-image "go-previous")))]
|
||||||
|
(tset r :webview webview)
|
||||||
(load-adblocks webview.user_content_manager content-filter-store)
|
(load-adblocks webview.user_content_manager content-filter-store)
|
||||||
|
|
||||||
(tset url :on_activate (fn [self]
|
|
||||||
(webview:load_uri self.text)))
|
|
||||||
|
|
||||||
(nav-bar:pack_start back false false 2)
|
(nav-bar:pack_start back false false 2)
|
||||||
(nav-bar:pack_start url true true 2)
|
(nav-bar:pack_start url true true 2)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user