Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Adjustment

[18:7] extends: object

A model for a numeric value. The GtkAdjustment has an associated lower and upper bound. It also contains step and page increments, and a page size. Adjustments are used within several GTK widgets, including [class@Gtk.SpinButton], [class@Gtk.Viewport], [class@Gtk.Scrollbar] and [class@Gtk.Scale]. The GtkAdjustment object does not update the value itself. Instead it is left up to the owner of the GtkAdjustment to control the value.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Adjustment (value = null, lower = null, upper = null, step_increment = null, page_increment = null, page_size = null)

    Creates a new GtkAdjustment.

    • @p value is the initial value.
    • @p lower is the minimum value.
    • @p upper is the maximum value.
    • @p step_increment is the step increment.
    • @p page_increment is the page increment.
    • @p page_size is the page size.
  • 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.
  • asInitiallyUnowned ()

    Wraps this handle as InitiallyUnowned.

    • @r A InitiallyUnowned 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.
  • setOnChanged (callback Fn, UserData = null)

    Emitted when one or more of the GtkAdjustment properties have been changed. Note that the [property@Gtk.Adjustment:value] property is covered by the [signal@Gtk.Adjustment::value-changed] signal.

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

    Emitted when the value has been changed.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (Adjustment 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.

  • setLower (double Value)

    The minimum value of the adjustment.

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

    The page increment of the adjustment.

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

    The page size of the adjustment. Note that the page-size is irrelevant and should be set to zero if the adjustment is used for a simple scalar value, e.g. in a GtkSpinButton.

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

    The step increment of the adjustment.

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

    The maximum value of the adjustment. Note that values will be restricted by upper - page-size if the page-size property is nonzero.

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

    The value of the adjustment.

    • @p Value is the new property value.
    • @r None.
  • clamp_page (double lower, double upper)

    Updates the value of the adjustment to ensure that the given range is contained in the current page. The current page goes from value to value + page-size. If the range is larger than the page size, then only the start of it will be in the current page. A [signal@Gtk.Adjustment::value-changed] signal will be emitted if the value is changed.

    • @p lower is the lower value.
    • @p upper is the upper value.
    • @r None.
  • configure (double value, double lower, double upper, double step_increment, double page_increment, double page_size)

    Sets all properties of the adjustment at once. Use this function to avoid multiple emissions of the [signal@Gtk.Adjustment::changed] signal. See [method@Gtk.Adjustment.set_lower] for an alternative way of compressing multiple emissions of [signal@Gtk.Adjustment::changed] into one.

    • @p value is the new value.
    • @p lower is the new minimum value.
    • @p upper is the new maximum value.
    • @p step_increment is the new step increment.
    • @p page_increment is the new page increment.
    • @p page_size is the new page size.
    • @r None.
  • get_lower ()

    Retrieves the minimum value of the adjustment.

  • get_minimum_increment ()

    Gets the smaller of step increment and page increment.

  • get_page_increment ()

    Retrieves the page increment of the adjustment.

  • get_page_size ()

    Retrieves the page size of the adjustment.

  • get_step_increment ()

    Retrieves the step increment of the adjustment.

  • get_upper ()

    Retrieves the maximum value of the adjustment.

  • get_value ()

    Gets the current value of the adjustment.

  • set_lower (double lower)

    Sets the minimum value of the adjustment. When setting multiple adjustment properties via their individual setters, multiple [signal@Gtk.Adjustment::changed] signals will be emitted. However, since the emission of the [signal@Gtk.Adjustment::changed] signal is tied to the emission of the ::notify signals of the changed properties, it’s possible to compress the [signal@Gtk.Adjustment::changed] signals into one by calling g_object_freeze_notify() and g_object_thaw_notify() around the calls to the individual setters. Alternatively, using a single g_object_set() for all the properties to change, or using [method@Gtk.Adjustment.configure] has the same effect.

    • @p lower is the new minimum value.
    • @r None.
  • set_page_increment (double page_increment)

    Sets the page increment of the adjustment. See [method@Gtk.Adjustment.set_lower] about how to compress multiple emissions of the [signal@Gtk.Adjustment::changed] signal when setting multiple adjustment properties.

    • @p page_increment is the new page increment.
    • @r None.
  • set_page_size (double page_size)

    Sets the page size of the adjustment. See [method@Gtk.Adjustment.set_lower] about how to compress multiple emissions of the [signal@Gtk.Adjustment::changed] signal when setting multiple adjustment properties.

    • @p page_size is the new page size.
    • @r None.
  • set_step_increment (double step_increment)

    Sets the step increment of the adjustment. See [method@Gtk.Adjustment.set_lower] about how to compress multiple emissions of the [signal@Gtk.Adjustment::changed] signal when setting multiple adjustment properties.

    • @p step_increment is the new step increment.
    • @r None.
  • set_upper (double upper)

    Sets the maximum value of the adjustment. Note that values will be restricted by upper - page-size if the page-size property is nonzero. See [method@Gtk.Adjustment.set_lower] about how to compress multiple emissions of the [signal@Gtk.Adjustment::changed] signal when setting multiple adjustment properties.

    • @p upper is the new maximum value.
    • @r None.
  • set_value (double value)

    Sets the GtkAdjustment value. The value is clamped to lie between [property@Gtk.Adjustment:lower] and [property@Gtk.Adjustment:upper]. Note that for adjustments which are used in a GtkScrollbar, the effective range of allowed values goes from [property@Gtk.Adjustment:lower] to [property@Gtk.Adjustment:upper] - [property@Gtk.Adjustment:page-size].

    • @p value is the new value.
    • @r None.

class: AdjustmentMeta

[605:14] static extends: object

Generated metadata helpers for Adjustment class surfaces.

Methods

  • properties ()

    Returns property metadata for Adjustment.

    • @r A list.
  • signals ()

    Returns signal metadata for Adjustment.

    • @r A list.

class: AdjustmentValuechangedCallback

[535:7] extends: object

Generated low-level callback wrapper for GIR callback value-changed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • AdjustmentValuechangedCallback (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: AdjustmentChangedCallback

[465:7] extends: object

Generated low-level callback wrapper for GIR callback changed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • AdjustmentChangedCallback (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.