gtkcellrendererspinner.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 spinning animation in a cell
13//
14// `GtkCellRendererSpinner` renders a spinning animation in a cell, very
15// similar to `GtkSpinner`. It can often be used as an alternative
16// to a `GtkCellRendererProgress` for displaying indefinite activity,
17// instead of actual progress.
18//
19// To start the animation in a cell, set the `GtkCellRendererSpinner:active`
20// property to %TRUE and increment the `GtkCellRendererSpinner:pulse` property
21// at regular intervals. The usual way to set the cell renderer properties
22// for each cell is to bind them to columns in your tree model using e.g.
23// gtk_tree_view_column_add_attribute().
24type CellRendererSpinner struct {
25 CellRenderer
26}
27
28var xCellRendererSpinnerGLibType func() types.GType
29
30func CellRendererSpinnerGLibType() types.GType {
31 return xCellRendererSpinnerGLibType()
32}
33
34func CellRendererSpinnerNewFromInternalPtr(ptr uintptr) *CellRendererSpinner {
35 cls := &CellRendererSpinner{}
36 cls.Ptr = ptr
37 return cls
38}
39
40var xNewCellRendererSpinner func() uintptr
41
42// Returns a new cell renderer which will show a spinner to indicate
43// activity.
44func NewCellRendererSpinner() *CellRendererSpinner {
45 var cls *CellRendererSpinner
46
47 cret := xNewCellRendererSpinner()
48
49 if cret == 0 {
50 return nil
51 }
52 gobject.IncreaseRef(cret)
53 cls = &CellRendererSpinner{}
54 cls.Ptr = cret
55 return cls
56}
57
58func (c *CellRendererSpinner) GoPointer() uintptr {
59 if c == nil {
60 return 0
61 }
62 return c.Ptr
63}
64
65func (c *CellRendererSpinner) SetGoPointer(ptr uintptr) {
66 c.Ptr = ptr
67}
68
69// SetPropertyActive sets the "active" property.
70// Whether the spinner is active (ie. shown) in the cell
71func (x *CellRendererSpinner) SetPropertyActive(value bool) {
72 var v gobject.Value
73 v.Init(gobject.TypeBooleanVal)
74 v.SetBoolean(value)
75 x.SetProperty("active", &v)
76}
77
78// GetPropertyActive gets the "active" property.
79// Whether the spinner is active (ie. shown) in the cell
80func (x *CellRendererSpinner) GetPropertyActive() bool {
81 var v gobject.Value
82 x.GetProperty("active", &v)
83 return v.GetBoolean()
84}
85
86// SetPropertyPulse sets the "pulse" property.
87// Pulse of the spinner. Increment this value to draw the next frame of the
88// spinner animation. Usually, you would update this value in a timeout.
89//
90// By default, the `GtkSpinner` widget draws one full cycle of the animation,
91// consisting of 12 frames, in 750 milliseconds.
92func (x *CellRendererSpinner) SetPropertyPulse(value uint) {
93 var v gobject.Value
94 v.Init(gobject.TypeUintVal)
95 v.SetUint(value)
96 x.SetProperty("pulse", &v)
97}
98
99// GetPropertyPulse gets the "pulse" property.
100// Pulse of the spinner. Increment this value to draw the next frame of the
101// spinner animation. Usually, you would update this value in a timeout.
102//
103// By default, the `GtkSpinner` widget draws one full cycle of the animation,
104// consisting of 12 frames, in 750 milliseconds.
105func (x *CellRendererSpinner) GetPropertyPulse() uint {
106 var v gobject.Value
107 x.GetProperty("pulse", &v)
108 return v.GetUint()
109}
110
111func init() {
112 core.SetPackageName("GTK", "gtk4")
113 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
114 var libs []uintptr
115 for _, libPath := range core.GetPaths("GTK") {
116 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
117 if err != nil {
118 panic(err)
119 }
120 libs = append(libs, lib)
121 }
122
123 core.PuregoSafeRegister(&xCellRendererSpinnerGLibType, libs, "gtk_cell_renderer_spinner_get_type")
124
125 core.PuregoSafeRegister(&xNewCellRendererSpinner, libs, "gtk_cell_renderer_spinner_new")
126
127}