diff --git a/src/widgets.jl b/src/widgets.jl index 35ffdba..39cfb60 100644 --- a/src/widgets.jl +++ b/src/widgets.jl @@ -365,7 +365,7 @@ function getoptions(options) optdict = OptionDict(opts) end -addoption!(opts, v::NTuple{2}) = opts[string(v[1])] = v[2] +addoption!(opts, v::Union{Pair, NTuple{2}}) = opts[string(v[1])] = v[2] addoption!(opts, v) = opts[string(v)] = v """ diff --git a/test/notebooks/Interact Manual Tests.ipynb b/test/notebooks/Interact Manual Tests.ipynb index d324797..dad58f0 100644 --- a/test/notebooks/Interact Manual Tests.ipynb +++ b/test/notebooks/Interact Manual Tests.ipynb @@ -479,6 +479,21 @@ "@show typeof.([sin,cos]);" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "#Demo on README, was broken because option Pairs didn't work\n", + "using Gadfly\n", + "@manipulate for Φ=0:π/16:4π, f=[:sin => sin, :cos => cos]\n", + " plot(θ -> f(θ+Φ ), 0, 25)\n", + "end" + ] + }, { "cell_type": "code", "execution_count": null,