v0.2.1 c0399be

gtkcellrendererspin.go RawHistoryFolder

1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5	"github.com/ebitengine/purego"
6
7	"github.com/bnema/puregotk/pkg/core"
8	"github.com/bnema/puregotk/v4/gobject"
9	"github.com/bnema/puregotk/v4/gobject/types"
10)
11
12// Renders a spin button in a cell
13//
14// `GtkCellRendererSpin` renders text in a cell like `GtkCellRendererText` from
15// which it is derived. But while `GtkCellRendererText` offers a simple entry to
16// edit the text, `GtkCellRendererSpin` offers a `GtkSpinButton` widget. Of course,
17// that means that the text has to be parseable as a floating point number.
18//
19// The range of the spinbutton is taken from the adjustment property of the
20// cell renderer, which can be set explicitly or mapped to a column in the
21// tree model, like all properties of cell renders. `GtkCellRendererSpin`
22// also has properties for the `GtkCellRendererSpin:climb-rate` and the number
23// of `GtkCellRendererSpin:digits` to display. Other `GtkSpinButton` properties
24// can be set in a handler for the `GtkCellRenderer::editing-started` signal.
25type CellRendererSpin struct {
26	CellRendererText
27}
28
29var xCellRendererSpinGLibType func() types.GType
30
31func CellRendererSpinGLibType() types.GType {
32	return xCellRendererSpinGLibType()
33}
34
35func CellRendererSpinNewFromInternalPtr(ptr uintptr) *CellRendererSpin {
36	cls := &CellRendererSpin{}
37	cls.Ptr = ptr
38	return cls
39}
40
41var xNewCellRendererSpin func() uintptr
42
43// Creates a new `GtkCellRendererSpin`.
44func NewCellRendererSpin() *CellRendererSpin {
45	var cls *CellRendererSpin
46
47	cret := xNewCellRendererSpin()
48
49	if cret == 0 {
50		return nil
51	}
52	gobject.IncreaseRef(cret)
53	cls = &CellRendererSpin{}
54	cls.Ptr = cret
55	return cls
56}
57
58func (c *CellRendererSpin) GoPointer() uintptr {
59	if c == nil {
60		return 0
61	}
62	return c.Ptr
63}
64
65func (c *CellRendererSpin) SetGoPointer(ptr uintptr) {
66	c.Ptr = ptr
67}
68
69// SetPropertyClimbRate sets the "climb-rate" property.
70// The acceleration rate when you hold down a button.
71func (x *CellRendererSpin) SetPropertyClimbRate(value float64) {
72	var v gobject.Value
73	v.Init(gobject.TypeDoubleVal)
74	v.SetDouble(value)
75	x.SetProperty("climb-rate", &v)
76}
77
78// GetPropertyClimbRate gets the "climb-rate" property.
79// The acceleration rate when you hold down a button.
80func (x *CellRendererSpin) GetPropertyClimbRate() float64 {
81	var v gobject.Value
82	x.GetProperty("climb-rate", &v)
83	return v.GetDouble()
84}
85
86// SetPropertyDigits sets the "digits" property.
87// The number of decimal places to display.
88func (x *CellRendererSpin) SetPropertyDigits(value uint) {
89	var v gobject.Value
90	v.Init(gobject.TypeUintVal)
91	v.SetUint(value)
92	x.SetProperty("digits", &v)
93}
94
95// GetPropertyDigits gets the "digits" property.
96// The number of decimal places to display.
97func (x *CellRendererSpin) GetPropertyDigits() uint {
98	var v gobject.Value
99	x.GetProperty("digits", &v)
100	return v.GetUint()
101}
102
103func init() {
104	core.SetPackageName("GTK", "gtk4")
105	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
106	var libs []uintptr
107	for _, libPath := range core.GetPaths("GTK") {
108		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
109		if err != nil {
110			panic(err)
111		}
112		libs = append(libs, lib)
113	}
114
115	core.PuregoSafeRegister(&xCellRendererSpinGLibType, libs, "gtk_cell_renderer_spin_get_type")
116
117	core.PuregoSafeRegister(&xNewCellRendererSpin, libs, "gtk_cell_renderer_spin_new")
118
119}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close