Skip to content
Discussion options

You must be logged in to vote

Two things:

  1. you forgot to call ExtendBaseWidget
  2. you should embed widget.Slider, not *widget.Slider

So it should look something like:

type ScrollableSlider struct {
	widget.Slider   // removed pointer embed

	OnScrolled func(*fyne.ScrollEvent)
}

func NewScrollableSlider(min, max float64) *ScrollableSlider {
	ss := &ScrollableSlider{
		Slider: widget.Slider{Min: min, Max: max), // init base struct directly
	}
	ss.ExtendBaseWidget(ss) // need this to set up extension correctly

	return ss
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lordofscripts
Comment options

Answer selected by lordofscripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants