<?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="GtkStatusbar">
<refmeta>
<refentrytitle role="top_of_page" id="GtkStatusbar.top_of_page">GtkStatusbar</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkStatusbar</refname>
<refpurpose>Report messages of minor importance to the user</refpurpose>
</refnamediv>

<refsect1 id="GtkStatusbar.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="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-statusbar-new">gtk_statusbar_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-statusbar-get-context-id">gtk_statusbar_get_context_id</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-statusbar-push">gtk_statusbar_push</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-statusbar-pop">gtk_statusbar_pop</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-statusbar-remove">gtk_statusbar_remove</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-statusbar-remove-all">gtk_statusbar_remove_all</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkStatusbar.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="signal_proto_type" colwidth="150px"/>
<colspec colname="signal_proto_name" colwidth="300px"/>
<colspec colname="signal_proto_flags" colwidth="200px"/>
<tbody>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkStatusbar-text-popped">text-popped</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkStatusbar-text-pushed">text-pushed</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkStatusbar.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="GtkStatusbar-struct">GtkStatusbar</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkStatusbar.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkWidget">GtkWidget</link>
            <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkStatusbar
</screen>
</refsect1>
<refsect1 id="GtkStatusbar.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkStatusbar implements
 <link linkend="AtkImplementorIface">AtkImplementorIface</link>,  <link linkend="GtkBuildable">GtkBuildable</link> and  <link linkend="GtkConstraintTarget">GtkConstraintTarget</link>.</para>

</refsect1>

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

<refsect1 id="GtkStatusbar.description" role="desc">
<title role="desc.title">Description</title>
<para>A <link linkend="GtkStatusbar"><type>GtkStatusbar</type></link> is usually placed along the bottom of an application's
main <link linkend="GtkWindow"><type>GtkWindow</type></link>. It may provide a regular commentary of the application's
status (as is usually the case in a web browser, for example), or may be
used to simply output a message when the status changes, (when an upload
is complete in an FTP client, for example).</para>
<para>Status bars in GTK+ maintain a stack of messages. The message at
the top of the each bar’s stack is the one that will currently be displayed.</para>
<para>Any messages added to a statusbar’s stack must specify a
context id that is used to uniquely identify
the source of a message. This context id can be generated by
<link linkend="gtk-statusbar-get-context-id"><function>gtk_statusbar_get_context_id()</function></link>, given a message and the statusbar that
it will be added to. Note that messages are stored in a stack, and when
choosing which message to display, the stack structure is adhered to,
regardless of the context identifier of a message.</para>
<para>One could say that a statusbar maintains one stack of messages for
display purposes, but allows multiple message producers to maintain
sub-stacks of the messages they produced (via context ids).</para>
<para>Status bars are created using <link linkend="gtk-statusbar-new"><function>gtk_statusbar_new()</function></link>.</para>
<para>Messages are added to the bar’s stack with <link linkend="gtk-statusbar-push"><function>gtk_statusbar_push()</function></link>.</para>
<para>The message at the top of the stack can be removed using
<link linkend="gtk-statusbar-pop"><function>gtk_statusbar_pop()</function></link>. A message can be removed from anywhere in the
stack if its message id was recorded at the time it was added. This
is done using <link linkend="gtk-statusbar-remove"><function>gtk_statusbar_remove()</function></link>.</para>
<refsect2><title>CSS node</title><para>GtkStatusbar has a single CSS node with name statusbar.</para>
</refsect2>

</refsect1>
<refsect1 id="GtkStatusbar.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-statusbar-new" role="function">
<title>gtk_statusbar_new&#160;()</title>
<indexterm zone="gtk-statusbar-new"><primary>gtk_statusbar_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_statusbar_new (<parameter><type>void</type></parameter>);</programlisting>
<para>Creates a new <link linkend="GtkStatusbar"><type>GtkStatusbar</type></link> ready for messages.</para>
<refsect3 id="gtk-statusbar-new.returns" role="returns">
<title>Returns</title>
<para> the new <link linkend="GtkStatusbar"><type>GtkStatusbar</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-statusbar-get-context-id" role="function">
<title>gtk_statusbar_get_context_id&#160;()</title>
<indexterm zone="gtk-statusbar-get-context-id"><primary>gtk_statusbar_get_context_id</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
gtk_statusbar_get_context_id (<parameter><link linkend="GtkStatusbar"><type>GtkStatusbar</type></link> *statusbar</parameter>,
                              <parameter>const <link linkend="gchar"><type>gchar</type></link> *context_description</parameter>);</programlisting>
<para>Returns a new context identifier, given a description 
of the actual context. Note that the description is 
not shown in the UI.</para>
<refsect3 id="gtk-statusbar-get-context-id.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>statusbar</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkStatusbar"><type>GtkStatusbar</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>context_description</para></entry>
<entry role="parameter_description"><para>textual description of what context
the new message is being used in</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-statusbar-get-context-id.returns" role="returns">
<title>Returns</title>
<para> an integer id</para>
</refsect3></refsect2>
<refsect2 id="gtk-statusbar-push" role="function">
<title>gtk_statusbar_push&#160;()</title>
<indexterm zone="gtk-statusbar-push"><primary>gtk_statusbar_push</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
gtk_statusbar_push (<parameter><link linkend="GtkStatusbar"><type>GtkStatusbar</type></link> *statusbar</parameter>,
                    <parameter><link linkend="guint"><type>guint</type></link> context_id</parameter>,
                    <parameter>const <link linkend="gchar"><type>gchar</type></link> *text</parameter>);</programlisting>
<para>Pushes a new message onto a statusbar’s stack.</para>
<refsect3 id="gtk-statusbar-push.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>statusbar</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkStatusbar"><type>GtkStatusbar</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>context_id</para></entry>
<entry role="parameter_description"><para>the message’s context id, as returned by
<link linkend="gtk-statusbar-get-context-id"><function>gtk_statusbar_get_context_id()</function></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>text</para></entry>
<entry role="parameter_description"><para>the message to add to the statusbar</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-statusbar-push.returns" role="returns">
<title>Returns</title>
<para> a message id that can be used with
<link linkend="gtk-statusbar-remove"><function>gtk_statusbar_remove()</function></link>.</para>
</refsect3></refsect2>
<refsect2 id="gtk-statusbar-pop" role="function">
<title>gtk_statusbar_pop&#160;()</title>
<indexterm zone="gtk-statusbar-pop"><primary>gtk_statusbar_pop</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_statusbar_pop (<parameter><link linkend="GtkStatusbar"><type>GtkStatusbar</type></link> *statusbar</parameter>,
                   <parameter><link linkend="guint"><type>guint</type></link> context_id</parameter>);</programlisting>
<para>Removes the first message in the <link linkend="GtkStatusbar"><type>GtkStatusbar</type></link>’s stack
with the given context id. </para>
<para>Note that this may not change the displayed message, if 
the message at the top of the stack has a different 
context id.</para>
<refsect3 id="gtk-statusbar-pop.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>statusbar</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkStatusbar"><type>GtkStatusbar</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>context_id</para></entry>
<entry role="parameter_description"><para>a context identifier</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-statusbar-remove" role="function">
<title>gtk_statusbar_remove&#160;()</title>
<indexterm zone="gtk-statusbar-remove"><primary>gtk_statusbar_remove</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_statusbar_remove (<parameter><link linkend="GtkStatusbar"><type>GtkStatusbar</type></link> *statusbar</parameter>,
                      <parameter><link linkend="guint"><type>guint</type></link> context_id</parameter>,
                      <parameter><link linkend="guint"><type>guint</type></link> message_id</parameter>);</programlisting>
<para>Forces the removal of a message from a statusbar’s stack. 
The exact <parameter>context_id</parameter>
 and <parameter>message_id</parameter>
 must be specified.</para>
<refsect3 id="gtk-statusbar-remove.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>statusbar</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkStatusbar"><type>GtkStatusbar</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>context_id</para></entry>
<entry role="parameter_description"><para>a context identifier</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>message_id</para></entry>
<entry role="parameter_description"><para>a message identifier, as returned by <link linkend="gtk-statusbar-push"><function>gtk_statusbar_push()</function></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-statusbar-remove-all" role="function">
<title>gtk_statusbar_remove_all&#160;()</title>
<indexterm zone="gtk-statusbar-remove-all"><primary>gtk_statusbar_remove_all</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_statusbar_remove_all (<parameter><link linkend="GtkStatusbar"><type>GtkStatusbar</type></link> *statusbar</parameter>,
                          <parameter><link linkend="guint"><type>guint</type></link> context_id</parameter>);</programlisting>
<para>Forces the removal of all messages from a statusbar's
stack with the exact <parameter>context_id</parameter>
.</para>
<refsect3 id="gtk-statusbar-remove-all.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>statusbar</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkStatusbar"><type>GtkStatusbar</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>context_id</para></entry>
<entry role="parameter_description"><para>a context identifier</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

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

</refsect1>
<refsect1 id="GtkStatusbar.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkStatusbar-text-popped" role="signal"><title>The <literal>“text-popped”</literal> signal</title>
<indexterm zone="GtkStatusbar-text-popped"><primary>GtkStatusbar::text-popped</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkStatusbar"><type>GtkStatusbar</type></link> *statusbar,
               <link linkend="guint"><type>guint</type></link>         context_id,
               <link linkend="gchar"><type>gchar</type></link>        *text,
               <link linkend="gpointer"><type>gpointer</type></link>      user_data)</programlisting>
<para>Is emitted whenever a new message is popped off a statusbar's stack.</para>
<refsect3 id="GtkStatusbar-text-popped.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>statusbar</para></entry>
<entry role="parameter_description"><para>the object which received the signal</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>context_id</para></entry>
<entry role="parameter_description"><para>the context id of the relevant message/statusbar</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>text</para></entry>
<entry role="parameter_description"><para>the message that was just popped</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2><refsect2 id="GtkStatusbar-text-pushed" role="signal"><title>The <literal>“text-pushed”</literal> signal</title>
<indexterm zone="GtkStatusbar-text-pushed"><primary>GtkStatusbar::text-pushed</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkStatusbar"><type>GtkStatusbar</type></link> *statusbar,
               <link linkend="guint"><type>guint</type></link>         context_id,
               <link linkend="gchar"><type>gchar</type></link>        *text,
               <link linkend="gpointer"><type>gpointer</type></link>      user_data)</programlisting>
<para>Is emitted whenever a new message gets pushed onto a statusbar's stack.</para>
<refsect3 id="GtkStatusbar-text-pushed.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>statusbar</para></entry>
<entry role="parameter_description"><para>the object which received the signal</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>context_id</para></entry>
<entry role="parameter_description"><para>the context id of the relevant message/statusbar</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>text</para></entry>
<entry role="parameter_description"><para>the message that was pushed</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2>
</refsect1>

</refentry>
