gtkmm 4.14.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gtk::Root Class Reference

Interface for root widgets. More...

#include <gtkmm/root.h>

Inheritance diagram for Gtk::Root:
Inheritance graph
[legend]

Public Member Functions

 Root (Root && src) noexcept
 
Rootoperator= (Root && src) noexcept
 
 ~Root () noexcept override
 
GtkRoot * gobj ()
 Provides access to the underlying C GObject. More...
 
const GtkRoot * gobj () const
 Provides access to the underlying C GObject. More...
 
Glib::RefPtr< Gdk::Displayget_display ()
 Returns the display that this Gtk::Root is on. More...
 
Glib::RefPtr< const Gdk::Displayget_display () const
 Returns the display that this Gtk::Root is on. More...
 
void set_focus (Widget & focus)
 If focus is not the current focus widget, and is focusable, sets it as the focus widget for the root. More...
 
void unset_focus ()
 Unsets the focus widget for the root. More...
 
Widgetget_focus ()
 Retrieves the current focused widget within the root. More...
 
const Widgetget_focus () const
 Retrieves the current focused widget within the root. More...
 

Static Public Member Functions

static void add_interface (GType gtype_implementer)
 
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 

Protected Member Functions

 Root ()
 You should derive from this class to use it. More...
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gtk::Rootwrap (GtkRoot * object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

Detailed Description

Interface for root widgets.

Gtk::Root is the interface implemented by all widgets that can act as a toplevel widget to a hierarchy of widgets. 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 Gtk::Root is Gtk::Window.

See also
Gtk::Window
Since gtkmm 3.96:

Constructor & Destructor Documentation

◆ Root() [1/2]

Gtk::Root::Root ( )
protected

You should derive from this class to use it.

◆ Root() [2/2]

Gtk::Root::Root ( Root &&  src)
noexcept

◆ ~Root()

Gtk::Root::~Root ( )
overridenoexcept

Member Function Documentation

◆ add_interface()

static void Gtk::Root::add_interface ( GType  gtype_implementer)
static

◆ get_display() [1/2]

Glib::RefPtr< Gdk::Display > Gtk::Root::get_display ( )

Returns the display that this Gtk::Root is on.

Returns
The display of root.

◆ get_display() [2/2]

Glib::RefPtr< const Gdk::Display > Gtk::Root::get_display ( ) const

Returns the display that this Gtk::Root is on.

Returns
The display of root.

◆ get_focus() [1/2]

Widget * Gtk::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.

Returns
The currently focused widget.

◆ get_focus() [2/2]

const Widget * Gtk::Root::get_focus ( ) const

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.

Returns
The currently focused widget.

◆ get_type()

static GType Gtk::Root::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ gobj() [1/2]

GtkRoot * Gtk::Root::gobj ( )
inline

Provides access to the underlying C GObject.

◆ gobj() [2/2]

const GtkRoot * Gtk::Root::gobj ( ) const
inline

Provides access to the underlying C GObject.

◆ operator=()

Root & Gtk::Root::operator= ( Root &&  src)
noexcept

◆ set_focus()

void Gtk::Root::set_focus ( Widget focus)

If focus is not the current focus widget, and is focusable, sets it as the focus widget for the root.

To set the focus to a particular widget in the root, it is usually more convenient to use Gtk::Widget::grab_focus() instead of this function.

Parameters
focusWidget to be the new focus widget.

◆ unset_focus()

void Gtk::Root::unset_focus ( )

Unsets the focus widget for the root.

Friends And Related Function Documentation

◆ wrap()

Glib::RefPtr< Gtk::Root > wrap ( GtkRoot *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.