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 doesn't satisfy Positionable and doesn't satisfy Widget #1402

Open
WuChanGG opened this issue Dec 15, 2020 · 2 comments
Open

Slider doesn't satisfy Positionable and doesn't satisfy Widget #1402

WuChanGG opened this issue Dec 15, 2020 · 2 comments
Labels

Comments

@WuChanGG
Copy link

WuChanGG commented Dec 15, 2020

    use conrod_core::{color, widget, Colorable, Labelable, Positionable, Sizeable, Widget};
   widget::Slider::new(100,1, 2)

I'm creating a new slider like this but I can't position it as I like, like in the examples, is this by design? is there an updated way of doing this? I'm using version 0.71

@alvinhochun
Copy link
Collaborator

You position Slider widgets just like any other widgets. It implements Widget and thus implements Positionable (blanket implementation). There is nothing special with it as far as I am aware.

Are you having issues specifically with the Slider widget? Do you already have a UI with some other widgets and be able to position them?

@Nevsden
Copy link

Nevsden commented Mar 15, 2022

As this post has aged a bit now, I am not sure I can help the author of the issue.
However, I think I have a solution for the adressed problem.

widget::Slider::new(100,1, 2) implies Slider to be cast into an {integer} slider. The crate however only allows float-type sliders. Therefore it should be widget::Slider::new(100.,1., 2.).

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