// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gtk import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/glib" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) type ButtonClass struct { _ structs.HostLayout ParentClass WidgetClass xClicked uintptr xActivate uintptr Padding [8]uintptr } func (x *ButtonClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // OverrideClicked sets the "clicked" callback function. // Signal emitted when the button has been activated (pressed and released). func (x *ButtonClass) OverrideClicked(cb func(*Button)) { if cb == nil { x.xClicked = 0 } else { x.xClicked = purego.NewCallback(func(ButtonVarp uintptr) { cb(ButtonNewFromInternalPtr(ButtonVarp)) }) } } // GetClicked gets the "clicked" callback function. // Signal emitted when the button has been activated (pressed and released). func (x *ButtonClass) GetClicked() func(*Button) { if x.xClicked == 0 { return nil } var rawCallback func(ButtonVarp uintptr) purego.RegisterFunc(&rawCallback, x.xClicked) return func(ButtonVar *Button) { rawCallback(ButtonVar.GoPointer()) } } // OverrideActivate sets the "activate" callback function. // Signal that causes the button to animate press then // // release. Applications should never connect to this signal, but use // the @clicked signal. func (x *ButtonClass) OverrideActivate(cb func(*Button)) { if cb == nil { x.xActivate = 0 } else { x.xActivate = purego.NewCallback(func(ButtonVarp uintptr) { cb(ButtonNewFromInternalPtr(ButtonVarp)) }) } } // GetActivate gets the "activate" callback function. // Signal that causes the button to animate press then // // release. Applications should never connect to this signal, but use // the @clicked signal. func (x *ButtonClass) GetActivate() func(*Button) { if x.xActivate == 0 { return nil } var rawCallback func(ButtonVarp uintptr) purego.RegisterFunc(&rawCallback, x.xActivate) return func(ButtonVar *Button) { rawCallback(ButtonVar.GoPointer()) } } type ButtonPrivate struct { _ structs.HostLayout } func (x *ButtonPrivate) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Calls a callback function when the button is clicked. // // <picture> // // <source srcset="button-dark.png" media="(prefers-color-scheme: dark)"> // <img alt="An example GtkButton" src="button.png"> // // </picture> // // The `GtkButton` widget can hold any valid child widget. That is, it can hold // almost any other standard `GtkWidget`. The most commonly used child is the // `GtkLabel`. // // # Shortcuts and Gestures // // The following signals have default keybindings: // // - [signal@Gtk.Button::activate] // // # CSS nodes // // `GtkButton` has a single CSS node with name button. The node will get the // style classes .image-button or .text-button, if the content is just an // image or label, respectively. It may also receive the .flat style class. // When activating a button via the keyboard, the button will temporarily // gain the .keyboard-activating style class. // // Other style classes that are commonly used with `GtkButton` include // .suggested-action and .destructive-action. In special cases, buttons // can be made round by adding the .circular style class. // // Button-like widgets like [class@Gtk.ToggleButton], [class@Gtk.MenuButton], // [class@Gtk.VolumeButton], [class@Gtk.LockButton], [class@Gtk.ColorButton] // or [class@Gtk.FontButton] use style classes such as .toggle, .popup, .scale, // .lock, .color on the button node to differentiate themselves from a plain // `GtkButton`. // // # Accessibility // // `GtkButton` uses the [enum@Gtk.AccessibleRole.button] role. type Button struct { Widget } var xButtonGLibType func() types.GType func ButtonGLibType() types.GType { return xButtonGLibType() } func ButtonNewFromInternalPtr(ptr uintptr) *Button { cls := &Button{} cls.Ptr = ptr return cls } var xNewButton func() uintptr // Creates a new `GtkButton` widget. // // To add a child widget to the button, use [method@Gtk.Button.set_child]. func NewButton() *Button { var cls *Button cret := xNewButton() if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Button{} cls.Ptr = cret return cls } var xNewButtonFromIconName func(string) uintptr // Creates a new button containing an icon from the current icon theme. // // If the icon name isn’t known, a “broken image” icon will be // displayed instead. If the current icon theme is changed, the icon // will be updated appropriately. func NewButtonFromIconName(IconNameVar string) *Button { var cls *Button cret := xNewButtonFromIconName(IconNameVar) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Button{} cls.Ptr = cret return cls } var xNewButtonWithLabel func(string) uintptr // Creates a `GtkButton` widget with a `GtkLabel` child. func NewButtonWithLabel(LabelVar string) *Button { var cls *Button cret := xNewButtonWithLabel(LabelVar) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Button{} cls.Ptr = cret return cls } var xNewButtonWithMnemonic func(string) uintptr // Creates a new `GtkButton` containing a label. // // If characters in @label are preceded by an underscore, they are underlined. // If you need a literal underscore character in a label, use “__” (two // underscores). The first underlined character represents a keyboard // accelerator called a mnemonic. Pressing <kbd>Alt</kbd> and that key // activates the button. func NewButtonWithMnemonic(LabelVar string) *Button { var cls *Button cret := xNewButtonWithMnemonic(LabelVar) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Button{} cls.Ptr = cret return cls } var xButtonGetCanShrink func(uintptr) bool // Retrieves whether the button can be smaller than the natural // size of its contents. func (x *Button) GetCanShrink() bool { cret := xButtonGetCanShrink(x.GoPointer()) return cret } var xButtonGetChild func(uintptr) uintptr // Gets the child widget of @button. func (x *Button) GetChild() *Widget { var cls *Widget cret := xButtonGetChild(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Widget{} cls.Ptr = cret return cls } var xButtonGetHasFrame func(uintptr) bool // Returns whether the button has a frame. func (x *Button) GetHasFrame() bool { cret := xButtonGetHasFrame(x.GoPointer()) return cret } var xButtonGetIconName func(uintptr) string // Returns the icon name of the button. // // If the icon name has not been set with [method@Gtk.Button.set_icon_name] // the return value will be %NULL. This will be the case if you create // an empty button with [ctor@Gtk.Button.new] to use as a container. func (x *Button) GetIconName() string { cret := xButtonGetIconName(x.GoPointer()) return cret } var xButtonGetLabel func(uintptr) string // Fetches the text from the label of the button. // // If the label text has not been set with [method@Gtk.Button.set_label] // the return value will be %NULL. This will be the case if you create // an empty button with [ctor@Gtk.Button.new] to use as a container. func (x *Button) GetLabel() string { cret := xButtonGetLabel(x.GoPointer()) return cret } var xButtonGetUseUnderline func(uintptr) bool // gets whether underlines are interpreted as mnemonics. // // See [method@Gtk.Button.set_use_underline]. func (x *Button) GetUseUnderline() bool { cret := xButtonGetUseUnderline(x.GoPointer()) return cret } var xButtonSetCanShrink func(uintptr, bool) // Sets whether the button size can be smaller than the natural size of // its contents. // // For text buttons, setting @can_shrink to true will ellipsize the label. // // For icons and custom children, this function has no effect. func (x *Button) SetCanShrink(CanShrinkVar bool) { xButtonSetCanShrink(x.GoPointer(), CanShrinkVar) } var xButtonSetChild func(uintptr, uintptr) // Sets the child widget of @button. // // Note that by using this API, you take full responsibility for setting // up the proper accessibility label and description information for @button. // Most likely, you'll either set the accessibility label or description // for @button explicitly, or you'll set a labelled-by or described-by // relations from @child to @button. func (x *Button) SetChild(ChildVar *Widget) { xButtonSetChild(x.GoPointer(), ChildVar.GoPointer()) } var xButtonSetHasFrame func(uintptr, bool) // Sets the style of the button. // // Buttons can have a flat appearance or have a frame drawn around them. func (x *Button) SetHasFrame(HasFrameVar bool) { xButtonSetHasFrame(x.GoPointer(), HasFrameVar) } var xButtonSetIconName func(uintptr, string) // Adds a `GtkImage` with the given icon name as a child. // // If @button already contains a child widget, that child widget will // be removed and replaced with the image. func (x *Button) SetIconName(IconNameVar string) { xButtonSetIconName(x.GoPointer(), IconNameVar) } var xButtonSetLabel func(uintptr, string) // Sets the text of the label of the button to @label. // // This will also clear any previously set labels. func (x *Button) SetLabel(LabelVar string) { xButtonSetLabel(x.GoPointer(), LabelVar) } var xButtonSetUseUnderline func(uintptr, bool) // Sets whether to use underlines as mnemonics. // // If true, an underline in the text of the button label indicates // the next character should be used for the mnemonic accelerator key. func (x *Button) SetUseUnderline(UseUnderlineVar bool) { xButtonSetUseUnderline(x.GoPointer(), UseUnderlineVar) } func (c *Button) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *Button) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyCanShrink sets the "can-shrink" property. // Whether the size of the button can be made smaller than the natural // size of its contents. // // For text buttons, setting this property will allow ellipsizing the label. // // If the contents of a button are an icon or a custom widget, setting this // property has no effect. func (x *Button) SetPropertyCanShrink(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("can-shrink", &v) } // GetPropertyCanShrink gets the "can-shrink" property. // Whether the size of the button can be made smaller than the natural // size of its contents. // // For text buttons, setting this property will allow ellipsizing the label. // // If the contents of a button are an icon or a custom widget, setting this // property has no effect. func (x *Button) GetPropertyCanShrink() bool { var v gobject.Value x.GetProperty("can-shrink", &v) return v.GetBoolean() } // SetPropertyHasFrame sets the "has-frame" property. // Whether the button has a frame. func (x *Button) SetPropertyHasFrame(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("has-frame", &v) } // GetPropertyHasFrame gets the "has-frame" property. // Whether the button has a frame. func (x *Button) GetPropertyHasFrame() bool { var v gobject.Value x.GetProperty("has-frame", &v) return v.GetBoolean() } // SetPropertyIconName sets the "icon-name" property. // The name of the icon used to automatically populate the button. func (x *Button) SetPropertyIconName(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("icon-name", &v) } // GetPropertyIconName gets the "icon-name" property. // The name of the icon used to automatically populate the button. func (x *Button) GetPropertyIconName() string { var v gobject.Value x.GetProperty("icon-name", &v) return v.GetString() } // SetPropertyLabel sets the "label" property. // Text of the label inside the button, if the button contains a label widget. func (x *Button) SetPropertyLabel(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("label", &v) } // GetPropertyLabel gets the "label" property. // Text of the label inside the button, if the button contains a label widget. func (x *Button) GetPropertyLabel() string { var v gobject.Value x.GetProperty("label", &v) return v.GetString() } // SetPropertyUseUnderline sets the "use-underline" property. // If set, an underline in the text indicates that the following character is // to be used as mnemonic. func (x *Button) SetPropertyUseUnderline(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("use-underline", &v) } // GetPropertyUseUnderline gets the "use-underline" property. // If set, an underline in the text indicates that the following character is // to be used as mnemonic. func (x *Button) GetPropertyUseUnderline() bool { var v gobject.Value x.GetProperty("use-underline", &v) return v.GetBoolean() } // Emitted to animate press then release. // // This is an action signal. Applications should never connect // to this signal, but use the [signal@Gtk.Button::clicked] signal. // // The default bindings for this signal are all forms of the // <kbd>␣</kbd> and <kbd>Enter</kbd> keys. func (x *Button) ConnectActivate(cb *func(Button)) uint { cbPtr := uintptr(unsafe.Pointer(cb)) if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr) glib.SaveHandlerMapping(handlerID, cbPtr) return handlerID } fcb := func(clsPtr uintptr) { fa := Button{} fa.Ptr = clsPtr cbFn := *cb cbFn(fa) } cbRefPtr := purego.NewCallback(fcb) glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb) handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr) glib.SaveHandlerMapping(handlerID, cbPtr) return handlerID } // Emitted when the button has been activated (pressed and released). func (x *Button) ConnectClicked(cb *func(Button)) uint { cbPtr := uintptr(unsafe.Pointer(cb)) if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { handlerID := gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr) glib.SaveHandlerMapping(handlerID, cbPtr) return handlerID } fcb := func(clsPtr uintptr) { fa := Button{} fa.Ptr = clsPtr cbFn := *cb cbFn(fa) } cbRefPtr := purego.NewCallback(fcb) glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb) handlerID := gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr) glib.SaveHandlerMapping(handlerID, cbPtr) return handlerID } // Requests the user's screen reader to announce the given message. // // This kind of notification is useful for messages that // either have only a visual representation or that are not // exposed visually at all, e.g. a notification about a // successful operation. // // Also, by using this API, you can ensure that the message // does not interrupts the user's current screen reader output. func (x *Button) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) { XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) } // Retrieves the accessible parent for an accessible object. // // This function returns `NULL` for top level widgets. func (x *Button) GetAccessibleParent() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetAccessibleParent(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Retrieves the accessible role of an accessible object. func (x *Button) GetAccessibleRole() AccessibleRole { cret := XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *Button) GetAtContext() *ATContext { var cls *ATContext cret := XGtkAccessibleGetAtContext(x.GoPointer()) if cret == 0 { return nil } cls = &ATContext{} cls.Ptr = cret return cls } // Queries the coordinates and dimensions of this accessible // // This functionality can be overridden by `GtkAccessible` // implementations, e.g. to get the bounds from an ignored // child widget. func (x *Button) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool { cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) return cret } // Retrieves the first accessible child of an accessible object. func (x *Button) GetFirstAccessibleChild() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Retrieves the next accessible sibling of an accessible object func (x *Button) GetNextAccessibleSibling() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Queries a platform state, such as focus. // // This functionality can be overridden by `GtkAccessible` // implementations, e.g. to get platform state from an ignored // child widget, as is the case for `GtkText` wrappers. func (x *Button) GetPlatformState(StateVar AccessiblePlatformState) bool { cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *Button) ResetProperty(PropertyVar AccessibleProperty) { XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *Button) ResetRelation(RelationVar AccessibleRelation) { XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *Button) ResetState(StateVar AccessibleState) { XGtkAccessibleResetState(x.GoPointer(), StateVar) } // Sets the parent and sibling of an accessible object. // // This function is meant to be used by accessible implementations that are // not part of the widget hierarchy, and but act as a logical bridge between // widgets. For instance, if a widget creates an object that holds metadata // for each child, and you want that object to implement the `GtkAccessible` // interface, you will use this function to ensure that the parent of each // child widget is the metadata object, and the parent of each metadata // object is the container widget. func (x *Button) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) { XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) } // Updates the next accessible sibling. // // That might be useful when a new child of a custom accessible // is created, and it needs to be linked to a previous child. func (x *Button) UpdateNextAccessibleSibling(NewSiblingVar Accessible) { XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) } // Informs ATs that the platform state has changed. // // This function should be used by `GtkAccessible` implementations that // have a platform state but are not widgets. Widgets handle platform // states automatically. func (x *Button) UpdatePlatformState(StateVar AccessiblePlatformState) { XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) } // Updates a list of accessible properties. // // See the [enum@Gtk.AccessibleProperty] documentation for the // value types of accessible properties. // // This function should be called by `GtkWidget` types whenever // an accessible property change must be communicated to assistive // technologies. // // Example: // ```c // value = gtk_adjustment_get_value (adjustment); // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), // // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, // -1); // // ``` func (x *Button) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) { XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) } // Updates an array of accessible properties. // // This function should be called by `GtkWidget` types whenever an accessible // property change must be communicated to assistive technologies. // // This function is meant to be used by language bindings. func (x *Button) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) { XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) } // Updates a list of accessible relations. // // This function should be called by `GtkWidget` types whenever an accessible // relation change must be communicated to assistive technologies. // // If the [enum@Gtk.AccessibleRelation] requires a list of references, // you should pass each reference individually, followed by `NULL`, e.g. // // ```c // gtk_accessible_update_relation (accessible, // // GTK_ACCESSIBLE_RELATION_CONTROLS, // ref1, NULL, // GTK_ACCESSIBLE_RELATION_LABELLED_BY, // ref1, ref2, ref3, NULL, // -1); // // ``` func (x *Button) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) { XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) } // Updates an array of accessible relations. // // This function should be called by `GtkWidget` types whenever an accessible // relation change must be communicated to assistive technologies. // // This function is meant to be used by language bindings. func (x *Button) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) { XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) } // Updates a list of accessible states. // // See the [enum@Gtk.AccessibleState] documentation for the // value types of accessible states. // // This function should be called by `GtkWidget` types whenever // an accessible state change must be communicated to assistive // technologies. // // Example: // // ```c // value = GTK_ACCESSIBLE_TRISTATE_MIXED; // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), // // GTK_ACCESSIBLE_STATE_CHECKED, value, // -1); // // ``` func (x *Button) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) { XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) } // Updates an array of accessible states. // // This function should be called by `GtkWidget` types whenever an accessible // state change must be communicated to assistive technologies. // // This function is meant to be used by language bindings. func (x *Button) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) { XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) } // Gets the action name for @actionable. func (x *Button) GetActionName() string { cret := XGtkActionableGetActionName(x.GoPointer()) return cret } // Gets the current target value of @actionable. func (x *Button) GetActionTargetValue() *glib.Variant { cret := XGtkActionableGetActionTargetValue(x.GoPointer()) return cret } // Specifies the name of the action with which this widget should be // associated. // // If @action_name is %NULL then the widget will be unassociated from // any previous action. // // Usually this function is used when the widget is located (or will be // located) within the hierarchy of a `GtkApplicationWindow`. // // Names are of the form “win.save” or “app.quit” for actions on the // containing [class@ApplicationWindow] or its associated [class@Application], // respectively. This is the same form used for actions in the [class@Gio.Menu] // associated with the window. func (x *Button) SetActionName(ActionNameVar *string) { ActionNameVarPtr := core.GStrdupNullable(ActionNameVar) defer core.GFreeNullable(ActionNameVarPtr) XGtkActionableSetActionName(x.GoPointer(), ActionNameVarPtr) } // Sets the target of an actionable widget. // // This is a convenience function that calls [ctor@GLib.Variant.new] for // @format_string and uses the result to call // [method@Gtk.Actionable.set_action_target_value]. // // If you are setting a string-valued target and want to set // the action name at the same time, you can use // [method@Gtk.Actionable.set_detailed_action_name]. func (x *Button) SetActionTarget(FormatStringVar string, varArgs ...interface{}) { XGtkActionableSetActionTarget(x.GoPointer(), FormatStringVar, varArgs...) } // Sets the target value of an actionable widget. // // If @target_value is %NULL then the target value is unset. // // The target value has two purposes. First, it is used as the parameter // to activation of the action associated with the `GtkActionable` widget. // Second, it is used to determine if the widget should be rendered as // “active” — the widget is active if the state is equal to the given target. // // Consider the example of associating a set of buttons with a [iface@Gio.Action] // with string state in a typical “radio button” situation. Each button // will be associated with the same action, but with a different target // value for that action. Clicking on a particular button will activate // the action with the target of that button, which will typically cause // the action’s state to change to that value. Since the action’s state // is now equal to the target value of the button, the button will now // be rendered as active (and the other buttons, with different targets, // rendered inactive). func (x *Button) SetActionTargetValue(TargetValueVar *glib.Variant) { XGtkActionableSetActionTargetValue(x.GoPointer(), TargetValueVar) } // Sets the action-name and associated string target value of an // actionable widget. // // @detailed_action_name is a string in the format accepted by // [func@Gio.Action.parse_detailed_name]. func (x *Button) SetDetailedActionName(DetailedActionNameVar string) { XGtkActionableSetDetailedActionName(x.GoPointer(), DetailedActionNameVar) } // Gets the ID of the @buildable object. // // `GtkBuilder` sets the name based on the ID attribute // of the `<object>` tag used to construct the @buildable. func (x *Button) GetBuildableId() string { cret := XGtkBuildableGetBuildableId(x.GoPointer()) return cret } 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(&xButtonGLibType, libs, "gtk_button_get_type") core.PuregoSafeRegister(&xNewButton, libs, "gtk_button_new") core.PuregoSafeRegister(&xNewButtonFromIconName, libs, "gtk_button_new_from_icon_name") core.PuregoSafeRegister(&xNewButtonWithLabel, libs, "gtk_button_new_with_label") core.PuregoSafeRegister(&xNewButtonWithMnemonic, libs, "gtk_button_new_with_mnemonic") core.PuregoSafeRegister(&xButtonGetCanShrink, libs, "gtk_button_get_can_shrink") core.PuregoSafeRegister(&xButtonGetChild, libs, "gtk_button_get_child") core.PuregoSafeRegister(&xButtonGetHasFrame, libs, "gtk_button_get_has_frame") core.PuregoSafeRegister(&xButtonGetIconName, libs, "gtk_button_get_icon_name") core.PuregoSafeRegister(&xButtonGetLabel, libs, "gtk_button_get_label") core.PuregoSafeRegister(&xButtonGetUseUnderline, libs, "gtk_button_get_use_underline") core.PuregoSafeRegister(&xButtonSetCanShrink, libs, "gtk_button_set_can_shrink") core.PuregoSafeRegister(&xButtonSetChild, libs, "gtk_button_set_child") core.PuregoSafeRegister(&xButtonSetHasFrame, libs, "gtk_button_set_has_frame") core.PuregoSafeRegister(&xButtonSetIconName, libs, "gtk_button_set_icon_name") core.PuregoSafeRegister(&xButtonSetLabel, libs, "gtk_button_set_label") core.PuregoSafeRegister(&xButtonSetUseUnderline, libs, "gtk_button_set_use_underline") }