// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gtk import ( "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) // Renders a spinning animation in a cell // // `GtkCellRendererSpinner` renders a spinning animation in a cell, very // similar to `GtkSpinner`. It can often be used as an alternative // to a `GtkCellRendererProgress` for displaying indefinite activity, // instead of actual progress. // // To start the animation in a cell, set the `GtkCellRendererSpinner:active` // property to %TRUE and increment the `GtkCellRendererSpinner:pulse` property // at regular intervals. The usual way to set the cell renderer properties // for each cell is to bind them to columns in your tree model using e.g. // gtk_tree_view_column_add_attribute(). type CellRendererSpinner struct { CellRenderer } var xCellRendererSpinnerGLibType func() types.GType func CellRendererSpinnerGLibType() types.GType { return xCellRendererSpinnerGLibType() } func CellRendererSpinnerNewFromInternalPtr(ptr uintptr) *CellRendererSpinner { cls := &CellRendererSpinner{} cls.Ptr = ptr return cls } var xNewCellRendererSpinner func() uintptr // Returns a new cell renderer which will show a spinner to indicate // activity. func NewCellRendererSpinner() *CellRendererSpinner { var cls *CellRendererSpinner cret := xNewCellRendererSpinner() if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &CellRendererSpinner{} cls.Ptr = cret return cls } func (c *CellRendererSpinner) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *CellRendererSpinner) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyActive sets the "active" property. // Whether the spinner is active (ie. shown) in the cell func (x *CellRendererSpinner) SetPropertyActive(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("active", &v) } // GetPropertyActive gets the "active" property. // Whether the spinner is active (ie. shown) in the cell func (x *CellRendererSpinner) GetPropertyActive() bool { var v gobject.Value x.GetProperty("active", &v) return v.GetBoolean() } // SetPropertyPulse sets the "pulse" property. // Pulse of the spinner. Increment this value to draw the next frame of the // spinner animation. Usually, you would update this value in a timeout. // // By default, the `GtkSpinner` widget draws one full cycle of the animation, // consisting of 12 frames, in 750 milliseconds. func (x *CellRendererSpinner) SetPropertyPulse(value uint) { var v gobject.Value v.Init(gobject.TypeUintVal) v.SetUint(value) x.SetProperty("pulse", &v) } // GetPropertyPulse gets the "pulse" property. // Pulse of the spinner. Increment this value to draw the next frame of the // spinner animation. Usually, you would update this value in a timeout. // // By default, the `GtkSpinner` widget draws one full cycle of the animation, // consisting of 12 frames, in 750 milliseconds. func (x *CellRendererSpinner) GetPropertyPulse() uint { var v gobject.Value x.GetProperty("pulse", &v) return v.GetUint() } func init() { core.SetPackageName("GTK", "gtk4") core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"}) var libs []uintptr for _, libPath := range core.GetPaths("GTK") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xCellRendererSpinnerGLibType, libs, "gtk_cell_renderer_spinner_get_type") core.PuregoSafeRegister(&xNewCellRendererSpinner, libs, "gtk_cell_renderer_spinner_new") }