WidgetProtocol

public protocol WidgetProtocol : InitiallyUnownedProtocol, AccessibleProtocol, BuildableProtocol, ConstraintTargetProtocol

The base class for all widgets.

GtkWidget is the base class all widgets in GTK derive from. It manages the widget lifecycle, layout, states and style.

Height-for-width Geometry Management

GTK uses a height-for-width (and width-for-height) geometry management system. Height-for-width means that a widget can change how much vertical space it needs, depending on the amount of horizontal space that it is given (and similar for width-for-height). The most common example is a label that reflows to fill up the available width, wraps to fewer lines, and therefore needs less height.

Height-for-width geometry management is implemented in GTK by way of two virtual methods:

  • [vfuncGtk.Widget.get_request_mode]
  • [vfuncGtk.Widget.measure]

There are some important things to keep in mind when implementing height-for-width and when using it in widget implementations.

If you implement a direct GtkWidget subclass that supports height-for-width or width-for-height geometry management for itself or its child widgets, the [vfuncGtk.Widget.get_request_mode] virtual function must be implemented as well and return the widget’s preferred request mode. The default implementation of this virtual function returns GTK_SIZE_REQUEST_CONSTANT_SIZE, which means that the widget will only ever get -1 passed as the for_size value to its [vfuncGtk.Widget.measure] implementation.

The geometry management system will query a widget hierarchy in only one orientation at a time. When widgets are initially queried for their minimum sizes it is generally done in two initial passes in the [enumGtk.SizeRequestMode] chosen by the toplevel.

For example, when queried in the normal GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH mode:

First, the default minimum and natural width for each widget in the interface will be computed using [idgtk_widget_measure] with an orientation of GTK_ORIENTATION_HORIZONTAL and a for_size of -1. Because the preferred widths for each widget depend on the preferred widths of their children, this information propagates up the hierarchy, and finally a minimum and natural width is determined for the entire toplevel. Next, the toplevel will use the minimum width to query for the minimum height contextual to that width using [idgtk_widget_measure] with an orientation of GTK_ORIENTATION_VERTICAL and a for_size of the just computed width. This will also be a highly recursive operation. The minimum height for the minimum width is normally used to set the minimum size constraint on the toplevel.

After the toplevel window has initially requested its size in both dimensions it can go on to allocate itself a reasonable size (or a size previously specified with [methodGtk.Window.set_default_size]). During the recursive allocation process it’s important to note that request cycles will be recursively executed while widgets allocate their children. Each widget, once allocated a size, will go on to first share the space in one orientation among its children and then request each child’s height for its target allocated width or its width for allocated height, depending. In this way a GtkWidget will typically be requested its size a number of times before actually being allocated a size. The size a widget is finally allocated can of course differ from the size it has requested. For this reason, GtkWidget caches a small number of results to avoid re-querying for the same sizes in one allocation cycle.

If a widget does move content around to intelligently use up the allocated size then it must support the request in both GtkSizeRequestModes even if the widget in question only trades sizes in a single orientation.

For instance, a [classGtk.Label] that does height-for-width word wrapping will not expect to have [vfuncGtk.Widget.measure] with an orientation of GTK_ORIENTATION_VERTICAL called because that call is specific to a width-for-height request. In this case the label must return the height required for its own minimum possible width. By following this rule any widget that handles height-for-width or width-for-height requests will always be allocated at least enough space to fit its own content.

Here are some examples of how a GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH widget generally deals with width-for-height requests:

static void
foo_widget_measure (GtkWidget      *widget,
                    GtkOrientation  orientation,
                    int             for_size,
                    int            *minimum_size,
                    int            *natural_size,
                    int            *minimum_baseline,
                    int            *natural_baseline)
{
  if (orientation == GTK_ORIENTATION_HORIZONTAL)
    {
      // Calculate minimum and natural width
    }
  else // VERTICAL
    {
      if (i_am_in_height_for_width_mode)
        {
          int min_width, dummy;

          // First, get the minimum width of our widget
          GTK_WIDGET_GET_CLASS (widget)->measure (widget, GTK_ORIENTATION_HORIZONTAL, -1,
                                                  &min_width, &dummy, &dummy, &dummy);

          // Now use the minimum width to retrieve the minimum and natural height to display
          // that width.
          GTK_WIDGET_GET_CLASS (widget)->measure (widget, GTK_ORIENTATION_VERTICAL, min_width,
                                                  minimum_size, natural_size, &dummy, &dummy);
        }
      else
        {
          // ... some widgets do both.
        }
    }
}

Often a widget needs to get its own request during size request or allocation. For example, when computing height it may need to also compute width. Or when deciding how to use an allocation, the widget may need to know its natural size. In these cases, the widget should be careful to call its virtual methods directly, like in the code example above.

It will not work to use the wrapper function [methodGtk.Widget.measure] inside your own [vfuncGtk.Widget.size_allocate] implementation. These return a request adjusted by [classGtk.SizeGroup], the widget’s align and expand flags, as well as its CSS style.

If a widget used the wrappers inside its virtual method implementations, then the adjustments (such as widget margins) would be applied twice. GTK therefore does not allow this and will warn if you try to do it.

Of course if you are getting the size request for another widget, such as a child widget, you must use [idgtk_widget_measure]; otherwise, you would not properly consider widget margins, [classGtk.SizeGroup], and so forth.

GTK also supports baseline vertical alignment of widgets. This means that widgets are positioned such that the typographical baseline of widgets in the same row are aligned. This happens if a widget supports baselines, has a vertical alignment of GTK_ALIGN_BASELINE, and is inside a widget that supports baselines and has a natural “row” that it aligns to the baseline, or a baseline assigned to it by the grandparent.

Baseline alignment support for a widget is also done by the [vfuncGtk.Widget.measure] virtual function. It allows you to report both a minimum and natural size.

If a widget ends up baseline aligned it will be allocated all the space in the parent as if it was GTK_ALIGN_FILL, but the selected baseline can be found via [idgtk_widget_get_allocated_baseline]. If the baseline has a value other than -1 you need to align the widget such that the baseline appears at the position.

GtkWidget as GtkBuildable

The GtkWidget implementation of the GtkBuildable interface supports various custom elements to specify additional aspects of widgets that are not directly expressed as properties.

If the widget uses a [classGtk.LayoutManager], GtkWidget supports a custom <layout> element, used to define layout properties:

<object class="GtkGrid" id="my_grid">
  <child>
    <object class="GtkLabel" id="label1">
      <property name="label">Description</property>
      <layout>
        <property name="column">0</property>
        <property name="row">0</property>
        <property name="row-span">1</property>
        <property name="column-span">1</property>
      </layout>
    </object>
  </child>
  <child>
    <object class="GtkEntry" id="description_entry">
      <layout>
        <property name="column">1</property>
        <property name="row">0</property>
        <property name="row-span">1</property>
        <property name="column-span">1</property>
      </layout>
    </object>
  </child>
</object>

GtkWidget allows style information such as style classes to be associated with widgets, using the custom <style> element:

<object class="GtkButton" id="button1">
  <style>
    <class name="my-special-button-class"/>
    <class name="dark-button"/>
  </style>
</object>

GtkWidget allows defining accessibility information, such as properties, relations, and states, using the custom <accessibility> element:

<object class="GtkButton" id="button1">
  <accessibility>
    <property name="label">Download</property>
    <relation name="labelled-by">label1</relation>
  </accessibility>
</object>

Building composite widgets from template XML

GtkWidgetexposes some facilities to automate the procedure of creating composite widgets using “templates”.

To create composite widgets with GtkBuilder XML, one must associate the interface description with the widget class at class initialization time using [methodGtk.WidgetClass.set_template].

The interface description semantics expected in composite template descriptions is slightly different from regular [classGtk.Builder] XML.

Unlike regular interface descriptions, [methodGtk.WidgetClass.set_template] will expect a <template> tag as a direct child of the toplevel <interface> tag. The <template> tag must specify the “class” attribute which must be the type name of the widget. Optionally, the “parent” attribute may be specified to specify the direct parent type of the widget type, this is ignored by GtkBuilder but required for UI design tools like Glade to introspect what kind of properties and internal children exist for a given type when the actual type does not exist.

The XML which is contained inside the <template> tag behaves as if it were added to the <object> tag defining the widget itself. You may set properties on a widget by inserting <property> tags into the <template> tag, and also add <child> tags to add children and extend a widget in the normal way you would with <object> tags.

Additionally, <object> tags can also be added before and after the initial <template> tag in the normal way, allowing one to define auxiliary objects which might be referenced by other widgets declared as children of the <template> tag.

An example of a template definition:

<interface>
  <template class="FooWidget" parent="GtkBox">
    <property name="orientation">horizontal</property>
    <property name="spacing">4</property>
    <child>
      <object class="GtkButton" id="hello_button">
        <property name="label">Hello World</property>
        <signal name="clicked" handler="hello_button_clicked" object="FooWidget" swapped="yes"/>
      </object>
    </child>
    <child>
      <object class="GtkButton" id="goodbye_button">
        <property name="label">Goodbye World</property>
      </object>
    </child>
  </template>
</interface>

Typically, you’ll place the template fragment into a file that is bundled with your project, using GResource. In order to load the template, you need to call [methodGtk.WidgetClass.set_template_from_resource] from the class initialization of your GtkWidget type:

static void
foo_widget_class_init (FooWidgetClass *klass)
{
  // ...

  gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
                                               "/com/example/ui/foowidget.ui");
}

You will also need to call [methodGtk.Widget.init_template] from the instance initialization function:

static void
foo_widget_init (FooWidget *self)
{
  // ...
  gtk_widget_init_template (GTK_WIDGET (self));
}

You can access widgets defined in the template using the [idgtk_widget_get_template_child] function, but you will typically declare a pointer in the instance private data structure of your type using the same name as the widget in the template definition, and call methodGtk.WidgetClass.bind_template_child_full with that name, e.g.

typedef struct {
  GtkWidget *hello_button;
  GtkWidget *goodbye_button;
} FooWidgetPrivate;

G_DEFINE_TYPE_WITH_PRIVATE (FooWidget, foo_widget, GTK_TYPE_BOX)

static void
foo_widget_class_init (FooWidgetClass *klass)
{
  // ...
  gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
                                               "/com/example/ui/foowidget.ui");
  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass),
                                                FooWidget, hello_button);
  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass),
                                                FooWidget, goodbye_button);
}

static void
foo_widget_init (FooWidget *widget)
{

}

You can also use methodGtk.WidgetClass.bind_template_callback_full to connect a signal callback defined in the template with a function visible in the scope of the class, e.g.

// the signal handler has the instance and user data swapped
// because of the swapped="yes" attribute in the template XML
static void
hello_button_clicked (FooWidget *self,
                      GtkButton *button)
{
  g_print ("Hello, world!\n");
}

static void
foo_widget_class_init (FooWidgetClass *klass)
{
  // ...
  gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
                                               "/com/example/ui/foowidget.ui");
  gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (klass), hello_button_clicked);
}

The WidgetProtocol protocol exposes the methods and properties of an underlying GtkWidget instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see Widget. Alternatively, use WidgetRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkWidget instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • widget_ptr Default implementation

    Typed pointer to the underlying GtkWidget instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkWidget instance.

    Declaration

    Swift

    var widget_ptr: UnsafeMutablePointer<GtkWidget>! { get }
  • Required Initialiser for types conforming to WidgetProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

Widget Class

  • Bind a WidgetPropertyName source property to a given target object.

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: WidgetPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol

    Parameters

    source_property

    the source property to bind

    target

    the target object to bind to

    target_property

    the target property to bind to

    flags

    the flags to pass to the Binding

    transform_from

    ValueTransformer to use for forward transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return Value

    binding reference or nil in case of an error

  • get(property:) Extension method

    Get the value of a Widget property

    Declaration

    Swift

    @inlinable
    func get(property: WidgetPropertyName) -> GLibObject.Value

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

  • set(property:value:) Extension method

    Set the value of a Widget property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

    @inlinable
    func set(property: WidgetPropertyName, value v: GLibObject.Value)

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

Widget signals

  • Connect a Swift signal handler to the given, typed WidgetSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: WidgetSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    handler

    The Swift signal handler (function or callback) to invoke on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • Connect a C signal handler to the given, typed WidgetSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: WidgetSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    signalHandler

    The C function to be called on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • onDestroy(flags:handler:) Extension method

    Signals that all holders of a reference to the widget should release the reference that they hold.

    May result in finalization of the widget if all references are released.

    This signal is not suitable for saving widget state.

    Note

    This represents the underlying destroy signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onDestroy(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the destroy signal is emitted

  • destroySignal Extension method

    Typed destroy signal for using the connect(signal:) methods

    Declaration

    Swift

    static var destroySignal: WidgetSignalName { get }
  • Emitted when the text direction of a widget changes.

    Note

    This represents the underlying direction-changed signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onDirectionChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ previousDirection: TextDirection) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    previousDirection

    the previous text direction of widget

    handler

    The signal handler to call Run the given callback whenever the directionChanged signal is emitted

  • directionChangedSignal Extension method

    Typed direction-changed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var directionChangedSignal: WidgetSignalName { get }
  • onHide(flags:handler:) Extension method

    Emitted when widget is hidden.

    Note

    This represents the underlying hide signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onHide(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the hide signal is emitted

  • hideSignal Extension method

    Typed hide signal for using the connect(signal:) methods

    Declaration

    Swift

    static var hideSignal: WidgetSignalName { get }
  • Emitted if keyboard navigation fails.

    See [methodGtk.Widget.keynav_failed] for details.

    Note

    This represents the underlying keynav-failed signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onKeynavFailed(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ direction: DirectionType) -> Bool) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    direction

    the direction of movement

    handler

    true if stopping keyboard navigation is fine, false if the emitting widget should try to handle the keyboard navigation attempt in its parent widget(s). Run the given callback whenever the keynavFailed signal is emitted

  • keynavFailedSignal Extension method

    Typed keynav-failed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var keynavFailedSignal: WidgetSignalName { get }
  • onMap(flags:handler:) Extension method

    Emitted when widget is going to be mapped.

    A widget is mapped when the widget is visible (which is controlled with [propertyGtk.Widget:visible]) and all its parents up to the toplevel widget are also visible.

    The map signal can be used to determine whether a widget will be drawn, for instance it can resume an animation that was stopped during the emission of [signalGtk.Widget::unmap].

    Note

    This represents the underlying map signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onMap(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the map signal is emitted

  • mapSignal Extension method

    Typed map signal for using the connect(signal:) methods

    Declaration

    Swift

    static var mapSignal: WidgetSignalName { get }
  • Emitted when a widget is activated via a mnemonic.

    The default handler for this signal activates widget if group_cycling is false, or just makes widget grab focus if group_cycling is true.

    Note

    This represents the underlying mnemonic-activate signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onMnemonicActivate(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ groupCycling: Bool) -> Bool) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    groupCycling

    true if there are other widgets with the same mnemonic

    handler

    true to stop other handlers from being invoked for the event. false to propagate the event further. Run the given callback whenever the mnemonicActivate signal is emitted

  • mnemonicActivateSignal Extension method

    Typed mnemonic-activate signal for using the connect(signal:) methods

    Declaration

    Swift

    static var mnemonicActivateSignal: WidgetSignalName { get }
  • onMoveFocus(flags:handler:) Extension method

    Emitted when the focus is moved.

    Note

    This represents the underlying move-focus signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onMoveFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ direction: DirectionType) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    direction

    the direction of the focus move

    handler

    The signal handler to call Run the given callback whenever the moveFocus signal is emitted

  • moveFocusSignal Extension method

    Typed move-focus signal for using the connect(signal:) methods

    Declaration

    Swift

    static var moveFocusSignal: WidgetSignalName { get }
  • Emitted when the widgets tooltip is about to be shown.

    This happens when the [propertyGtk.Widget:has-tooltip] property is true and the hover timeout has expired with the cursor hovering “above” widget; or emitted when widget got focus in keyboard mode.

    Using the given coordinates, the signal handler should determine whether a tooltip should be shown for widget. If this is the case true should be returned, false otherwise. Note that if keyboard_mode is true, the values of x and y are undefined and should not be used.

    The signal handler is free to manipulate tooltip with the therefore destined function calls.

    Note

    This represents the underlying query-tooltip signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onQueryTooltip(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ x: Int, _ y: Int, _ keyboardMode: Bool, _ tooltip: TooltipRef) -> Bool) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    x

    the x coordinate of the cursor position where the request has been emitted, relative to widget‘s left side

    y

    the y coordinate of the cursor position where the request has been emitted, relative to widget‘s top

    keyboardMode

    true if the tooltip was triggered using the keyboard

    tooltip

    a GtkTooltip

    handler

    true if tooltip should be shown right now, false otherwise. Run the given callback whenever the queryTooltip signal is emitted

  • queryTooltipSignal Extension method

    Typed query-tooltip signal for using the connect(signal:) methods

    Declaration

    Swift

    static var queryTooltipSignal: WidgetSignalName { get }
  • onRealize(flags:handler:) Extension method

    Emitted when widget is associated with a GdkSurface.

    This means that [methodGtk.Widget.realize] has been called or the widget has been mapped (that is, it is going to be drawn).

    Note

    This represents the underlying realize signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onRealize(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the realize signal is emitted

  • realizeSignal Extension method

    Typed realize signal for using the connect(signal:) methods

    Declaration

    Swift

    static var realizeSignal: WidgetSignalName { get }
  • onShow(flags:handler:) Extension method

    Emitted when widget is shown.

    Note

    This represents the underlying show signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onShow(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the show signal is emitted

  • showSignal Extension method

    Typed show signal for using the connect(signal:) methods

    Declaration

    Swift

    static var showSignal: WidgetSignalName { get }
  • Emitted when the widget state changes.

    See [methodGtk.Widget.get_state_flags].

    Note

    This represents the underlying state-flags-changed signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onStateFlagsChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ flags: StateFlags) -> Void) -> Int

    Parameters

    flags

    The previous state flags.

    unownedSelf

    Reference to instance of self

    flags

    The previous state flags.

    handler

    The signal handler to call Run the given callback whenever the stateFlagsChanged signal is emitted

  • stateFlagsChangedSignal Extension method

    Typed state-flags-changed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var stateFlagsChangedSignal: WidgetSignalName { get }
  • onUnmap(flags:handler:) Extension method

    Emitted when widget is going to be unmapped.

    A widget is unmapped when either it or any of its parents up to the toplevel widget have been set as hidden.

    As unmap indicates that a widget will not be shown any longer, it can be used to, for example, stop an animation on the widget.

    Note

    This represents the underlying unmap signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onUnmap(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the unmap signal is emitted

  • unmapSignal Extension method

    Typed unmap signal for using the connect(signal:) methods

    Declaration

    Swift

    static var unmapSignal: WidgetSignalName { get }
  • onUnrealize(flags:handler:) Extension method

    Emitted when the GdkSurface associated with widget is destroyed.

    This means that [methodGtk.Widget.unrealize] has been called or the widget has been unmapped (that is, it is going to be hidden).

    Note

    This represents the underlying unrealize signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onUnrealize(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the unrealize signal is emitted

  • unrealizeSignal Extension method

    Typed unrealize signal for using the connect(signal:) methods

    Declaration

    Swift

    static var unrealizeSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::can-focus signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyCanFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyCanFocus signal is emitted

  • notifyCanFocusSignal Extension method

    Typed notify::can-focus signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyCanFocusSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::can-target signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyCanTarget(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyCanTarget signal is emitted

  • notifyCanTargetSignal Extension method

    Typed notify::can-target signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyCanTargetSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::css-classes signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyCssClasses(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyCssClasses signal is emitted

  • notifyCssClassesSignal Extension method

    Typed notify::css-classes signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyCssClassesSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::css-name signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyCssName(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyCssName signal is emitted

  • notifyCssNameSignal Extension method

    Typed notify::css-name signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyCssNameSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::cursor signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyCursor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyCursor signal is emitted

  • notifyCursorSignal Extension method

    Typed notify::cursor signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyCursorSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::focus-on-click signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyFocusOnClick(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyFocusOnClick signal is emitted

  • notifyFocusOnClickSignal Extension method

    Typed notify::focus-on-click signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyFocusOnClickSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::focusable signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyFocusable(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyFocusable signal is emitted

  • notifyFocusableSignal Extension method

    Typed notify::focusable signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyFocusableSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::halign signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyHalign(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyHalign signal is emitted

  • notifyHalignSignal Extension method

    Typed notify::halign signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyHalignSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::has-default signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyHasDefault(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyHasDefault signal is emitted

  • notifyHasDefaultSignal Extension method

    Typed notify::has-default signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyHasDefaultSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::has-focus signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyHasFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyHasFocus signal is emitted

  • notifyHasFocusSignal Extension method

    Typed notify::has-focus signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyHasFocusSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::has-tooltip signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyHasTooltip(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyHasTooltip signal is emitted

  • notifyHasTooltipSignal Extension method

    Typed notify::has-tooltip signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyHasTooltipSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::height-request signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyHeightRequest(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyHeightRequest signal is emitted

  • notifyHeightRequestSignal Extension method

    Typed notify::height-request signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyHeightRequestSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::hexpand signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyHexpand(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyHexpand signal is emitted

  • notifyHexpandSignal Extension method

    Typed notify::hexpand signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyHexpandSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::hexpand-set signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyHexpandSet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyHexpandSet signal is emitted

  • notifyHexpandSetSignal Extension method

    Typed notify::hexpand-set signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyHexpandSetSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::layout-manager signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyLayoutManager(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyLayoutManager signal is emitted

  • notifyLayoutManagerSignal Extension method

    Typed notify::layout-manager signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyLayoutManagerSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::margin-bottom signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyMarginBottom(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyMarginBottom signal is emitted

  • notifyMarginBottomSignal Extension method

    Typed notify::margin-bottom signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyMarginBottomSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::margin-end signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyMarginEnd(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyMarginEnd signal is emitted

  • notifyMarginEndSignal Extension method

    Typed notify::margin-end signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyMarginEndSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::margin-start signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyMarginStart(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyMarginStart signal is emitted

  • notifyMarginStartSignal Extension method

    Typed notify::margin-start signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyMarginStartSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::margin-top signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyMarginTop(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyMarginTop signal is emitted

  • notifyMarginTopSignal Extension method

    Typed notify::margin-top signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyMarginTopSignal: WidgetSignalName { get }
  • onNotifyName(flags:handler:) Extension method

    The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::name signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyName(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyName signal is emitted

  • notifyNameSignal Extension method

    Typed notify::name signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyNameSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::opacity signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyOpacity(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyOpacity signal is emitted

  • notifyOpacitySignal Extension method

    Typed notify::opacity signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyOpacitySignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::overflow signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyOverflow(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyOverflow signal is emitted

  • notifyOverflowSignal Extension method

    Typed notify::overflow signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyOverflowSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::parent signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyParent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyParent signal is emitted

  • notifyParentSignal Extension method

    Typed notify::parent signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyParentSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::receives-default signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyReceivesDefault(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyReceivesDefault signal is emitted

  • notifyReceivesDefaultSignal Extension method

    Typed notify::receives-default signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyReceivesDefaultSignal: WidgetSignalName { get }
  • onNotifyRoot(flags:handler:) Extension method

    The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::root signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyRoot(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyRoot signal is emitted

  • notifyRootSignal Extension method

    Typed notify::root signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyRootSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::scale-factor signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyScaleFactor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyScaleFactor signal is emitted

  • notifyScaleFactorSignal Extension method

    Typed notify::scale-factor signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyScaleFactorSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::sensitive signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifySensitive(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifySensitive signal is emitted

  • notifySensitiveSignal Extension method

    Typed notify::sensitive signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifySensitiveSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::tooltip-markup signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyTooltipMarkup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyTooltipMarkup signal is emitted

  • notifyTooltipMarkupSignal Extension method

    Typed notify::tooltip-markup signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyTooltipMarkupSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::tooltip-text signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyTooltipText(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyTooltipText signal is emitted

  • notifyTooltipTextSignal Extension method

    Typed notify::tooltip-text signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyTooltipTextSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::valign signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyValign(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyValign signal is emitted

  • notifyValignSignal Extension method

    Typed notify::valign signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyValignSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::vexpand signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyVexpand(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyVexpand signal is emitted

  • notifyVexpandSignal Extension method

    Typed notify::vexpand signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyVexpandSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::vexpand-set signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyVexpandSet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyVexpandSet signal is emitted

  • notifyVexpandSetSignal Extension method

    Typed notify::vexpand-set signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyVexpandSetSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::visible signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyVisible(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyVisible signal is emitted

  • notifyVisibleSignal Extension method

    Typed notify::visible signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyVisibleSignal: WidgetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::width-request signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyWidthRequest(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyWidthRequest signal is emitted

  • notifyWidthRequestSignal Extension method

    Typed notify::width-request signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyWidthRequestSignal: WidgetSignalName { get }

Widget Class: WidgetProtocol extension (methods and fields)

  • Enable or disable an action installed with gtk_widget_class_install_action().

    Declaration

    Swift

    @inlinable
    func actionSetEnabled(actionName: UnsafePointer<CChar>!, enabled: Bool)
  • activate() Extension method

    For widgets that can be “activated” (buttons, menu items, etc.), this function activates them.

    The activation will emit the signal set using [methodGtk.WidgetClass.set_activate_signal] during class initialization.

    Activation is what happens when you press <kbd>Enter</kbd> on a widget during key navigation.

    If you wish to handle the activation keybinding yourself, it is recommended to use [methodGtk.WidgetClass.add_shortcut] with an action created with [ctorGtk.SignalAction.new].

    If widget isn’t activatable, the function returns false.

    Declaration

    Swift

    @inlinable
    func activate() -> Bool
  • Looks up the action in the action groups associated with widget and its ancestors, and activates it.

    If the action is in an action group added with [methodGtk.Widget.insert_action_group], the name is expected to be prefixed with the prefix that was used when the group was inserted.

    The arguments must match the actions expected parameter type, as returned by g_action_get_parameter_type().

    Declaration

    Swift

    @inlinable
    func activateActionVariant(name: UnsafePointer<CChar>!, args: GLib.VariantRef? = nil) -> Bool
  • Looks up the action in the action groups associated with widget and its ancestors, and activates it.

    If the action is in an action group added with [methodGtk.Widget.insert_action_group], the name is expected to be prefixed with the prefix that was used when the group was inserted.

    The arguments must match the actions expected parameter type, as returned by g_action_get_parameter_type().

    Declaration

    Swift

    @inlinable
    func activateActionVariant<VariantT>(name: UnsafePointer<CChar>!, args: VariantT?) -> Bool where VariantT : VariantProtocol
  • activateDefault() Extension method

    Activates the default.activate action from widget.

    Declaration

    Swift

    @inlinable
    func activateDefault()
  • add(controller:) Extension method

    Adds controller to widget so that it will receive events.

    You will usually want to call this function right after creating any kind of [classGtk.EventController].

    Declaration

    Swift

    @inlinable
    func add<EventControllerT>(controller: EventControllerT) where EventControllerT : EventControllerProtocol
  • add(cssClass:) Extension method

    Adds a style class to widget.

    After calling this function, the widgets style will match for css_class, according to CSS matching rules.

    Use [methodGtk.Widget.remove_css_class] to remove the style again.

    Declaration

    Swift

    @inlinable
    func add(cssClass: UnsafePointer<CChar>!)
  • addMnemonic(label:) Extension method

    Adds a widget to the list of mnemonic labels for this widget.

    See [methodGtk.Widget.list_mnemonic_labels]. Note the list of mnemonic labels for the widget is cleared when the widget is destroyed, so the caller must make sure to update its internal state at this point as well.

    Declaration

    Swift

    @inlinable
    func addMnemonic<WidgetT>(label: WidgetT) where WidgetT : WidgetProtocol
  • Queues an animation frame update and adds a callback to be called before each frame.

    Until the tick callback is removed, it will be called frequently (usually at the frame rate of the output device or as quickly as the application can be repainted, whichever is slower). For this reason, is most suitable for handling graphics that change every frame or every few frames. The tick callback does not automatically imply a relayout or repaint. If you want a repaint or relayout, and aren’t changing widget properties that would trigger that (for example, changing the text of a GtkLabel), then you will have to call [methodGtk.Widget.queue_resize] or [methodGtk.Widget.queue_draw] yourself.

    [methodGdk.FrameClock.get_frame_time] should generally be used for timing continuous animations and [methodGdk.FrameTimings.get_predicted_presentation_time] if you are trying to display isolated frames at particular times.

    This is a more convenient alternative to connecting directly to the [signalGdk.FrameClock::update] signal of GdkFrameClock, since you don’t have to worry about when a GdkFrameClock is assigned to a widget.

    Declaration

    Swift

    @inlinable
    func addTick(callback: GtkTickCallback?, userData: gpointer! = nil, notify: GDestroyNotify?) -> Int
  • This function is only used by GtkWidget subclasses, to assign a size, position and (optionally) baseline to their child widgets.

    In this function, the allocation and baseline may be adjusted. The given allocation will be forced to be bigger than the widget’s minimum size, as well as at least 0×0 in size.

    For a version that does not take a transform, see [methodGtk.Widget.size_allocate].

    Declaration

    Swift

    @inlinable
    func allocate(width: Int, height: Int, baseline: Int, transform: UnsafeMutablePointer<GskTransform>? = nil)
  • childFocus(direction:) Extension method

    Called by widgets as the user moves around the window using keyboard shortcuts.

    The direction argument indicates what kind of motion is taking place (up, down, left, right, tab forward, tab backward).

    This function calls the [vfuncGtk.Widget.focus] virtual function; widgets can override the virtual function in order to implement appropriate focus behavior.

    The default focus() virtual function for a widget should return TRUE if moving in direction left the focus on a focusable location inside that widget, and FALSE if moving in direction moved the focus outside the widget. When returning TRUE, widgets normallycall [methodGtk.Widget.grab_focus] to place the focus accordingly; when returning FALSE, they don’t modify the current focus location.

    This function is used by custom widget implementations; if you’re writing an app, you’d use [methodGtk.Widget.grab_focus] to move the focus to a particular widget.

    Declaration

    Swift

    @inlinable
    func childFocus(direction: GtkDirectionType) -> Bool
  • Computes the bounds for widget in the coordinate space of target.

    FIXME: Explain what “bounds” are.

    If the operation is successful, true is returned. If widget has no bounds or the bounds cannot be expressed in target‘s coordinate space (for example if both widgets are in different windows), false is returned and bounds is set to the zero rectangle.

    It is valid for widget and target to be the same widget.

    Declaration

    Swift

    @inlinable
    func computeBounds<WidgetT>(target: WidgetT, outBounds: UnsafeMutablePointer<graphene_rect_t>!) -> Bool where WidgetT : WidgetProtocol
  • computeExpand(orientation:) Extension method

    Computes whether a container should give this widget extra space when possible.

    Containers should check this, rather than looking at [methodGtk.Widget.get_hexpand] or [methodGtk.Widget.get_vexpand].

    This function already checks whether the widget is visible, so visibility does not need to be checked separately. Non-visible widgets are not expanded.

    The computed expand value uses either the expand setting explicitly set on the widget itself, or, if none has been explicitly set, the widget may expand if some of its children do.

    Declaration

    Swift

    @inlinable
    func computeExpand(orientation: GtkOrientation) -> Bool
  • Translates the given point in widget‘s coordinates to coordinates relative to target’s coordinate system.

    In order to perform this operation, both widgets must share a common ancestor.

    Declaration

    Swift

    @inlinable
    func computePoint<WidgetT>(target: WidgetT, point: UnsafePointer<graphene_point_t>!, outPoint: UnsafeMutablePointer<graphene_point_t>!) -> Bool where WidgetT : WidgetProtocol
  • Computes a matrix suitable to describe a transformation from widget‘s coordinate system into target’s coordinate system.

    The transform can not be computed in certain cases, for example when widget and target do not share a common ancestor. In that case out_transform gets set to the identity matrix.

    Declaration

    Swift

    @inlinable
    func computeTransform<WidgetT>(target: WidgetT, outTransform: UnsafeMutablePointer<graphene_matrix_t>!) -> Bool where WidgetT : WidgetProtocol
  • contains(x:y:) Extension method

    Tests if the point at (x, y) is contained in widget.

    The coordinates for (x, y) must be in widget coordinates, so (0, 0) is assumed to be the top left of widget‘s content area.

    Declaration

    Swift

    @inlinable
    func contains(x: CDouble, y: CDouble) -> Bool
  • createPangoContext() Extension method

    Creates a new PangoContext with the appropriate font map, font options, font description, and base direction for drawing text for this widget.

    See also [methodGtk.Widget.get_pango_context].

    Declaration

    Swift

    @inlinable
    func createPangoContext() -> Pango.ContextRef!
  • createPangoLayout(text:) Extension method

    Creates a new PangoLayout with the appropriate font map, font description, and base direction for drawing text for this widget.

    If you keep a PangoLayout created in this way around, you need to re-create it when the widget PangoContext is replaced. This can be tracked by listening to changes of the [propertyGtk.Widget:root] property on the widget.

    Declaration

    Swift

    @inlinable
    func createPangoLayout(text: UnsafePointer<CChar>? = nil) -> Pango.LayoutRef!
  • Checks to see if a drag movement has passed the GTK drag threshold.

    Declaration

    Swift

    @inlinable
    func dragCheckThreshold(startX: Int, startY: Int, currentX: Int, currentY: Int) -> Bool
  • errorBell() Extension method

    Notifies the user about an input-related error on this widget.

    If the [propertyGtk.Settings:gtk-error-bell] setting is true, it calls [methodGdk.Surface.beep], otherwise it does nothing.

    Note that the effect of [methodGdk.Surface.beep] can be configured in many ways, depending on the windowing backend and the desktop environment or window manager that is used.

    Declaration

    Swift

    @inlinable
    func errorBell()
  • getAllocatedBaseline() Extension method

    Returns the baseline that has currently been allocated to widget.

    This function is intended to be used when implementing handlers for the GtkWidget`Class.snapshot()` function, and when allocating child widgets inGtkWidgetClass.size_allocate().

    Declaration

    Swift

    @inlinable
    func getAllocatedBaseline() -> Int
  • getAllocatedHeight() Extension method

    Returns the height that has currently been allocated to widget.

    Declaration

    Swift

    @inlinable
    func getAllocatedHeight() -> Int
  • getAllocatedWidth() Extension method

    Returns the width that has currently been allocated to widget.

    Declaration

    Swift

    @inlinable
    func getAllocatedWidth() -> Int
  • get(allocation:) Extension method

    Retrieves the widget’s allocation.

    Note, when implementing a layout container: a widget’s allocation will be its “adjusted” allocation, that is, the widget’s parent typically calls [methodGtk.Widget.size_allocate] with an allocation, and that allocation is then adjusted (to handle margin and alignment for example) before assignment to the widget. [methodGtk.Widget.get_allocation] returns the adjusted allocation that was actually assigned to the widget. The adjusted allocation is guaranteed to be completely contained within the [methodGtk.Widget.size_allocate] allocation, however.

    So a layout container is guaranteed that its children stay inside the assigned bounds, but not that they have exactly the bounds the container assigned.

    Declaration

    Swift

    @inlinable
    func get(allocation: UnsafeMutablePointer<GtkAllocation>!)
  • getAncestor(widgetType:) Extension method

    Gets the first ancestor of widget with type widget_type.

    For example, gtk_widget_get_ancestor (widget, GTK_TYPE_BOX) gets the first GtkBox that’s an ancestor of widget. No reference will be added to the returned widget; it should not be unreferenced.

    Note that unlike [methodGtk.Widget.is_ancestor], this function considers widget to be an ancestor of itself.

    Declaration

    Swift

    @inlinable
    func getAncestor(widgetType: GType) -> WidgetRef!
  • getCanFocus() Extension method

    Determines whether the input focus can enter widget or any of its children.

    See [methodGtk.Widget.set_focusable].

    Declaration

    Swift

    @inlinable
    func getCanFocus() -> Bool
  • getCanTarget() Extension method

    Queries whether widget can be the target of pointer events.

    Declaration

    Swift

    @inlinable
    func getCanTarget() -> Bool
  • getChildVisible() Extension method

    Gets the value set with gtk_widget_set_child_visible().

    If you feel a need to use this function, your code probably needs reorganization.

    This function is only useful for container implementations and should never be called by an application.

    Declaration

    Swift

    @inlinable
    func getChildVisible() -> Bool
  • getClipboard() Extension method

    Gets the clipboard object for widget.

    This is a utility function to get the clipboard object for the GdkDisplay that widget is using.

    Note that this function always works, even when widget is not realized yet.

    Declaration

    Swift

    @inlinable
    func getClipboard() -> Gdk.ClipboardRef!
  • getCssClasses() Extension method

    Returns the list of style classes applied to widget.

    Declaration

    Swift

    @inlinable
    func getCssClasses() -> UnsafeMutablePointer<UnsafeMutablePointer<CChar>?>!
  • getCssName() Extension method

    Returns the CSS name that is used for self.

    Declaration

    Swift

    @inlinable
    func getCssName() -> String!
  • getCursor() Extension method

    Queries the cursor set on widget.

    See [methodGtk.Widget.set_cursor] for details.

    Declaration

    Swift

    @inlinable
    func getCursor() -> Gdk.CursorRef!
  • getDirection() Extension method

    Gets the reading direction for a particular widget.

    See [methodGtk.Widget.set_direction].

    Declaration

    Swift

    @inlinable
    func getDirection() -> GtkTextDirection
  • getDisplay() Extension method

    Get the GdkDisplay for the toplevel window associated with this widget.

    This function can only be called after the widget has been added to a widget hierarchy with a GtkWindow at the top.

    In general, you should only create display specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.

    Declaration

    Swift

    @inlinable
    func getDisplay() -> Gdk.DisplayRef!
  • getFirstChild() Extension method

    Returns the widgets first child.

    This API is primarily meant for widget implementations.

    Declaration

    Swift

    @inlinable
    func getFirstChild() -> WidgetRef!
  • getFocusChild() Extension method

    Returns the current focus child of widget.

    Declaration

    Swift

    @inlinable
    func getFocusChild() -> WidgetRef!
  • getFocusOnClick() Extension method

    Returns whether the widget should grab focus when it is clicked with the mouse.

    See [methodGtk.Widget.set_focus_on_click].

    Declaration

    Swift

    @inlinable
    func getFocusOnClick() -> Bool
  • getFocusable() Extension method

    Determines whether widget can own the input focus.

    See [methodGtk.Widget.set_focusable].

    Declaration

    Swift

    @inlinable
    func getFocusable() -> Bool
  • getFontMap() Extension method

    Gets the font map of widget.

    See [methodGtk.Widget.set_font_map].

    Declaration

    Swift

    @inlinable
    func getFontMap() -> Pango.FontMapRef!
  • getFontOptions() Extension method

    Returns the cairo_font_options_t of widget.

    Seee [methodGtk.Widget.set_font_options].

    Declaration

    Swift

    @inlinable
    func getFontOptions() -> Cairo.FontOptionsRef!
  • getFrameClock() Extension method

    Obtains the frame clock for a widget.

    The frame clock is a global “ticker” that can be used to drive animations and repaints. The most common reason to get the frame clock is to call [methodGdk.FrameClock.get_frame_time], in order to get a time to use for animating. For example you might record the start of the animation with an initial value from [methodGdk.FrameClock.get_frame_time], and then update the animation by calling [methodGdk.FrameClock.get_frame_time] again during each repaint.

    [methodGdk.FrameClock.request_phase] will result in a new frame on the clock, but won’t necessarily repaint any widgets. To repaint a widget, you have to use [methodGtk.Widget.queue_draw] which invalidates the widget (thus scheduling it to receive a draw on the next frame). gtk_widget_queue_draw() will also end up requesting a frame on the appropriate frame clock.

    A widget’s frame clock will not change while the widget is mapped. Reparenting a widget (which implies a temporary unmap) can change the widget’s frame clock.

    Unrealized widgets do not have a frame clock.

    Declaration

    Swift

    @inlinable
    func getFrameClock() -> Gdk.FrameClockRef!
  • getHalign() Extension method

    Gets the horizontal alignment of widget.

    For backwards compatibility reasons this method will never return GTK_ALIGN_BASELINE, but instead it will convert it to GTK_ALIGN_FILL. Baselines are not supported for horizontal alignment.

    Declaration

    Swift

    @inlinable
    func getHalign() -> GtkAlign
  • getHasTooltip() Extension method

    Returns the current value of the has-tooltip property.

    Declaration

    Swift

    @inlinable
    func getHasTooltip() -> Bool
  • getHeight() Extension method

    Returns the content height of the widget.

    This function returns the height passed to its size-allocate implementation, which is the height you should be using in [vfuncGtk.Widget.snapshot].

    For pointer events, see [methodGtk.Widget.contains].

    Declaration

    Swift

    @inlinable
    func getHeight() -> Int
  • getHexpand() Extension method

    Gets whether the widget would like any available extra horizontal space.

    When a user resizes a GtkWindow, widgets with expand=TRUE generally receive the extra space. For example, a list or scrollable area or document in your window would often be set to expand.

    Containers should use [methodGtk.Widget.compute_expand] rather than this function, to see whether a widget, or any of its children, has the expand flag set. If any child of a widget wants to expand, the parent may ask to expand also.

    This function only looks at the widget’s own hexpand flag, rather than computing whether the entire widget tree rooted at this widget wants to expand.

    Declaration

    Swift

    @inlinable
    func getHexpand() -> Bool
  • getHexpandSet() Extension method

    Gets whether gtk_widget_set_hexpand() has been used to explicitly set the expand flag on this widget.

    If [propertyGtk.Widget:hexpand] property is set, then it overrides any computed expand value based on child widgets. If hexpand is not set, then the expand value depends on whether any children of the widget would like to expand.

    There are few reasons to use this function, but it’s here for completeness and consistency.

    Declaration

    Swift

    @inlinable
    func getHexpandSet() -> Bool
  • getLastChild() Extension method

    Returns the widgets last child.

    This API is primarily meant for widget implementations.

    Declaration

    Swift

    @inlinable
    func getLastChild() -> WidgetRef!
  • getLayoutManager() Extension method

    Retrieves the layout manager used by widget.

    See [methodGtk.Widget.set_layout_manager].

    Declaration

    Swift

    @inlinable
    func getLayoutManager() -> LayoutManagerRef!
  • getMapped() Extension method

    Whether the widget is mapped.

    Declaration

    Swift

    @inlinable
    func getMapped() -> Bool
  • getMarginBottom() Extension method

    Gets the bottom margin of widget.

    Declaration

    Swift

    @inlinable
    func getMarginBottom() -> Int
  • getMarginEnd() Extension method

    Gets the end margin of widget.

    Declaration

    Swift

    @inlinable
    func getMarginEnd() -> Int
  • getMarginStart() Extension method

    Gets the start margin of widget.

    Declaration

    Swift

    @inlinable
    func getMarginStart() -> Int
  • getMarginTop() Extension method

    Gets the top margin of widget.

    Declaration

    Swift

    @inlinable
    func getMarginTop() -> Int
  • getName() Extension method

    Retrieves the name of a widget.

    See [methodGtk.Widget.set_name] for the significance of widget names.

    Declaration

    Swift

    @inlinable
    func getName() -> String!
  • getNative() Extension method

    Returns the nearest GtkNative ancestor of widget.

    This function will return nil if the widget is not contained inside a widget tree with a native ancestor.

    GtkNative widgets will return themselves here.

    Declaration

    Swift

    @inlinable
    func getNative() -> NativeRef!
  • getNextSibling() Extension method

    Returns the widgets next sibling.

    This API is primarily meant for widget implementations.

    Declaration

    Swift

    @inlinable
    func getNextSibling() -> WidgetRef!
  • getOpacity() Extension method

    Fetches the requested opacity for this widget.

    See [methodGtk.Widget.set_opacity].

    Declaration

    Swift

    @inlinable
    func getOpacity() -> CDouble
  • getOverflow() Extension method

    Returns the widgets overflow value.

    Declaration

    Swift

    @inlinable
    func getOverflow() -> GtkOverflow
  • getPangoContext() Extension method

    Gets a PangoContext with the appropriate font map, font description, and base direction for this widget.

    Unlike the context returned by [methodGtk.Widget.create_pango_context], this context is owned by the widget (it can be used until the screen for the widget changes or the widget is removed from its toplevel), and will be updated to match any changes to the widget’s attributes. This can be tracked by listening to changes of the [propertyGtk.Widget:root] property on the widget.

    Declaration

    Swift

    @inlinable
    func getPangoContext() -> Pango.ContextRef!
  • getParent() Extension method

    Returns the parent widget of widget.

    Declaration

    Swift

    @inlinable
    func getParent() -> WidgetRef!
  • Retrieves the minimum and natural size of a widget, taking into account the widget’s preference for height-for-width management.

    This is used to retrieve a suitable size by container widgets which do not impose any restrictions on the child placement. It can be used to deduce toplevel window and menu sizes as well as child widgets in free-form containers such as GtkFixed.

    Handle with care. Note that the natural height of a height-for-width widget will generally be a smaller size than the minimum height, since the required height for the natural width is generally smaller than the required height for the minimum width.

    Use [idgtk_widget_measure] if you want to support baseline alignment.

    Declaration

    Swift

    @inlinable
    func getPreferredSize(minimumSize: RequisitionRef? = nil, naturalSize: RequisitionRef? = nil)
  • Retrieves the minimum and natural size of a widget, taking into account the widget’s preference for height-for-width management.

    This is used to retrieve a suitable size by container widgets which do not impose any restrictions on the child placement. It can be used to deduce toplevel window and menu sizes as well as child widgets in free-form containers such as GtkFixed.

    Handle with care. Note that the natural height of a height-for-width widget will generally be a smaller size than the minimum height, since the required height for the natural width is generally smaller than the required height for the minimum width.

    Use [idgtk_widget_measure] if you want to support baseline alignment.

    Declaration

    Swift

    @inlinable
    func getPreferredSize<RequisitionT>(minimumSize: RequisitionT?, naturalSize: RequisitionT?) where RequisitionT : RequisitionProtocol
  • getPrevSibling() Extension method

    Returns the widgets previous sibling.

    This API is primarily meant for widget implementations.

    Declaration

    Swift

    @inlinable
    func getPrevSibling() -> WidgetRef!
  • getPrimaryClipboard() Extension method

    Gets the primary clipboard of widget.

    This is a utility function to get the primary clipboard object for the GdkDisplay that widget is using.

    Note that this function always works, even when widget is not realized yet.

    Declaration

    Swift

    @inlinable
    func getPrimaryClipboard() -> Gdk.ClipboardRef!
  • getRealized() Extension method

    Determines whether widget is realized.

    Declaration

    Swift

    @inlinable
    func getRealized() -> Bool
  • getReceivesDefault() Extension method

    Determines whether widget is always treated as the default widget within its toplevel when it has the focus, even if another widget is the default.

    See [methodGtk.Widget.set_receives_default].

    Declaration

    Swift

    @inlinable
    func getReceivesDefault() -> Bool
  • getRequestMode() Extension method

    Gets whether the widget prefers a height-for-width layout or a width-for-height layout.

    Single-child widgets generally propagate the preference of their child, more complex widgets need to request something either in context of their children or in context of their allocation capabilities.

    Declaration

    Swift

    @inlinable
    func getRequestMode() -> GtkSizeRequestMode
  • getRoot() Extension method

    Returns the GtkRoot widget of widget.

    This function will return nil if the widget is not contained inside a widget tree with a root widget.

    GtkRoot widgets will return themselves here.

    Declaration

    Swift

    @inlinable
    func getRoot() -> RootRef!
  • getScaleFactor() Extension method

    Retrieves the internal scale factor that maps from window coordinates to the actual device pixels.

    On traditional systems this is 1, on high density outputs, it can be a higher value (typically 2).

    See [methodGdk.Surface.get_scale_factor].

    Declaration

    Swift

    @inlinable
    func getScaleFactor() -> Int
  • getSensitive() Extension method

    Returns the widget’s sensitivity.

    This function returns the value that has been set using [methodGtk.Widget.set_sensitive]).

    The effective sensitivity of a widget is however determined by both its own and its parent widget’s sensitivity. See [methodGtk.Widget.is_sensitive].

    Declaration

    Swift

    @inlinable
    func getSensitive() -> Bool
  • getSettings() Extension method

    Gets the settings object holding the settings used for this widget.

    Note that this function can only be called when the GtkWidget is attached to a toplevel, since the settings object is specific to a particular GdkDisplay. If you want to monitor the widget for changes in its settings, connect to the notifydisplay`` signal.

    Declaration

    Swift

    @inlinable
    func getSettings() -> SettingsRef!
  • getSize(orientation:) Extension method

    Returns the content width or height of the widget.

    Which dimension is returned depends on orientation.

    This is equivalent to calling [methodGtk.Widget.get_width] for GTK_ORIENTATION_HORIZONTAL or [methodGtk.Widget.get_height] for GTK_ORIENTATION_VERTICAL, but can be used when writing orientation-independent code, such as when implementing [ifaceGtk.Orientable] widgets.

    Declaration

    Swift

    @inlinable
    func getSize(orientation: GtkOrientation) -> Int
  • Gets the size request that was explicitly set for the widget using gtk_widget_set_size_request().

    A value of -1 stored in width or height indicates that that dimension has not been set explicitly and the natural requisition of the widget will be used instead. See [methodGtk.Widget.set_size_request]. To get the size a widget will actually request, call [methodGtk.Widget.measure] instead of this function.

    Declaration

    Swift

    @inlinable
    func getSizeRequest(width: UnsafeMutablePointer<gint>! = nil, height: UnsafeMutablePointer<gint>! = nil)
  • getStateFlags() Extension method

    Returns the widget state as a flag set.

    It is worth mentioning that the effective GTK_STATE_FLAG_INSENSITIVE state will be returned, that is, also based on parent insensitivity, even if widget itself is sensitive.

    Also note that if you are looking for a way to obtain the [flagsGtk.StateFlags] to pass to a [classGtk.StyleContext] method, you should look at [methodGtk.StyleContext.get_state].

    Declaration

    Swift

    @inlinable
    func getStateFlags() -> StateFlags
  • getStyleContext() Extension method

    Returns the style context associated to widget.

    The returned object is guaranteed to be the same for the lifetime of widget.

    Declaration

    Swift

    @inlinable
    func getStyleContext() -> StyleContextRef!
  • Fetch an object build from the template XML for widget_type in this widget instance.

    This will only report children which were previously declared with [methodGtk.WidgetClass.bind_template_child_full] or one of its variants.

    This function is only meant to be called for code which is private to the widget_type which declared the child and is meant for language bindings which cannot easily make use of the GObject structure offsets.

    Declaration

    Swift

    @inlinable
    func getTemplateChild(widgetType: GType, name: UnsafePointer<CChar>!) -> GLibObject.ObjectRef!
  • getTooltipMarkup() Extension method

    Gets the contents of the tooltip for widget.

    If the tooltip has not been set using [methodGtk.Widget.set_tooltip_markup], this function returns nil.

    Declaration

    Swift

    @inlinable
    func getTooltipMarkup() -> String!
  • getTooltipText() Extension method

    Gets the contents of the tooltip for widget.

    If the widget‘s tooltip was set using [methodGtk.Widget.set_tooltip_markup], this function will return the escaped text.

    Declaration

    Swift

    @inlinable
    func getTooltipText() -> String!
  • getValign() Extension method

    Gets the vertical alignment of widget.

    Declaration

    Swift

    @inlinable
    func getValign() -> GtkAlign
  • getVexpand() Extension method

    Gets whether the widget would like any available extra vertical space.

    See [methodGtk.Widget.get_hexpand] for more detail.

    Declaration

    Swift

    @inlinable
    func getVexpand() -> Bool
  • getVexpandSet() Extension method

    Gets whether gtk_widget_set_vexpand() has been used to explicitly set the expand flag on this widget.

    See [methodGtk.Widget.get_hexpand_set] for more detail.

    Declaration

    Swift

    @inlinable
    func getVexpandSet() -> Bool
  • getVisible() Extension method

    Determines whether the widget is visible.

    If you want to take into account whether the widget’s parent is also marked as visible, use [methodGtk.Widget.is_visible] instead.

    This function does not check if the widget is obscured in any way.

    See [methodGtk.Widget.set_visible].

    Declaration

    Swift

    @inlinable
    func getVisible() -> Bool
  • getWidth() Extension method

    Returns the content width of the widget.

    This function returns the width passed to its size-allocate implementation, which is the width you should be using in [vfuncGtk.Widget.snapshot].

    For pointer events, see [methodGtk.Widget.contains].

    Declaration

    Swift

    @inlinable
    func getWidth() -> Int
  • grabFocus() Extension method

    Causes widget to have the keyboard focus for the GtkWindow it’s inside.

    If widget is not focusable, or its [vfuncGtk.Widget.grab_focus] implementation cannot transfer the focus to a descendant of widget that is focusable, it will not take focus and false will be returned.

    Calling [methodGtk.Widget.grab_focus] on an already focused widget is allowed, should not have an effect, and return true.

    Declaration

    Swift

    @inlinable
    func grabFocus() -> Bool
  • has(cssClass:) Extension method

    Returns whether css_class is currently applied to widget.

    Declaration

    Swift

    @inlinable
    func has(cssClass: UnsafePointer<CChar>!) -> Bool
  • hasDefault() Extension method

    Determines whether widget is the current default widget within its toplevel.

    Declaration

    Swift

    @inlinable
    func hasDefault() -> Bool
  • hasFocus() Extension method

    Determines if the widget has the global input focus.

    See [methodGtk.Widget.is_focus] for the difference between having the global input focus, and only having the focus within a toplevel.

    Declaration

    Swift

    @inlinable
    func hasFocus() -> Bool
  • hasVisibleFocus() Extension method

    Determines if the widget should show a visible indication that it has the global input focus.

    This is a convenience function that takes into account whether focus indication should currently be shown in the toplevel window of widget. See [methodGtk.Window.get_focus_visible] for more information about focus indication.

    To find out if the widget has the global input focus, use [methodGtk.Widget.has_focus].

    Declaration

    Swift

    @inlinable
    func hasVisibleFocus() -> Bool
  • hide() Extension method

    Reverses the effects of gtk_widget_show().

    This is causing the widget to be hidden (invisible to the user).

    Declaration

    Swift

    @inlinable
    func hide()
  • inDestruction() Extension method

    Returns whether the widget is currently being destroyed.

    This information can sometimes be used to avoid doing unnecessary work.

    Declaration

    Swift

    @inlinable
    func inDestruction() -> Bool
  • initTemplate() Extension method

    Creates and initializes child widgets defined in templates.

    This function must be called in the instance initializer for any class which assigned itself a template using [methodGtk.WidgetClass.set_template].

    It is important to call this function in the instance initializer of a GtkWidget subclass and not in GObject.constructed() or GObject.constructor() for two reasons:

    • derived widgets will assume that the composite widgets defined by its parent classes have been created in their relative instance initializers
    • when calling g_object_new() on a widget with composite templates, it’s important to build the composite widgets before the construct properties are set. Properties passed to g_object_new() should take precedence over properties set in the private template XML

    A good rule of thumb is to call this function as the first thing in an instance initialization function.

    Declaration

    Swift

    @inlinable
    func initTemplate()
  • Inserts group into widget.

    Children of widget that implement [ifaceGtk.Actionable] can then be associated with actions in group by setting their “action-name” to prefix.action-name.

    Note that inheritance is defined for individual actions. I.e. even if you insert a group with prefix prefix, actions with the same prefix will still be inherited from the parent, unless the group contains an action with the same name.

    If group is nil, a previously inserted group for name is removed from widget.

    Declaration

    Swift

    @inlinable
    func insertActionGroup(name: UnsafePointer<CChar>!, group: GIO.ActionGroupRef? = nil)
  • Inserts group into widget.

    Children of widget that implement [ifaceGtk.Actionable] can then be associated with actions in group by setting their “action-name” to prefix.action-name.

    Note that inheritance is defined for individual actions. I.e. even if you insert a group with prefix prefix, actions with the same prefix will still be inherited from the parent, unless the group contains an action with the same name.

    If group is nil, a previously inserted group for name is removed from widget.

    Declaration

    Swift

    @inlinable
    func insertActionGroup<ActionGroupT>(name: UnsafePointer<CChar>!, group: ActionGroupT?) where ActionGroupT : ActionGroupProtocol
  • Inserts widget into the child widget list of parent.

    It will be placed after previous_sibling, or at the beginning if previous_sibling is nil.

    After calling this function, gtk_widget_get_prev_sibling(widget) will return previous_sibling.

    If parent is already set as the parent widget of widget, this function can also be used to reorder widget in the child widget list of parent.

    This API is primarily meant for widget implementations; if you are just using a widget, you must use its own API for adding children.

    Declaration

    Swift

    @inlinable
    func insertAfter<WidgetT>(parent: WidgetT, previousSibling: WidgetT?) where WidgetT : WidgetProtocol
  • Inserts widget into the child widget list of parent.

    It will be placed before next_sibling, or at the end if next_sibling is nil.

    After calling this function, gtk_widget_get_next_sibling(widget) will return next_sibling.

    If parent is already set as the parent widget of widget, this function can also be used to reorder widget in the child widget list of parent.

    This API is primarily meant for widget implementations; if you are just using a widget, you must use its own API for adding children.

    Declaration

    Swift

    @inlinable
    func insertBefore<WidgetT>(parent: WidgetT, nextSibling: WidgetT?) where WidgetT : WidgetProtocol
  • is_(ancestor:) Extension method

    Determines whether widget is somewhere inside ancestor, possibly with intermediate containers.

    Declaration

    Swift

    @inlinable
    func is_<WidgetT>(ancestor: WidgetT) -> Bool where WidgetT : WidgetProtocol
  • keynavFailed(direction:) Extension method

    Emits the keynav-failed signal on the widget.

    This function should be called whenever keyboard navigation within a single widget hits a boundary.

    The return value of this function should be interpreted in a way similar to the return value of [methodGtk.Widget.child_focus]. When true is returned, stay in the widget, the failed keyboard navigation is OK and/or there is nowhere we can/should move the focus to. When false is returned, the caller should continue with keyboard navigation outside the widget, e.g. by calling [methodGtk.Widget.child_focus] on the widget’s toplevel.

    The default [signalGtk.Widget::keynav-failed] handler returns false for GTK_DIR_TAB_FORWARD and GTK_DIR_TAB_BACKWARD. For the other values of GtkDirectionType it returns true.

    Whenever the default handler returns true, it also calls [methodGtk.Widget.error_bell] to notify the user of the failed keyboard navigation.

    A use case for providing an own implementation of keynav-failed (either by connecting to it or by overriding it) would be a row of [classGtk.Entry] widgets where the user should be able to navigate the entire row with the cursor keys, as e.g. known from user interfaces that require entering license keys.

    Declaration

    Swift

    @inlinable
    func keynavFailed(direction: GtkDirectionType) -> Bool
  • listMnemonicLabels() Extension method

    Returns the widgets for which this widget is the target of a mnemonic.

    Typically, these widgets will be labels. See, for example, [methodGtk.Label.set_mnemonic_widget].

    The widgets in the list are not individually referenced. If you want to iterate through the list and perform actions involving callbacks that might destroy the widgets, you must call g_list_foreach (result, (GFunc)g_object_ref, NULL) first, and then unref all the widgets afterwards.

    Declaration

    Swift

    @inlinable
    func listMnemonicLabels() -> GLib.ListRef!
  • map() Extension method

    Causes a widget to be mapped if it isn’t already.

    This function is only for use in widget implementations.

    Declaration

    Swift

    @inlinable
    func map()
  • Measures widget in the orientation orientation and for the given for_size.

    As an example, if orientation is GTK_ORIENTATION_HORIZONTAL and for_size is 300, this functions will compute the minimum and natural width of widget if it is allocated at a height of 300 pixels.

    See GtkWidget’s geometry management section for a more details on implementing GtkWidgetClass.measure().

    Declaration

    Swift

    @inlinable
    func measure(orientation: GtkOrientation, for size: Int, minimum: UnsafeMutablePointer<gint>! = nil, natural: UnsafeMutablePointer<gint>! = nil, minimumBaseline: UnsafeMutablePointer<gint>! = nil, naturalBaseline: UnsafeMutablePointer<gint>! = nil)
  • Emits the mnemonic-activate signal.

    See [signalGtk.Widget::mnemonic-activate].

    Declaration

    Swift

    @inlinable
    func mnemonicActivate(groupCycling: Bool) -> Bool
  • observeChildren() Extension method

    Returns a GListModel to track the children of widget.

    Calling this function will enable extra internal bookkeeping to track children and emit signals on the returned listmodel. It may slow down operations a lot.

    Applications should try hard to avoid calling this function because of the slowdowns.

    Declaration

    Swift

    @inlinable
    func observeChildren() -> GIO.ListModelRef!
  • observeControllers() Extension method

    Returns a GListModel to track the [classGtk.EventController]s of widget.

    Calling this function will enable extra internal bookkeeping to track controllers and emit signals on the returned listmodel. It may slow down operations a lot.

    Applications should try hard to avoid calling this function because of the slowdowns.

    Declaration

    Swift

    @inlinable
    func observeControllers() -> GIO.ListModelRef!
  • pick(x:y:flags:) Extension method

    Finds the descendant of widget closest to the point (x, y).

    The point must be given in widget coordinates, so (0, 0) is assumed to be the top left of widget‘s content area.

    Usually widgets will return nil if the given coordinate is not contained in widget checked via [methodGtk.Widget.contains]. Otherwise they will recursively try to find a child that does not return nil. Widgets are however free to customize their picking algorithm.

    This function is used on the toplevel to determine the widget below the mouse cursor for purposes of hover highlighting and delivering events.

    Declaration

    Swift

    @inlinable
    func pick(x: CDouble, y: CDouble, flags: PickFlags) -> WidgetRef!
  • queueAllocate() Extension method

    Flags the widget for a rerun of the [vfuncGtk.Widget.size_allocate] function.

    Use this function instead of [methodGtk.Widget.queue_resize] when the widget‘s size request didn’t change but it wants to reposition its contents.

    An example user of this function is [methodGtk.Widget.set_halign].

    This function is only for use in widget implementations.

    Declaration

    Swift

    @inlinable
    func queueAllocate()
  • queueDraw() Extension method

    Schedules this widget to be redrawn in the paint phase of the current or the next frame.

    This means widget‘s [vfuncGtk.Widget.snapshot] implementation will be called.

    Declaration

    Swift

    @inlinable
    func queueDraw()
  • queueResize() Extension method

    Flags a widget to have its size renegotiated.

    This should be called when a widget for some reason has a new size request. For example, when you change the text in a [classGtk.Label], the label queues a resize to ensure there’s enough space for the new text.

    Note that you cannot call gtk_widget_queue_resize() on a widget from inside its implementation of the [vfuncGtk.Widget.size_allocate] virtual method. Calls to gtk_widget_queue_resize() from inside [vfuncGtk.Widget.size_allocate] will be silently ignored.

    This function is only for use in widget implementations.

    Declaration

    Swift

    @inlinable
    func queueResize()
  • realize() Extension method

    Creates the GDK resources associated with a widget.

    Normally realization happens implicitly; if you show a widget and all its parent containers, then the widget will be realized and mapped automatically.

    Realizing a widget requires all the widget’s parent widgets to be realized; calling this function realizes the widget’s parents in addition to widget itself. If a widget is not yet inside a toplevel window when you realize it, bad things will happen.

    This function is primarily used in widget implementations, and isn’t very useful otherwise. Many times when you think you might need it, a better approach is to connect to a signal that will be called after the widget is realized automatically, such as [signalGtk.Widget::realize].

    Declaration

    Swift

    @inlinable
    func realize()
  • remove(controller:) Extension method

    Removes controller from widget, so that it doesn’t process events anymore.

    It should not be used again.

    Widgets will remove all event controllers automatically when they are destroyed, there is normally no need to call this function.

    Declaration

    Swift

    @inlinable
    func remove<EventControllerT>(controller: EventControllerT) where EventControllerT : EventControllerProtocol
  • remove(cssClass:) Extension method

    Removes a style from widget.

    After this, the style of widget will stop matching for css_class.

    Declaration

    Swift

    @inlinable
    func remove(cssClass: UnsafePointer<CChar>!)
  • removeMnemonic(label:) Extension method

    Removes a widget from the list of mnemonic labels for this widget.

    See [methodGtk.Widget.list_mnemonic_labels]. The widget must have previously been added to the list with [methodGtk.Widget.add_mnemonic_label].

    Declaration

    Swift

    @inlinable
    func removeMnemonic<WidgetT>(label: WidgetT) where WidgetT : WidgetProtocol
  • removeTickCallback(id:) Extension method

    Removes a tick callback previously registered with gtk_widget_add_tick_callback().

    Declaration

    Swift

    @inlinable
    func removeTickCallback(id: Int)
  • set(canFocus:) Extension method

    Specifies whether the input focus can enter the widget or any of its children.

    Applications should set can_focus to false to mark a widget as for pointer/touch use only.

    Note that having can_focus be true is only one of the necessary conditions for being focusable. A widget must also be sensitive and focusable and not have an ancestor that is marked as not can-focus in order to receive input focus.

    See [methodGtk.Widget.grab_focus] for actually setting the input focus on a widget.

    Declaration

    Swift

    @inlinable
    func set(canFocus: Bool)
  • set(canTarget:) Extension method

    Sets whether widget can be the target of pointer events.

    Declaration

    Swift

    @inlinable
    func set(canTarget: Bool)
  • set(childVisible:) Extension method

    Sets whether widget should be mapped along with its parent.

    The child visibility can be set for widget before it is added to a container with [methodGtk.Widget.set_parent], to avoid mapping children unnecessary before immediately unmapping them. However it will be reset to its default state of true when the widget is removed from a container.

    Note that changing the child visibility of a widget does not queue a resize on the widget. Most of the time, the size of a widget is computed from all visible children, whether or not they are mapped. If this is not the case, the container can queue a resize itself.

    This function is only useful for container implementations and should never be called by an application.

    Declaration

    Swift

    @inlinable
    func set(childVisible: Bool)
  • setCss(classes:) Extension method

    Clear all style classes applied to widget and replace them with classes.

    Declaration

    Swift

    @inlinable
    func setCss(classes: UnsafeMutablePointer<UnsafePointer<CChar>?>!)
  • set(cursor:) Extension method

    Sets the cursor to be shown when pointer devices point towards widget.

    If the cursor is NULL, widget will use the cursor inherited from the parent widget.

    Declaration

    Swift

    @inlinable
    func set(cursor: Gdk.CursorRef? = nil)
  • set(cursor:) Extension method

    Sets the cursor to be shown when pointer devices point towards widget.

    If the cursor is NULL, widget will use the cursor inherited from the parent widget.

    Declaration

    Swift

    @inlinable
    func set<CursorT>(cursor: CursorT?) where CursorT : CursorProtocol
  • setCursorFrom(name:) Extension method

    Sets a named cursor to be shown when pointer devices point towards widget.

    This is a utility function that creates a cursor via [ctorGdk.Cursor.new_from_name] and then sets it on widget with [methodGtk.Widget.set_cursor]. See those functions for details.

    On top of that, this function allows name to be nil, which will do the same as calling [methodGtk.Widget.set_cursor] with a nil cursor.

    Declaration

    Swift

    @inlinable
    func setCursorFrom(name: UnsafePointer<CChar>? = nil)
  • setDirection(dir:) Extension method

    Sets the reading direction on a particular widget.

    This direction controls the primary direction for widgets containing text, and also the direction in which the children of a container are packed. The ability to set the direction is present in order so that correct localization into languages with right-to-left reading directions can be done. Generally, applications will let the default reading direction present, except for containers where the containers are arranged in an order that is explicitly visual rather than logical (such as buttons for text justification).

    If the direction is set to GTK_TEXT_DIR_NONE, then the value set by [funcGtk.Widget.set_default_direction] will be used.

    Declaration

    Swift

    @inlinable
    func setDirection(dir: GtkTextDirection)
  • setFocus(child:) Extension method

    Set child as the current focus child of widget.

    This function is only suitable for widget implementations. If you want a certain widget to get the input focus, call [methodGtk.Widget.grab_focus] on it.

    Declaration

    Swift

    @inlinable
    func setFocus(child: WidgetRef? = nil)
  • setFocus(child:) Extension method

    Set child as the current focus child of widget.

    This function is only suitable for widget implementations. If you want a certain widget to get the input focus, call [methodGtk.Widget.grab_focus] on it.

    Declaration

    Swift

    @inlinable
    func setFocus<WidgetT>(child: WidgetT?) where WidgetT : WidgetProtocol
  • set(focusOnClick:) Extension method

    Sets whether the widget should grab focus when it is clicked with the mouse.

    Making mouse clicks not grab focus is useful in places like toolbars where you don’t want the keyboard focus removed from the main area of the application.

    Declaration

    Swift

    @inlinable
    func set(focusOnClick: Bool)
  • set(focusable:) Extension method

    Specifies whether widget can own the input focus.

    Widget implementations should set focusable to true in their init() function if they want to receive keyboard input.

    Note that having focusable be true is only one of the necessary conditions for being focusable. A widget must also be sensitive and can-focus and not have an ancestor that is marked as not can-focus in order to receive input focus.

    See [methodGtk.Widget.grab_focus] for actually setting the input focus on a widget.

    Declaration

    Swift

    @inlinable
    func set(focusable: Bool)
  • set(fontMap:) Extension method

    Sets the font map to use for Pango rendering.

    The font map is the object that is used to look up fonts. Setting a custom font map can be useful in special situations, e.g. when you need to add application-specific fonts to the set of available fonts.

    When not set, the widget will inherit the font map from its parent.

    Declaration

    Swift

    @inlinable
    func set(fontMap: Pango.FontMapRef? = nil)
  • set(fontMap:) Extension method

    Sets the font map to use for Pango rendering.

    The font map is the object that is used to look up fonts. Setting a custom font map can be useful in special situations, e.g. when you need to add application-specific fonts to the set of available fonts.

    When not set, the widget will inherit the font map from its parent.

    Declaration

    Swift

    @inlinable
    func set<FontMapT>(fontMap: FontMapT?) where FontMapT : FontMapProtocol
  • setFont(options:) Extension method

    Sets the cairo_font_options_t used for Pango rendering in this widget.

    When not set, the default font options for the GdkDisplay will be used.

    Declaration

    Swift

    @inlinable
    func setFont(options: Cairo.FontOptionsRef? = nil)
  • setFont(options:) Extension method

    Sets the cairo_font_options_t used for Pango rendering in this widget.

    When not set, the default font options for the GdkDisplay will be used.

    Declaration

    Swift

    @inlinable
    func setFont<FontOptionsT>(options: FontOptionsT?) where FontOptionsT : FontOptionsProtocol
  • setHalign(align:) Extension method

    Sets the horizontal alignment of widget.

    Declaration

    Swift

    @inlinable
    func setHalign(align: GtkAlign)
  • set(hasTooltip:) Extension method

    Sets the has-tooltip property on widget to has_tooltip.

    Declaration

    Swift

    @inlinable
    func set(hasTooltip: Bool)
  • setHexpand(expand:) Extension method

    Sets whether the widget would like any available extra horizontal space.

    When a user resizes a GtkWindow, widgets with expand=TRUE generally receive the extra space. For example, a list or scrollable area or document in your window would often be set to expand.

    Call this function to set the expand flag if you would like your widget to become larger horizontally when the window has extra room.

    By default, widgets automatically expand if any of their children want to expand. (To see if a widget will automatically expand given its current children and state, call [methodGtk.Widget.compute_expand]. A container can decide how the expandability of children affects the expansion of the container by overriding the compute_expand virtual method on GtkWidget.).

    Setting hexpand explicitly with this function will override the automatic expand behavior.

    This function forces the widget to expand or not to expand, regardless of children. The override occurs because [methodGtk.Widget.set_hexpand] sets the hexpand-set property (see [methodGtk.Widget.set_hexpand_set]) which causes the widget’s hexpand value to be used, rather than looking at children and widget state.

    Declaration

    Swift

    @inlinable
    func setHexpand(expand: Bool)
  • setHexpand(set:) Extension method

    Sets whether the hexpand flag will be used.

    The [propertyGtk.Widget:hexpand-set] property will be set automatically when you call [methodGtk.Widget.set_hexpand] to set hexpand, so the most likely reason to use this function would be to unset an explicit expand flag.

    If hexpand is set, then it overrides any computed expand value based on child widgets. If hexpand is not set, then the expand value depends on whether any children of the widget would like to expand.

    There are few reasons to use this function, but it’s here for completeness and consistency.

    Declaration

    Swift

    @inlinable
    func setHexpand(set: Bool)
  • set(layoutManager:) Extension method

    Sets the layout manager delegate instance that provides an implementation for measuring and allocating the children of widget.

    Declaration

    Swift

    @inlinable
    func set(layoutManager: LayoutManagerRef? = nil)
  • set(layoutManager:) Extension method

    Sets the layout manager delegate instance that provides an implementation for measuring and allocating the children of widget.

    Declaration

    Swift

    @inlinable
    func set<LayoutManagerT>(layoutManager: LayoutManagerT?) where LayoutManagerT : LayoutManagerProtocol
  • setMarginBottom(margin:) Extension method

    Sets the bottom margin of widget.

    Declaration

    Swift

    @inlinable
    func setMarginBottom(margin: Int)
  • setMarginEnd(margin:) Extension method

    Sets the end margin of widget.

    Declaration

    Swift

    @inlinable
    func setMarginEnd(margin: Int)
  • setMarginStart(margin:) Extension method

    Sets the start margin of widget.

    Declaration

    Swift

    @inlinable
    func setMarginStart(margin: Int)
  • setMarginTop(margin:) Extension method

    Sets the top margin of widget.

    Declaration

    Swift

    @inlinable
    func setMarginTop(margin: Int)
  • set(name:) Extension method

    Sets a widgets name.

    Setting a name allows you to refer to the widget from a CSS file. You can apply a style to widgets with a particular name in the CSS file. See the documentation for the CSS syntax (on the same page as the docs for [classGtk.StyleContext].

    Note that the CSS syntax has certain special characters to delimit and represent elements in a selector (period, #, >, *…), so using these will make your widget impossible to match by name. Any combination of alphanumeric symbols, dashes and underscores will suffice.

    Declaration

    Swift

    @inlinable
    func set(name: UnsafePointer<CChar>!)
  • set(opacity:) Extension method

    Request the widget to be rendered partially transparent.

    An opacity of 0 is fully transparent and an opacity of 1 is fully opaque.

    Opacity works on both toplevel widgets and child widgets, although there are some limitations: For toplevel widgets, applying opacity depends on the capabilities of the windowing system. On X11, this has any effect only on X displays with a compositing manager, see gdk_display_is_composited(). On Windows and Wayland it should always work, although setting a window’s opacity after the window has been shown may cause some flicker.

    Note that the opacity is inherited through inclusion — if you set a toplevel to be partially translucent, all of its content will appear translucent, since it is ultimatively rendered on that toplevel. The opacity value itself is not inherited by child widgets (since that would make widgets deeper in the hierarchy progressively more translucent). As a consequence, [classGtk.Popover]s and other [classGtk.Native] widgets with their own surface will use their own opacity value, and thus by default appear non-translucent, even if they are attached to a toplevel that is translucent.

    Declaration

    Swift

    @inlinable
    func set(opacity: CDouble)
  • set(overflow:) Extension method

    Sets how widget treats content that is drawn outside the widget’s content area.

    See the definition of [enumGtk.Overflow] for details.

    This setting is provided for widget implementations and should not be used by application code.

    The default value is GTK_OVERFLOW_VISIBLE.

    Declaration

    Swift

    @inlinable
    func set(overflow: GtkOverflow)
  • set(parent:) Extension method

    Sets parent as the parent widget of widget.

    This takes care of details such as updating the state and style of the child to reflect its new location and resizing the parent. The opposite function is [methodGtk.Widget.unparent].

    This function is useful only when implementing subclasses of GtkWidget.

    Declaration

    Swift

    @inlinable
    func set<WidgetT>(parent: WidgetT) where WidgetT : WidgetProtocol
  • set(receivesDefault:) Extension method

    Specifies whether widget will be treated as the default widget within its toplevel when it has the focus, even if another widget is the default.

    Declaration

    Swift

    @inlinable
    func set(receivesDefault: Bool)
  • set(sensitive:) Extension method

    Sets the sensitivity of a widget.

    A widget is sensitive if the user can interact with it. Insensitive widgets are “grayed out” and the user can’t interact with them. Insensitive widgets are known as “inactive”, “disabled”, or “ghosted” in some other toolkits.

    Declaration

    Swift

    @inlinable
    func set(sensitive: Bool)
  • Sets the minimum size of a widget.

    That is, the widget’s size request will be at least width by height. You can use this function to force a widget to be larger than it normally would be.

    In most cases, [methodGtk.Window.set_default_size] is a better choice for toplevel windows than this function; setting the default size will still allow users to shrink the window. Setting the size request will force them to leave the window at least as large as the size request.

    Note the inherent danger of setting any fixed size - themes, translations into other languages, different fonts, and user action can all change the appropriate size for a given widget. So, it’s basically impossible to hardcode a size that will always be correct.

    The size request of a widget is the smallest size a widget can accept while still functioning well and drawing itself correctly. However in some strange cases a widget may be allocated less than its requested size, and in many cases a widget may be allocated more space than it requested.

    If the size request in a given direction is -1 (unset), then the “natural” size request of the widget will be used instead.

    The size request set here does not include any margin from the properties [propertyGtk.Widget:margin-start], [propertyGtk.Widget:margin-end], [propertyGtk.Widget:margin-top], and [propertyGtk.Widget:margin-bottom], but it does include pretty much all other padding or border properties set by any subclass of GtkWidget.

    Declaration

    Swift

    @inlinable
    func setSizeRequest(width: Int, height: Int)
  • setState(flags:clear:) Extension method

    Turns on flag values in the current widget state.

    Typical widget states are insensitive, prelighted, etc.

    This function accepts the values GTK_STATE_FLAG_DIR_LTR and GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget’s direction, use [methodGtk.Widget.set_direction].

    This function is for use in widget implementations.

    Declaration

    Swift

    @inlinable
    func setState(flags: StateFlags, clear: Bool)
  • setTooltip(markup:) Extension method

    Sets markup as the contents of the tooltip, which is marked up with Pango markup.

    This function will take care of setting the [propertyGtk.Widget:has-tooltip] as a side effect, and of the default handler for the [signalGtk.Widget::query-tooltip] signal.

    See also [methodGtk.Tooltip.set_markup].

    Declaration

    Swift

    @inlinable
    func setTooltip(markup: UnsafePointer<CChar>? = nil)
  • setTooltip(text:) Extension method

    Sets text as the contents of the tooltip.

    If text contains any markup, it will be escaped.

    This function will take care of setting [propertyGtk.Widget:has-tooltip] as a side effect, and of the default handler for the [signalGtk.Widget::query-tooltip] signal.

    See also [methodGtk.Tooltip.set_text].

    Declaration

    Swift

    @inlinable
    func setTooltip(text: UnsafePointer<CChar>? = nil)
  • setValign(align:) Extension method

    Sets the vertical alignment of widget.

    Declaration

    Swift

    @inlinable
    func setValign(align: GtkAlign)
  • setVexpand(expand:) Extension method

    Sets whether the widget would like any available extra vertical space.

    See [methodGtk.Widget.set_hexpand] for more detail.

    Declaration

    Swift

    @inlinable
    func setVexpand(expand: Bool)
  • setVexpand(set:) Extension method

    Sets whether the vexpand flag will be used.

    See [methodGtk.Widget.set_hexpand_set] for more detail.

    Declaration

    Swift

    @inlinable
    func setVexpand(set: Bool)
  • set(visible:) Extension method

    Sets the visibility state of widget.

    Note that setting this to true doesn’t mean the widget is actually viewable, see [methodGtk.Widget.get_visible].

    This function simply calls [methodGtk.Widget.show] or [methodGtk.Widget.hide] but is nicer to use when the visibility of the widget depends on some condition.

    Declaration

    Swift

    @inlinable
    func set(visible: Bool)
  • shouldLayout() Extension method

    Returns whether widget should contribute to the measuring and allocation of its parent.

    This is false for invisible children, but also for children that have their own surface.

    Declaration

    Swift

    @inlinable
    func shouldLayout() -> Bool
  • show() Extension method

    Flags a widget to be displayed.

    Any widget that isn’t shown will not appear on the screen.

    Remember that you have to show the containers containing a widget, in addition to the widget itself, before it will appear onscreen.

    When a toplevel container is shown, it is immediately realized and mapped; other shown widgets are realized and mapped when their toplevel container is realized and mapped.

    Declaration

    Swift

    @inlinable
    func show()
  • Allocates widget with a transformation that translates the origin to the position in allocation.

    This is a simple form of [methodGtk.Widget.allocate].

    Declaration

    Swift

    @inlinable
    func sizeAllocate(allocation: UnsafePointer<GtkAllocation>!, baseline: Int)
  • snapshot(child:snapshot:) Extension method

    Snapshot the a child of widget.

    When a widget receives a call to the snapshot function, it must send synthetic [vfuncGtk.Widget.snapshot] calls to all children. This function provides a convenient way of doing this. A widget, when it receives a call to its [vfuncGtk.Widget.snapshot] function, calls gtk_widget_snapshot_child() once for each child, passing in the snapshot the widget received.

    gtk_widget_snapshot_child() takes care of translating the origin of snapshot, and deciding whether the child needs to be snapshot.

    This function does nothing for children that implement GtkNative.

    Declaration

    Swift

    @inlinable
    func snapshot<SnapshotT, WidgetT>(child: WidgetT, snapshot: SnapshotT) where SnapshotT : SnapshotProtocol, WidgetT : WidgetProtocol
  • Translate coordinates relative to src_widget’s allocation to coordinates relative to dest_widget’s allocations.

    In order to perform this operation, both widget must share a common ancestor.

    Declaration

    Swift

    @inlinable
    func translateCoordinates<WidgetT>(destWidget: WidgetT, srcX: CDouble, srcY: CDouble, destX: UnsafeMutablePointer<CDouble>! = nil, destY: UnsafeMutablePointer<CDouble>! = nil) -> Bool where WidgetT : WidgetProtocol
  • triggerTooltipQuery() Extension method

    Triggers a tooltip query on the display where the toplevel of widget is located.

    Declaration

    Swift

    @inlinable
    func triggerTooltipQuery()
  • unmap() Extension method

    Causes a widget to be unmapped if it’s currently mapped.

    This function is only for use in widget implementations.

    Declaration

    Swift

    @inlinable
    func unmap()
  • unparent() Extension method

    Dissociate widget from its parent.

    This function is only for use in widget implementations, typically in dispose.

    Declaration

    Swift

    @inlinable
    func unparent()
  • unrealize() Extension method

    Causes a widget to be unrealized (frees all GDK resources associated with the widget).

    This function is only useful in widget implementations.

    Declaration

    Swift

    @inlinable
    func unrealize()
  • unsetState(flags:) Extension method

    Turns off flag values for the current widget state.

    See [methodGtk.Widget.set_state_flags].

    This function is for use in widget implementations.

    Declaration

    Swift

    @inlinable
    func unsetState(flags: StateFlags)
  • testWidgetWaitForDraw() Extension method

    Enters the main loop and waits for widget to be “drawn”.

    In this context that means it waits for the frame clock of widget to have run a full styling, layout and drawing cycle.

    This function is intended to be used for syncing with actions that depend on widget relayouting or on interaction with the display server.

    Declaration

    Swift

    @inlinable
    func testWidgetWaitForDraw()
  • allocatedBaseline Extension method

    Returns the baseline that has currently been allocated to widget.

    This function is intended to be used when implementing handlers for the GtkWidget`Class.snapshot()` function, and when allocating child widgets inGtkWidgetClass.size_allocate().

    Declaration

    Swift

    @inlinable
    var allocatedBaseline: Int { get }
  • allocatedHeight Extension method

    Returns the height that has currently been allocated to widget.

    Declaration

    Swift

    @inlinable
    var allocatedHeight: Int { get }
  • allocatedWidth Extension method

    Returns the width that has currently been allocated to widget.

    Declaration

    Swift

    @inlinable
    var allocatedWidth: Int { get }
  • canFocus Extension method

    Determines whether the input focus can enter widget or any of its children.

    See [methodGtk.Widget.set_focusable].

    Declaration

    Swift

    @inlinable
    var canFocus: Bool { get nonmutating set }
  • canTarget Extension method

    Queries whether widget can be the target of pointer events.

    Declaration

    Swift

    @inlinable
    var canTarget: Bool { get nonmutating set }
  • childVisible Extension method

    Gets the value set with gtk_widget_set_child_visible().

    If you feel a need to use this function, your code probably needs reorganization.

    This function is only useful for container implementations and should never be called by an application.

    Declaration

    Swift

    @inlinable
    var childVisible: Bool { get nonmutating set }
  • clipboard Extension method

    Gets the clipboard object for widget.

    This is a utility function to get the clipboard object for the GdkDisplay that widget is using.

    Note that this function always works, even when widget is not realized yet.

    Declaration

    Swift

    @inlinable
    var clipboard: Gdk.ClipboardRef! { get }
  • cssClasses Extension method

    Returns the list of style classes applied to widget.

    Declaration

    Swift

    @inlinable
    var cssClasses: UnsafeMutablePointer<UnsafeMutablePointer<CChar>?>! { get nonmutating set }
  • cssName Extension method

    Returns the CSS name that is used for self.

    Declaration

    Swift

    @inlinable
    var cssName: String! { get }
  • cursor Extension method

    The cursor used by widget.

    Declaration

    Swift

    @inlinable
    var cursor: Gdk.CursorRef! { get nonmutating set }
  • direction Extension method

    Gets the reading direction for a particular widget.

    See [methodGtk.Widget.set_direction].

    Declaration

    Swift

    @inlinable
    var direction: GtkTextDirection { get nonmutating set }
  • display Extension method

    Get the GdkDisplay for the toplevel window associated with this widget.

    This function can only be called after the widget has been added to a widget hierarchy with a GtkWindow at the top.

    In general, you should only create display specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.

    Declaration

    Swift

    @inlinable
    var display: Gdk.DisplayRef! { get }
  • firstChild Extension method

    Returns the widgets first child.

    This API is primarily meant for widget implementations.

    Declaration

    Swift

    @inlinable
    var firstChild: WidgetRef! { get }
  • focusChild Extension method

    Returns the current focus child of widget.

    Declaration

    Swift

    @inlinable
    var focusChild: WidgetRef! { get nonmutating set }
  • focusOnClick Extension method

    Returns whether the widget should grab focus when it is clicked with the mouse.

    See [methodGtk.Widget.set_focus_on_click].

    Declaration

    Swift

    @inlinable
    var focusOnClick: Bool { get nonmutating set }
  • focusable Extension method

    Whether this widget itself will accept the input focus.

    Declaration

    Swift

    @inlinable
    var focusable: Bool { get nonmutating set }
  • fontMap Extension method

    Gets the font map of widget.

    See [methodGtk.Widget.set_font_map].

    Declaration

    Swift

    @inlinable
    var fontMap: Pango.FontMapRef! { get nonmutating set }
  • fontOptions Extension method

    Returns the cairo_font_options_t of widget.

    Seee [methodGtk.Widget.set_font_options].

    Declaration

    Swift

    @inlinable
    var fontOptions: Cairo.FontOptionsRef! { get nonmutating set }
  • frameClock Extension method

    Obtains the frame clock for a widget.

    The frame clock is a global “ticker” that can be used to drive animations and repaints. The most common reason to get the frame clock is to call [methodGdk.FrameClock.get_frame_time], in order to get a time to use for animating. For example you might record the start of the animation with an initial value from [methodGdk.FrameClock.get_frame_time], and then update the animation by calling [methodGdk.FrameClock.get_frame_time] again during each repaint.

    [methodGdk.FrameClock.request_phase] will result in a new frame on the clock, but won’t necessarily repaint any widgets. To repaint a widget, you have to use [methodGtk.Widget.queue_draw] which invalidates the widget (thus scheduling it to receive a draw on the next frame). gtk_widget_queue_draw() will also end up requesting a frame on the appropriate frame clock.

    A widget’s frame clock will not change while the widget is mapped. Reparenting a widget (which implies a temporary unmap) can change the widget’s frame clock.

    Unrealized widgets do not have a frame clock.

    Declaration

    Swift

    @inlinable
    var frameClock: Gdk.FrameClockRef! { get }
  • halign Extension method

    How to distribute horizontal space if widget gets extra space.

    Declaration

    Swift

    @inlinable
    var halign: GtkAlign { get nonmutating set }
  • hasTooltip Extension method

    Returns the current value of the has-tooltip property.

    Declaration

    Swift

    @inlinable
    var hasTooltip: Bool { get nonmutating set }
  • height Extension method

    Returns the content height of the widget.

    This function returns the height passed to its size-allocate implementation, which is the height you should be using in [vfuncGtk.Widget.snapshot].

    For pointer events, see [methodGtk.Widget.contains].

    Declaration

    Swift

    @inlinable
    var height: Int { get }
  • hexpand Extension method

    Whether to expand horizontally.

    Declaration

    Swift

    @inlinable
    var hexpand: Bool { get nonmutating set }
  • hexpandSet Extension method

    Gets whether gtk_widget_set_hexpand() has been used to explicitly set the expand flag on this widget.

    If [propertyGtk.Widget:hexpand] property is set, then it overrides any computed expand value based on child widgets. If hexpand is not set, then the expand value depends on whether any children of the widget would like to expand.

    There are few reasons to use this function, but it’s here for completeness and consistency.

    Declaration

    Swift

    @inlinable
    var hexpandSet: Bool { get nonmutating set }
  • isDrawable Extension method

    Determines whether widget can be drawn to.

    A widget can be drawn if it is mapped and visible.

    Declaration

    Swift

    @inlinable
    var isDrawable: Bool { get }
  • isFocus Extension method

    Determines if the widget is the focus widget within its toplevel.

    This does not mean that the [propertyGtk.Widget:has-focus] property is necessarily set; [propertyGtk.Widget:has-focus] will only be set if the toplevel widget additionally has the global input focus.

    Declaration

    Swift

    @inlinable
    var isFocus: Bool { get }
  • isSensitive Extension method

    Returns the widget’s effective sensitivity.

    This means it is sensitive itself and also its parent widget is sensitive.

    Declaration

    Swift

    @inlinable
    var isSensitive: Bool { get }
  • isVisible Extension method

    Determines whether the widget and all its parents are marked as visible.

    This function does not check if the widget is obscured in any way.

    See also [methodGtk.Widget.get_visible] and [methodGtk.Widget.set_visible].

    Declaration

    Swift

    @inlinable
    var isVisible: Bool { get }
  • lastChild Extension method

    Returns the widgets last child.

    This API is primarily meant for widget implementations.

    Declaration

    Swift

    @inlinable
    var lastChild: WidgetRef! { get }
  • layoutManager Extension method

    Retrieves the layout manager used by widget.

    See [methodGtk.Widget.set_layout_manager].

    Declaration

    Swift

    @inlinable
    var layoutManager: LayoutManagerRef! { get nonmutating set }
  • mapped Extension method

    Whether the widget is mapped.

    Declaration

    Swift

    @inlinable
    var mapped: Bool { get }
  • marginBottom Extension method

    Gets the bottom margin of widget.

    Declaration

    Swift

    @inlinable
    var marginBottom: Int { get nonmutating set }
  • marginEnd Extension method

    Gets the end margin of widget.

    Declaration

    Swift

    @inlinable
    var marginEnd: Int { get nonmutating set }
  • marginStart Extension method

    Gets the start margin of widget.

    Declaration

    Swift

    @inlinable
    var marginStart: Int { get nonmutating set }
  • marginTop Extension method

    Gets the top margin of widget.

    Declaration

    Swift

    @inlinable
    var marginTop: Int { get nonmutating set }
  • name Extension method

    The name of the widget.

    Declaration

    Swift

    @inlinable
    var name: String! { get nonmutating set }
  • native Extension method

    Returns the nearest GtkNative ancestor of widget.

    This function will return nil if the widget is not contained inside a widget tree with a native ancestor.

    GtkNative widgets will return themselves here.

    Declaration

    Swift

    @inlinable
    var native: NativeRef! { get }
  • nextSibling Extension method

    Returns the widgets next sibling.

    This API is primarily meant for widget implementations.

    Declaration

    Swift

    @inlinable
    var nextSibling: WidgetRef! { get }
  • opacity Extension method

    The requested opacity of the widget.

    Declaration

    Swift

    @inlinable
    var opacity: CDouble { get nonmutating set }
  • overflow Extension method

    How content outside the widget’s content area is treated.

    This property is meant to be set by widget implementations, typically in their instance init function.

    Declaration

    Swift

    @inlinable
    var overflow: GtkOverflow { get nonmutating set }
  • pangoContext Extension method

    Gets a PangoContext with the appropriate font map, font description, and base direction for this widget.

    Unlike the context returned by [methodGtk.Widget.create_pango_context], this context is owned by the widget (it can be used until the screen for the widget changes or the widget is removed from its toplevel), and will be updated to match any changes to the widget’s attributes. This can be tracked by listening to changes of the [propertyGtk.Widget:root] property on the widget.

    Declaration

    Swift

    @inlinable
    var pangoContext: Pango.ContextRef! { get }
  • parent Extension method

    The parent widget of this widget.

    Declaration

    Swift

    @inlinable
    var parent: WidgetRef! { get nonmutating set }
  • prevSibling Extension method

    Returns the widgets previous sibling.

    This API is primarily meant for widget implementations.

    Declaration

    Swift

    @inlinable
    var prevSibling: WidgetRef! { get }
  • primaryClipboard Extension method

    Gets the primary clipboard of widget.

    This is a utility function to get the primary clipboard object for the GdkDisplay that widget is using.

    Note that this function always works, even when widget is not realized yet.

    Declaration

    Swift

    @inlinable
    var primaryClipboard: Gdk.ClipboardRef! { get }
  • realized Extension method

    Determines whether widget is realized.

    Declaration

    Swift

    @inlinable
    var realized: Bool { get }
  • receivesDefault Extension method

    Determines whether widget is always treated as the default widget within its toplevel when it has the focus, even if another widget is the default.

    See [methodGtk.Widget.set_receives_default].

    Declaration

    Swift

    @inlinable
    var receivesDefault: Bool { get nonmutating set }
  • requestMode Extension method

    Gets whether the widget prefers a height-for-width layout or a width-for-height layout.

    Single-child widgets generally propagate the preference of their child, more complex widgets need to request something either in context of their children or in context of their allocation capabilities.

    Declaration

    Swift

    @inlinable
    var requestMode: GtkSizeRequestMode { get }
  • root Extension method

    The GtkRoot widget of the widget tree containing this widget.

    This will be nil if the widget is not contained in a root widget.

    Declaration

    Swift

    @inlinable
    var root: RootRef! { get }
  • scaleFactor Extension method

    Retrieves the internal scale factor that maps from window coordinates to the actual device pixels.

    On traditional systems this is 1, on high density outputs, it can be a higher value (typically 2).

    See [methodGdk.Surface.get_scale_factor].

    Declaration

    Swift

    @inlinable
    var scaleFactor: Int { get }
  • sensitive Extension method

    Whether the widget responds to input.

    Declaration

    Swift

    @inlinable
    var sensitive: Bool { get nonmutating set }
  • settings Extension method

    Gets the settings object holding the settings used for this widget.

    Note that this function can only be called when the GtkWidget is attached to a toplevel, since the settings object is specific to a particular GdkDisplay. If you want to monitor the widget for changes in its settings, connect to the notifydisplay`` signal.

    Declaration

    Swift

    @inlinable
    var settings: SettingsRef! { get }
  • stateFlags Extension method

    Returns the widget state as a flag set.

    It is worth mentioning that the effective GTK_STATE_FLAG_INSENSITIVE state will be returned, that is, also based on parent insensitivity, even if widget itself is sensitive.

    Also note that if you are looking for a way to obtain the [flagsGtk.StateFlags] to pass to a [classGtk.StyleContext] method, you should look at [methodGtk.StyleContext.get_state].

    Declaration

    Swift

    @inlinable
    var stateFlags: StateFlags { get }
  • styleContext Extension method

    Returns the style context associated to widget.

    The returned object is guaranteed to be the same for the lifetime of widget.

    Declaration

    Swift

    @inlinable
    var styleContext: StyleContextRef! { get }
  • tooltipMarkup Extension method

    Gets the contents of the tooltip for widget.

    If the tooltip has not been set using [methodGtk.Widget.set_tooltip_markup], this function returns nil.

    Declaration

    Swift

    @inlinable
    var tooltipMarkup: String! { get nonmutating set }
  • tooltipText Extension method

    Gets the contents of the tooltip for widget.

    If the widget‘s tooltip was set using [methodGtk.Widget.set_tooltip_markup], this function will return the escaped text.

    Declaration

    Swift

    @inlinable
    var tooltipText: String! { get nonmutating set }
  • valign Extension method

    How to distribute vertical space if widget gets extra space.

    Declaration

    Swift

    @inlinable
    var valign: GtkAlign { get nonmutating set }
  • vexpand Extension method

    Whether to expand vertically.

    Declaration

    Swift

    @inlinable
    var vexpand: Bool { get nonmutating set }
  • vexpandSet Extension method

    Gets whether gtk_widget_set_vexpand() has been used to explicitly set the expand flag on this widget.

    See [methodGtk.Widget.get_hexpand_set] for more detail.

    Declaration

    Swift

    @inlinable
    var vexpandSet: Bool { get nonmutating set }
  • visible Extension method

    Whether the widget is visible.

    Declaration

    Swift

    @inlinable
    var visible: Bool { get nonmutating set }
  • width Extension method

    Returns the content width of the widget.

    This function returns the width passed to its size-allocate implementation, which is the width you should be using in [vfuncGtk.Widget.snapshot].

    For pointer events, see [methodGtk.Widget.contains].

    Declaration

    Swift

    @inlinable
    var width: Int { get }
  • parentInstance Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var parentInstance: GInitiallyUnowned { get }
  • styleContextRef Extension method

    Return a reference to the style context

    Declaration

    Swift

    @inlinable
    var styleContextRef: StyleContextRef { get }