Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Root

[18:7] extends: object

An interface for widgets that can act as the root of a widget hierarchy. The root widget takes care of providing the connection to the windowing system and manages layout, drawing and event delivery for its widget hierarchy. The obvious example of a GtkRoot is GtkWindow. To get the display to which a GtkRoot belongs, use [method@Gtk.Root.get_display]. GtkRoot also maintains the location of keyboard focus inside its widget hierarchy, with [method@Gtk.Root.set_focus] and [method@Gtk.Root.get_focus].

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Root (Handle = null)

    Creates a new Root by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

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

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

    Returns the opened native library for this generated wrapper.

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

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • get_display ()

    Returns the display that this GtkRoot is on.

  • get_focus ()

    Retrieves the current focused widget within the root. Note that this is the widget that would have the focus if the root is active; if the root is not focused then gtk_widget_has_focus (widget) will be %FALSE for the widget.

  • set_focus (object focus)

    If @focus is not the current focus widget, and is focusable, sets it as the focus widget for the root. If @focus is %NULL, unsets the focus widget for the root. To set the focus to a particular widget in the root, it is usually more convenient to use [method@Gtk.Widget.grab_focus] instead of this function.

    • @p focus is widget to be the new focus widget, or %NULL to unset the focus widget.
    • @r None.