Add documentation for Slider

This commit is contained in:
2023-09-14 17:03:19 -04:00
parent c210c07b74
commit 2251d33ac7
3 changed files with 22 additions and 6 deletions

View File

@@ -33,12 +33,12 @@ func newScrollbar (orient string) *Scrollbar {
this.Add(this.handle)
this.SetFocusable(true)
this.CaptureDND(true)
this.CaptureMouse(true)
this.CaptureScroll(true)
this.CaptureKeyboard(true)
this.OnKeyDown(this.handleKeyDown)
this.OnMouseDown(this.handleMouseDown)
this.OnMouseUp(this.handleMouseUp)
@@ -80,6 +80,13 @@ func (this *Scrollbar) SetValue (value float64) {
// right/bottom.
func (this *Scrollbar) Value () float64 {
// TODO
return 0
}
// OnValueChange specifies a function to be called when the position of the
// scrollbar changes.
func (this *Slider) OnValueChange (callback func ()) event.Cookie {
return this.on.valueChange.Connect(callback)
}
func (this *Scrollbar) handleKeyDown (key input.Key, numpad bool) {