Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slider position did not update when value changes #3492

Closed
kongdd opened this issue Dec 19, 2023 · 1 comment
Closed

slider position did not update when value changes #3492

kongdd opened this issue Dec 19, 2023 · 1 comment
Labels

Comments

@kongdd
Copy link

kongdd commented Dec 19, 2023

  • GLMakie: v0.9.3
using GLMakie

function map_on_keyboard(fig, stime)
  on(events(fig).keyboardbutton) do event
    if event.action == Keyboard.press || event.action == Keyboard.repeat
      if event.key == Keyboard.right
        stime[] += 1
      elseif event.key == Keyboard.left
        stime[] > 1 && (stime[] -= 1)
      end
    end
    return Consume(false)
  end
end

begin
  fig = Figure(size=(1200, 100))
  stime = SliderGrid(fig[1, 1],
    (label="Date", range=1:10, startvalue=1)).sliders[1].value

  map_on_keyboard(fig, stime)
  fig
end

slider_error

@kongdd kongdd added the bug label Dec 19, 2023
@ffreyer
Copy link
Collaborator

ffreyer commented Dec 20, 2023

You should use set_close_to!(slider, value) to update values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants