<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
<!ENTITY pi "&#960;">
<!ENTITY solidus "&#8260;">
]>
<refentry id="GtkRoot">
<refmeta>
<refentrytitle role="top_of_page" id="GtkRoot.top_of_page">GtkRoot</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkRoot</refname>
<refpurpose>Interface for root widgets</refpurpose>
</refnamediv>

<refsect1 id="GtkRoot.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GdkDisplay"><returnvalue>GdkDisplay</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-root-get-display">gtk_root_get_display</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-root-get-focus">gtk_root_get_focus</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-root-set-focus">gtk_root_set_focus</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkRoot.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GtkRoot-struct">GtkRoot</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkRoot.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GInterface">GInterface</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkRoot
</screen>
</refsect1>
<refsect1 id="GtkRoot.prerequisites" role="prerequisites">
<title role="prerequisites.title">Prerequisites</title>
<para>
GtkRoot requires
 <link linkend="GtkNative">GtkNative</link> and  <link linkend="GtkWidget">GtkWidget</link>.</para>

</refsect1>
<refsect1 id="GtkRoot.implementations" role="implementations">
<title role="implementations.title">Known Implementations</title>
<para>
GtkRoot is implemented by
 <link linkend="GtkAboutDialog">GtkAboutDialog</link>,  <link linkend="GtkAppChooserDialog">GtkAppChooserDialog</link>,  <link linkend="GtkApplicationWindow">GtkApplicationWindow</link>,  <link linkend="GtkAssistant">GtkAssistant</link>,  <link linkend="GtkColorChooserDialog">GtkColorChooserDialog</link>,  <link linkend="GtkDialog">GtkDialog</link>,  <link linkend="GtkDragIcon">GtkDragIcon</link>,  <link linkend="GtkFileChooserDialog">GtkFileChooserDialog</link>,  <link linkend="GtkFontChooserDialog">GtkFontChooserDialog</link>,  <link linkend="GtkMessageDialog">GtkMessageDialog</link>,  <link linkend="GtkPageSetupUnixDialog">GtkPageSetupUnixDialog</link>,  <link linkend="GtkPrintUnixDialog">GtkPrintUnixDialog</link>,  <link linkend="GtkShortcutsWindow">GtkShortcutsWindow</link> and  <link linkend="GtkWindow">GtkWindow</link>.</para>

</refsect1>

<refsect1 id="GtkRoot.includes"><title>Includes</title><synopsis>#include &lt;gtk/gtk.h&gt;
</synopsis></refsect1>

<refsect1 id="GtkRoot.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="GtkRoot"><type>GtkRoot</type></link> 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.</para>
<para>The obvious example of a <link linkend="GtkRoot"><type>GtkRoot</type></link> is <link linkend="GtkWindow"><type>GtkWindow</type></link>.</para>

</refsect1>
<refsect1 id="GtkRoot.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-root-get-display" role="function">
<title>gtk_root_get_display&#160;()</title>
<indexterm zone="gtk-root-get-display"><primary>gtk_root_get_display</primary></indexterm>
<programlisting language="C"><link linkend="GdkDisplay"><returnvalue>GdkDisplay</returnvalue></link>&#160;*
gtk_root_get_display (<parameter><link linkend="GtkRoot"><type>GtkRoot</type></link> *self</parameter>);</programlisting>
<para>Returns the display that this GtkRoot is on.</para>
<refsect3 id="gtk-root-get-display.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkRoot"><type>GtkRoot</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-root-get-display.returns" role="returns">
<title>Returns</title>
<para>the display of <parameter>root</parameter>
. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-root-get-focus" role="function">
<title>gtk_root_get_focus&#160;()</title>
<indexterm zone="gtk-root-get-focus"><primary>gtk_root_get_focus</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_root_get_focus (<parameter><link linkend="GtkRoot"><type>GtkRoot</type></link> *self</parameter>);</programlisting>
<para>Retrieves the current focused widget within the root.</para>
<para>Note that this is the widget that would have the focus
if the root is active; if the root is not focused then
<literal>gtk_widget_has_focus (widget)</literal> will be <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> for the
widget.</para>
<refsect3 id="gtk-root-get-focus.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkRoot"><type>GtkRoot</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-root-get-focus.returns" role="returns">
<title>Returns</title>
<para>the currently focused widget,
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if there is none. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-root-set-focus" role="function">
<title>gtk_root_set_focus&#160;()</title>
<indexterm zone="gtk-root-set-focus"><primary>gtk_root_set_focus</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_root_set_focus (<parameter><link linkend="GtkRoot"><type>GtkRoot</type></link> *self</parameter>,
                    <parameter><link linkend="GtkWidget"><type>GtkWidget</type></link> *focus</parameter>);</programlisting>
<para>If <parameter>focus</parameter>
 is not the current focus widget, and is focusable, sets
it as the focus widget for the root. If <parameter>focus</parameter>
 is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, unsets
the focus widget for the root.</para>
<para>To set the focus to a particular widget in the root, it is usually
more convenient to use <link linkend="gtk-widget-grab-focus"><function>gtk_widget_grab_focus()</function></link> instead of this function.</para>
<refsect3 id="gtk-root-set-focus.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkRoot"><type>GtkRoot</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>focus</para></entry>
<entry role="parameter_description"><para>widget to be the new focus widget, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
to unset the focus widget. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GtkRoot.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkRoot-struct" role="struct">
<title>GtkRoot</title>
<indexterm zone="GtkRoot-struct"><primary>GtkRoot</primary></indexterm>
<programlisting language="C">typedef struct _GtkRoot GtkRoot;</programlisting>
</refsect2>

</refsect1>
<refsect1 id="GtkRoot.see-also">
<title>See Also</title>
<para><link linkend="GtkWindow"><type>GtkWindow</type></link></para>

</refsect1>

</refentry>
