diff --git a/src/gui.jl b/src/gui.jl index 684256ca648183e9c884a078eadb860f5842783b..846a22fd16b90fffc169ad73f72c3ffda0003e16 100644 --- a/src/gui.jl +++ b/src/gui.jl @@ -2,7 +2,8 @@ export Widget_Container, GUI, set!, add!, animate mutable struct Widget_Container #Widgets with symbols - widgets::Array{WebIO.Node{WebIO.DOM},1} + #widgets::Array{WebIO.Node{WebIO.DOM},1} + widgets vals::Dict end @@ -44,6 +45,13 @@ function GUI() GUI(10) end +function (gui::GUI)() + # This ensures that observables don't time out, removing this will + # break everything and it will be impossible to track down. + watched = Node(:div, style=Dict(:display=>"none"), gui.widgets.widgets...) + Node(:div, gui.dom, watched) +end + function set!(gui::GUI, widgets::Widget_Container) gui.widgets = widgets gui.values = [obs(widget).val for widget in gui.widgets.widgets] @@ -149,7 +157,8 @@ function update(gui::GUI, s::Symbol, watchsymbol=:0) # if the value of the widget associated with watchsymbol has changed w = gui.widgets[s] if watchsymbol==:0||has_changed(gui, watchsymbol) - obs(w).listeners[2](obs(w)[]) + #obs(w).listeners[2](obs(w)[]) + obs(w)[] = obs(w)[] end end function update(gui::GUI, a::Array, watchsymbol=:0)