Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: CheckButtonToggledCallback

[574:7] extends: object

Generated low-level callback wrapper for GIR callback toggled.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • CheckButtonToggledCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: CheckButtonActivateCallback

[504:7] extends: object

Generated low-level callback wrapper for GIR callback activate.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • CheckButtonActivateCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: CheckButtonMeta

[644:14] static extends: object

Generated metadata helpers for CheckButton class surfaces.

Methods

  • properties ()

    Returns property metadata for CheckButton.

    • @r A list.
  • signals ()

    Returns signal metadata for CheckButton.

    • @r A list.

class: CheckButtonCtors

[484:14] static extends: object

Alternate constructors for CheckButton. Usage: CheckButtonCtors.<name>(...). The primary constructor lives directly on CheckButton.

Methods

  • newWithMnemonic (string label)

    Creates a new GtkCheckButton with the given text and a mnemonic.

    • @p label is The text of the button, with an underscore in front of the mnemonic character.
    • @r A new CheckButton.

class: CheckButton

[44:7] extends: object

Places a label next to an indicator. Example GtkCheckButtons A GtkCheckButton is created by calling either [ctor@Gtk.CheckButton.new] or [ctor@Gtk.CheckButton.new_with_label]. The state of a GtkCheckButton can be set specifically using [method@Gtk.CheckButton.set_active], and retrieved using [method@Gtk.CheckButton.get_active]. # Inconsistent state In addition to "on" and "off", check buttons can be an "in between" state that is neither on nor off. This can be used e.g. when the user has selected a range of elements (such as some text or spreadsheet cells) that are affected by a check button, and the current values in that range are inconsistent. To set a GtkCheckButton to inconsistent state, use [method@Gtk.CheckButton.set_inconsistent]. # Grouping Check buttons can be grouped together, to form mutually exclusive groups - only one of the buttons can be toggled at a time, and toggling another one will switch the currently toggled one off. Grouped check buttons use a different indicator, and are commonly referred to as radio buttons. Example GtkRadioButtons To add a GtkCheckButton to a group, use [method@Gtk.CheckButton.set_group]. When the code must keep track of the state of a group of radio buttons, it is recommended to keep track of such state through a stateful GAction with a target for each button. Using the toggled signals to keep track of the group changes and state is discouraged. # Shortcuts and Gestures GtkCheckButton supports the following keyboard shortcuts: - or Enter activates the button. # CSS nodes checkbutton[.text-button][.grouped] ├── check ╰── [label] A GtkCheckButton has a main node with name checkbutton. If the [property@Gtk.CheckButton:label] or [property@Gtk.CheckButton:child] properties are set, it contains a child widget. The indicator node is named check when no group is set, and radio if the checkbutton is grouped together with other checkbuttons. # Accessibility GtkCheckButton uses the [enum@Gtk.AccessibleRole.checkbox] role.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • CheckButton (label = null)

    Creates a new GtkCheckButton.

    • @p label is the text for the check button..
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asWidget ()

    Wraps this handle as Widget.

    • @r A Widget object.
  • asAccessible ()

    Wraps this handle as Accessible.

    • @r A Accessible object.
  • asActionable ()

    Wraps this handle as Actionable.

    • @r A Actionable object.
  • asBuildable ()

    Wraps this handle as Buildable.

    • @r A Buildable object.
  • asConstraintTarget ()

    Wraps this handle as ConstraintTarget.

    • @r A ConstraintTarget object.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnActivate (callback Fn, UserData = null)

    Emitted to when the check button is activated. The ::activate signal on GtkCheckButton is an action signal and emitting it causes the button to animate press then release. Applications should never connect to this signal, but use the [signal@Gtk.CheckButton::toggled] signal. The default bindings for this signal are all forms of the and Enter keys.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (CheckButton Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnToggled (callback Fn, UserData = null)

    Emitted when the buttons's [property@Gtk.CheckButton:active] property changes.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (CheckButton Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setActive (bool Value)

    If the check button is active. Setting active to %TRUE will add the :checked: state to both the check button and the indicator CSS node.

    • @p Value is the new property value.
    • @r None.
  • setChild (object Value)

    The child widget.

    • @p Value is the new property value.
    • @r None.
  • setGroup (object Value)

    The check button whose group this widget belongs to.

    • @p Value is the new property value.
    • @r None.
  • setInconsistent (bool Value)

    If the check button is in an “in between” state. The inconsistent state only affects visual appearance, not the semantics of the button.

    • @p Value is the new property value.
    • @r None.
  • setLabel (string Value)

    Text of the label inside the check button, if it contains a label widget.

    • @p Value is the new property value.
    • @r None.
  • setUseunderline (bool Value)

    If set, an underline in the text indicates that the following character is to be used as mnemonic.

    • @p Value is the new property value.
    • @r None.
  • get_active ()

    Returns whether the check button is active.

  • get_child ()

    Gets the child widget of @button or NULL if [property@CheckButton:label] is set.

  • get_inconsistent ()

    Returns whether the check button is in an inconsistent state.

  • get_label ()

    Returns the label of the check button or NULL if [property@CheckButton:child] is set.

  • get_use_underline ()

    Returns whether underlines in the label indicate mnemonics.

  • set_active (bool setting)

    Changes the check buttons active state.

    • @p setting is the new value to set.
    • @r None.
  • set_child (object child)

    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.

    • @p child is the child widget.
    • @r None.
  • set_group (object group)

    Adds @self to the group of @group. In a group of multiple check buttons, only one button can be active at a time. The behavior of a checkbutton in a group is also commonly known as a radio button. Setting the group of a check button also changes the css name of the indicator widget's CSS node to 'radio'. Setting up groups in a cycle leads to undefined behavior. Note that the same effect can be achieved via the [iface@Gtk.Actionable] API, by using the same action with parameter type and state type 's' for all buttons in the group, and giving each button its own target value.

    • @p group is another GtkCheckButton to form a group with.
    • @r None.
  • set_inconsistent (bool inconsistent)

    Sets the GtkCheckButton to inconsistent state. You should turn off the inconsistent state again if the user checks the check button. This has to be done manually.

    • @p inconsistent is %TRUE if state is inconsistent.
    • @r None.
  • set_label (string label)

    Sets the text of @self. If [property@Gtk.CheckButton:use-underline] is %TRUE, an underscore in @label is interpreted as mnemonic indicator, see [method@Gtk.CheckButton.set_use_underline] for details on this behavior.

    • @p label is The text shown next to the indicator, or %NULL to show no text.
    • @r None.
  • set_use_underline (bool setting)

    Sets whether underlines in the label indicate mnemonics. If @setting is %TRUE, an underscore character in @self's label indicates a mnemonic accelerator key. This behavior is similar to [property@Gtk.Label:use-underline].

    • @p setting is the new value to set.
    • @r None.