diff --git a/src/construct.jl b/src/construct.jl index d3dadcf3535e8a83cffc22cc39d76e889e589ec2..b57dd0b83f17a632288060772c64438b53bd709f 100644 --- a/src/construct.jl +++ b/src/construct.jl @@ -17,7 +17,7 @@ end function map_block(block, symbols) lambda = Expr(:(->), Expr(:tuple, symbols...), block) - :(map($lambda, $(map(s->:(obs($s)), symbols)...))) + :(map($lambda, $(map(s->:(observe($s)), symbols)...))) end function symbols(bindings) diff --git a/src/gui.jl b/src/gui.jl index e0e2acb90f03b29133f0e3caec96e1ebd321208b..79a48154fe559c053ca805ca6a0c594ac63dc538 100644 --- a/src/gui.jl +++ b/src/gui.jl @@ -80,7 +80,7 @@ Used to set the widgets, the dom or the data array of the GUI. This replaces any """ function set!(gui::GUI, widgets::Widget_Container) gui.widgets = widgets - gui.values = [obs(widget).val for widget in gui.widgets.widgets] + gui.values = [observe(widget).val for widget in gui.widgets.widgets] end function set!(gui::GUI, dom::WebIO.Node) @@ -109,11 +109,11 @@ function Base.push!(gui::GUI, values::Tuple, indices::Tuple) end function Base.getindex(gui::GUI, s::Symbol) - obs(gui.widgets[s])[] + observe(gui.widgets[s])[] end function Base.setindex!(gui::GUI, newval, s::Symbol) - obs(gui.widgets[s])[] = newval + observe(gui.widgets[s])[] = newval end """ @@ -126,7 +126,7 @@ function add!(gui::GUI, widgets::Widget_Container) end gui.widgets.widgets = vcat(gui.widgets.widgets, widgets.widgets) gui.widgets.vals = merge(gui.widgets.vals, newdict) - gui.values = vcat(gui.values, [obs(w)[] for w in widgets.widgets]) + gui.values = vcat(gui.values, [observe(w)[] for w in widgets.widgets]) end @@ -196,14 +196,14 @@ 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)[] = obs(w)[] + #observe(w).listeners[2](observe(w)[]) + observe(w)[] = observe(w)[] end end function update(gui::GUI, a::Array, watchsymbol=:0) W = [gui.widgets[s] for s in a] if watchsymbol==:0||has_changed(gui, watchsymbol) - [obs(w).listeners[2](obs(w)[]) for w in W] + [observe(w).listeners[2](observe(w)[]) for w in W] end end diff --git a/src/tools.jl b/src/tools.jl index 4769768971b17872b5ebefbc30b7cc5fd7d0a269..da8d1d5c1f1ca7f0a60b8b413fdde947cd8d9087 100644 --- a/src/tools.jl +++ b/src/tools.jl @@ -4,7 +4,7 @@ Links the values of two observables by adding a listener. Optional arguments f a Example: link(o1, o2, (x) -> 2*x, (x) -> x/2) -will ensure obs(o2)[] is always 2*obs(o1)[] and vice versa. +will ensure observe(o2)[] is always 2*observe(o1)[] and vice versa. """ function link!(o1::Observable, o2::Observable, f = (x)->(x), g = (x)->(x), master=false) diff --git a/test/runtests.jl b/test/runtests.jl index 69a63a198dbf1e5c42b13dbb849e7c27b6060177..9bd8a1a5af0acd23e4488776ba5fd01aa4dbba0f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -59,7 +59,7 @@ end add!(gui, wid2) gui[:dummy] = 23 @test typeof(gui()) <: WebIO.Node - @test obs(dummy)[] == 23 + @test observe(dummy)[] == 23 @test gui.widgets[:dummy] == dummy end @@ -86,6 +86,6 @@ end WebIO.render(dummy) end @test typeof(ui) <: WebIO.Node{WebIO.DOM} - obs(dummy)[] = 80 - @test obs(dummy)[] == 80 + observe(dummy)[] = 80 + @test observe(dummy)[] == 80 end