Skip to content

Commit

Permalink
Add continuous_update toggle for option widgets.
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklas Korsbo committed Mar 6, 2018
1 parent dd62e50 commit 862e85d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/IJulia/statedict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ statedict{view, T}(d::Options{view, T}) =
:icons=>d.icons,
:tooltips=>d.tooltips,
:readout => d.readout,
:continuous_update=>d.continuous_update,
:_options_labels=>collect(keys(d.options)))

statedict(w::Widget) = begin
Expand Down
4 changes: 3 additions & 1 deletion src/widgets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ type Options{view, T} <: InputWidget{T}
tooltips::AbstractArray
readout::Bool
orientation::AbstractString
continuous_update::Bool
end

labels2idxs(d::OptionDict, labels) = findin(keys(d), labels)
Expand All @@ -320,13 +321,14 @@ Options(view::Symbol, options::OptionDict;
orientation="horizontal",
syncsig=true,
syncnearest=true,
continuous_update=true,
sel_mid_idx=0) = begin
#sel_mid_idx set in selection_slider(...) so default value_label is middle of range
sel_mid_idx != 0 && (value_label = collect(keys(options.dict))[sel_mid_idx])
signal, value = init_wsigval(signal, value; typ=typ, default=options[value_label])
typ = eltype(signal)
ow = Options{view, typ}(signal, label, value, value_label, index,
options, icons, tooltips, readout, orientation)
options, icons, tooltips, readout, orientation, continuous_update)
if syncsig
syncselnearest = view == :SelectionSlider && typ <: Real && syncnearest
if view != :SelectMultiple
Expand Down

0 comments on commit 862e85d

Please sign in to comment.