File: spin_button.go

package info (click to toggle)
golang-github-twstrike-gotk3adapter 0.0~git20170505.0.901a95d%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,232 kB
  • sloc: ruby: 478; makefile: 4
file content (53 lines) | stat: -rw-r--r-- 1,065 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package gtka

import (
	"github.com/gotk3/gotk3/gtk"
	"github.com/twstrike/gotk3adapter/gtki"
)

type spinButton struct {
	*entry
	internal *gtk.SpinButton
}

func wrapSpinButtonSimple(v *gtk.SpinButton) *spinButton {
	if v == nil {
		return nil
	}
	return &spinButton{wrapEntrySimple(&v.Entry), v}
}

func wrapSpinButton(v *gtk.SpinButton, e error) (*spinButton, error) {
	return wrapSpinButtonSimple(v), e
}

func unwrapSpinButton(v gtki.SpinButton) *gtk.SpinButton {
	if v == nil {
		return nil
	}
	return v.(*spinButton).internal
}

func (v *spinButton) GetValueAsInt() int {
	return v.internal.GetValueAsInt()
}

func (v *spinButton) SetValue(v1 float64) {
	v.internal.SetValue(v1)
}

func (v *spinButton) GetValue() float64 {
	return v.internal.GetValue()
}

func (v *spinButton) GetAdjustment() gtki.Adjustment {
	return wrapAdjustmentSimple(v.internal.GetAdjustment())
}

func (v *spinButton) SetRange(v1 float64, v2 float64) {
	v.internal.SetRange(v1, v2)
}

func (v *spinButton) SetIncrements(v1 float64, v2 float64) {
	v.internal.SetIncrements(v1, v2)
}