Gnome::Gtk4::R-Root
Description
Gnome::Gtk4::R-Root is the interface implemented by all widgets that can act as a toplevel widget.
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 Gnome::Gtk4::R-Root is Gnome::Gtk4::Window.
To get the display to which a Gnome::Gtk4::R-Root belongs, use .get-display()
.
Gnome::Gtk4::R-Root also maintains the location of keyboard focus inside its widget hierarchy, with .set-focus()
and .get-focus()
.
Methods
get-display
Returns the display that this Gnome::Gtk4::R-Root is on.
method get-display (--> N-Object )
Return value; the display of $root
.
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.
method get-focus (--> N-Object )
Return value; the currently focused widget.
set-focus
If $focus
is not the current focus widget, and is focusable, sets it as the focus widget for the root.
If $focus
is undefined, 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 .grab-focus() in class Gnome::Gtk4::Widget
instead of this function.
method set-focus ( N-Object() $focus )
$focus; widget to be the new focus widget, or undefined to unset the focus widget.