Skip to content
Snippets Groups Projects
Commit c3c7e2b1 authored by Jacob Wikmark's avatar Jacob Wikmark
Browse files

merge

parents aacc2e8d 3de53341
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,8 @@ wc[:foo] ...@@ -8,7 +8,8 @@ wc[:foo]
""" """
mutable struct Widget_Container mutable struct Widget_Container
#Widgets with symbols #Widgets with symbols
widgets::Array{WebIO.Node{WebIO.DOM},1} #widgets::Array{WebIO.Node{WebIO.DOM},1}
widgets
vals::Dict vals::Dict
end end
...@@ -62,6 +63,13 @@ function GUI() ...@@ -62,6 +63,13 @@ function GUI()
GUI(10) GUI(10)
end 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
""" """
Used to set the widgets, the dom or the data array of the GUI. This replaces any existing widget or dom in the GUI. Used to set the widgets, the dom or the data array of the GUI. This replaces any existing widget or dom in the GUI.
""" """
...@@ -179,7 +187,8 @@ function update(gui::GUI, s::Symbol, watchsymbol=:0) ...@@ -179,7 +187,8 @@ function update(gui::GUI, s::Symbol, watchsymbol=:0)
# if the value of the widget associated with watchsymbol has changed # if the value of the widget associated with watchsymbol has changed
w = gui.widgets[s] w = gui.widgets[s]
if watchsymbol==:0||has_changed(gui, watchsymbol) 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
end end
function update(gui::GUI, a::Array, watchsymbol=:0) function update(gui::GUI, a::Array, watchsymbol=:0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment