summaryrefslogtreecommitdiffstatshomepage
path: root/slider.go
diff options
context:
space:
mode:
Diffstat (limited to 'slider.go')
-rw-r--r--slider.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/slider.go b/slider.go
index 2e35ed0c..1e096b5d 100644
--- a/slider.go
+++ b/slider.go
@@ -20,20 +20,32 @@ type Slider struct {
persistent bool
}
+type SliderCfg struct {
+ Orientation Orientation
+ ToolTipsHidden bool
+}
+
func NewSlider(parent Container) (*Slider, error) {
return NewSliderWithOrientation(parent, Horizontal)
}
func NewSliderWithOrientation(parent Container, orientation Orientation) (*Slider, error) {
+ return NewSliderWithCfg(parent, &SliderCfg{Orientation: orientation})
+}
+
+func NewSliderWithCfg(parent Container, cfg *SliderCfg) (*Slider, error) {
sl := new(Slider)
- var style uint32 = win.WS_TABSTOP | win.WS_VISIBLE | win.TBS_TOOLTIPS
- if orientation == Vertical {
+ var style uint32 = win.WS_TABSTOP | win.WS_VISIBLE
+ if cfg.Orientation == Vertical {
style |= win.TBS_VERT
sl.layoutFlags = ShrinkableVert | GrowableVert | GreedyVert
} else {
sl.layoutFlags = ShrinkableHorz | GrowableHorz | GreedyHorz
}
+ if !cfg.ToolTipsHidden {
+ style |= win.TBS_TOOLTIPS
+ }
if err := InitWidget(
sl,