<?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 index-Objects-Grouped SYSTEM "objects_grouped.sgml"-->
<refentry id="GtkMenuToolButton">
<refmeta>
<refentrytitle role="top_of_page" id="GtkMenuToolButton.top_of_page">GtkMenuToolButton</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkMenuToolButton</refname>
<refpurpose>A GtkToolItem containing a button with an additional dropdown menu</refpurpose>
</refnamediv>

<refsynopsisdiv id="GtkMenuToolButton.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gtk/gtk.h&gt;

                    <link linkend="GtkMenuToolButton-struct">GtkMenuToolButton</link>;
<link linkend="GtkToolItem">GtkToolItem</link> *       <link linkend="gtk-menu-tool-button-new">gtk_menu_tool_button_new</link>            (<link linkend="GtkWidget">GtkWidget</link> *icon_widget,
                                                         const <link linkend="gchar">gchar</link> *label);
<link linkend="GtkToolItem">GtkToolItem</link> *       <link linkend="gtk-menu-tool-button-new-from-stock">gtk_menu_tool_button_new_from_stock</link> (const <link linkend="gchar">gchar</link> *stock_id);
<link linkend="void">void</link>                <link linkend="gtk-menu-tool-button-set-menu">gtk_menu_tool_button_set_menu</link>       (<link linkend="GtkMenuToolButton">GtkMenuToolButton</link> *button,
                                                         <link linkend="GtkWidget">GtkWidget</link> *menu);
<link linkend="GtkWidget">GtkWidget</link> *         <link linkend="gtk-menu-tool-button-get-menu">gtk_menu_tool_button_get_menu</link>       (<link linkend="GtkMenuToolButton">GtkMenuToolButton</link> *button);
<link linkend="void">void</link>                <link linkend="gtk-menu-tool-button-set-arrow-tooltip">gtk_menu_tool_button_set_arrow_tooltip</link>
                                                        (<link linkend="GtkMenuToolButton">GtkMenuToolButton</link> *button,
                                                         <link linkend="GtkTooltips">GtkTooltips</link> *tooltips,
                                                         const <link linkend="gchar">gchar</link> *tip_text,
                                                         const <link linkend="gchar">gchar</link> *tip_private);
<link linkend="void">void</link>                <link linkend="gtk-menu-tool-button-set-arrow-tooltip-text">gtk_menu_tool_button_set_arrow_tooltip_text</link>
                                                        (<link linkend="GtkMenuToolButton">GtkMenuToolButton</link> *button,
                                                         const <link linkend="gchar">gchar</link> *text);
<link linkend="void">void</link>                <link linkend="gtk-menu-tool-button-set-arrow-tooltip-markup">gtk_menu_tool_button_set_arrow_tooltip_markup</link>
                                                        (<link linkend="GtkMenuToolButton">GtkMenuToolButton</link> *button,
                                                         const <link linkend="gchar">gchar</link> *markup);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GtkMenuToolButton.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----<link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
         +----<link linkend="GtkObject">GtkObject</link>
               +----<link linkend="GtkWidget">GtkWidget</link>
                     +----<link linkend="GtkContainer">GtkContainer</link>
                           +----<link linkend="GtkBin">GtkBin</link>
                                 +----<link linkend="GtkToolItem">GtkToolItem</link>
                                       +----<link linkend="GtkToolButton">GtkToolButton</link>
                                             +----GtkMenuToolButton
</synopsis>
</refsect1>



<refsect1 id="GtkMenuToolButton.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkMenuToolButton implements
 <link linkend="GtkActivatable">GtkActivatable</link>,  <link linkend="AtkImplementorIface">AtkImplementorIface</link> and  <link linkend="GtkBuildable">GtkBuildable</link>.</para>
</refsect1>


<refsect1 id="GtkMenuToolButton.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GtkMenuToolButton--menu">menu</link>&quot;                     <link linkend="GtkMenu">GtkMenu</link>*              : Read / Write
</synopsis>
</refsect1>

<refsect1 id="GtkMenuToolButton.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GtkMenuToolButton-show-menu">show-menu</link>&quot;                                      : Run First
</synopsis>
</refsect1>


<refsect1 id="GtkMenuToolButton.description" role="desc">
<title role="desc.title">Description</title>
<para>
  A <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link> is a <link linkend="GtkToolItem"><type>GtkToolItem</type></link> that contains a button and
  a small additional button with an arrow. When clicked, the arrow
  button pops up a dropdown menu.
</para>
<para>
  Use <link linkend="gtk-menu-tool-button-new"><function>gtk_menu_tool_button_new()</function></link> to create a new
  <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link>. Use <link linkend="gtk-menu-tool-button-new-from-stock"><function>gtk_menu_tool_button_new_from_stock()</function></link> to
  create a new <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link> containing a stock item.
</para>
</refsect1>

<refsect1 id="GtkMenuToolButton.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GtkMenuToolButton-struct" role="struct">
<title>GtkMenuToolButton</title>
<indexterm zone="GtkMenuToolButton-struct"><primary sortas="MenuToolButton">GtkMenuToolButton</primary></indexterm><programlisting>typedef struct _GtkMenuToolButton GtkMenuToolButton;</programlisting>
<para>
  The <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link> struct contains only private data and
  should only be accessed through the functions described below.
</para></refsect2>
<refsect2 id="gtk-menu-tool-button-new" role="function" condition="since:2.6">
<title>gtk_menu_tool_button_new ()</title>
<indexterm zone="gtk-menu-tool-button-new" role="2.6"><primary sortas="menu_tool_button_new">gtk_menu_tool_button_new</primary></indexterm><programlisting><link linkend="GtkToolItem">GtkToolItem</link> *       gtk_menu_tool_button_new            (<link linkend="GtkWidget">GtkWidget</link> *icon_widget,
                                                         const <link linkend="gchar">gchar</link> *label);</programlisting>
<para>
Creates a new <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link> using <parameter>icon_widget</parameter> as icon and
<parameter>label</parameter> as label.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>icon_widget</parameter>&#160;:</term>
<listitem><simpara> a widget that will be used as icon widget, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>label</parameter>&#160;:</term>
<listitem><simpara> a string that will be used as label, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the new <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.6</para></refsect2>
<refsect2 id="gtk-menu-tool-button-new-from-stock" role="function" condition="since:2.6">
<title>gtk_menu_tool_button_new_from_stock ()</title>
<indexterm zone="gtk-menu-tool-button-new-from-stock" role="2.6"><primary sortas="menu_tool_button_new_from_stock">gtk_menu_tool_button_new_from_stock</primary></indexterm><programlisting><link linkend="GtkToolItem">GtkToolItem</link> *       gtk_menu_tool_button_new_from_stock (const <link linkend="gchar">gchar</link> *stock_id);</programlisting>
<para>
Creates a new <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link>.
The new <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link> will contain an icon and label from
the stock item indicated by <parameter>stock_id</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>stock_id</parameter>&#160;:</term>
<listitem><simpara> the name of a stock item
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the new <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.6</para></refsect2>
<refsect2 id="gtk-menu-tool-button-set-menu" role="function" condition="since:2.6">
<title>gtk_menu_tool_button_set_menu ()</title>
<indexterm zone="gtk-menu-tool-button-set-menu" role="2.6"><primary sortas="menu_tool_button_set_menu">gtk_menu_tool_button_set_menu</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_tool_button_set_menu       (<link linkend="GtkMenuToolButton">GtkMenuToolButton</link> *button,
                                                         <link linkend="GtkWidget">GtkWidget</link> *menu);</programlisting>
<para>
Sets the <link linkend="GtkMenu"><type>GtkMenu</type></link> that is popped up when the user clicks on the arrow.
If <parameter>menu</parameter> is NULL, the arrow button becomes insensitive.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>button</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>menu</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GtkMenu"><type>GtkMenu</type></link> associated with <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.6</para></refsect2>
<refsect2 id="gtk-menu-tool-button-get-menu" role="function" condition="since:2.6">
<title>gtk_menu_tool_button_get_menu ()</title>
<indexterm zone="gtk-menu-tool-button-get-menu" role="2.6"><primary sortas="menu_tool_button_get_menu">gtk_menu_tool_button_get_menu</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link> *         gtk_menu_tool_button_get_menu       (<link linkend="GtkMenuToolButton">GtkMenuToolButton</link> *button);</programlisting>
<para>
Gets the <link linkend="GtkMenu"><type>GtkMenu</type></link> associated with <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>button</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GtkMenu"><type>GtkMenu</type></link> associated with <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.6</para></refsect2>
<refsect2 id="gtk-menu-tool-button-set-arrow-tooltip" role="function" condition="deprecated|since:2.6">
<title>gtk_menu_tool_button_set_arrow_tooltip ()</title>
<indexterm zone="gtk-menu-tool-button-set-arrow-tooltip" role="deprecated"><primary sortas="menu_tool_button_set_arrow_tooltip">gtk_menu_tool_button_set_arrow_tooltip</primary></indexterm><indexterm zone="gtk-menu-tool-button-set-arrow-tooltip" role="2.6"><primary sortas="menu_tool_button_set_arrow_tooltip">gtk_menu_tool_button_set_arrow_tooltip</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_tool_button_set_arrow_tooltip
                                                        (<link linkend="GtkMenuToolButton">GtkMenuToolButton</link> *button,
                                                         <link linkend="GtkTooltips">GtkTooltips</link> *tooltips,
                                                         const <link linkend="gchar">gchar</link> *tip_text,
                                                         const <link linkend="gchar">gchar</link> *tip_private);</programlisting>
<warning><para><literal>gtk_menu_tool_button_set_arrow_tooltip</literal> has been deprecated since version 2.12 and should not be used in newly-written code. Use <link linkend="gtk-menu-tool-button-set-arrow-tooltip-text"><function>gtk_menu_tool_button_set_arrow_tooltip_text()</function></link>
instead.</para></warning>
<para>
Sets the <link linkend="GtkTooltips"><type>GtkTooltips</type></link> object to be used for arrow button which
pops up the menu. See <link linkend="gtk-tool-item-set-tooltip"><function>gtk_tool_item_set_tooltip()</function></link> for setting
a tooltip on the whole <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>button</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tooltips</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GtkTooltips"><type>GtkTooltips</type></link> object to be used
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tip_text</parameter>&#160;:</term>
<listitem><simpara> text to be used as tooltip text for tool_item
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tip_private</parameter>&#160;:</term>
<listitem><simpara> text to be used as private tooltip text
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.6</para></refsect2>
<refsect2 id="gtk-menu-tool-button-set-arrow-tooltip-text" role="function" condition="since:2.12">
<title>gtk_menu_tool_button_set_arrow_tooltip_text ()</title>
<indexterm zone="gtk-menu-tool-button-set-arrow-tooltip-text" role="2.12"><primary sortas="menu_tool_button_set_arrow_tooltip_text">gtk_menu_tool_button_set_arrow_tooltip_text</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_tool_button_set_arrow_tooltip_text
                                                        (<link linkend="GtkMenuToolButton">GtkMenuToolButton</link> *button,
                                                         const <link linkend="gchar">gchar</link> *text);</programlisting>
<para>
Sets the tooltip text to be used as tooltip for the arrow button which
pops up the menu.  See <link linkend="gtk-tool-item-set-tooltip"><function>gtk_tool_item_set_tooltip()</function></link> for setting a tooltip
on the whole <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>button</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> text to be used as tooltip text for button's arrow button
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.12</para></refsect2>
<refsect2 id="gtk-menu-tool-button-set-arrow-tooltip-markup" role="function" condition="since:2.12">
<title>gtk_menu_tool_button_set_arrow_tooltip_markup ()</title>
<indexterm zone="gtk-menu-tool-button-set-arrow-tooltip-markup" role="2.12"><primary sortas="menu_tool_button_set_arrow_tooltip_markup">gtk_menu_tool_button_set_arrow_tooltip_markup</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_tool_button_set_arrow_tooltip_markup
                                                        (<link linkend="GtkMenuToolButton">GtkMenuToolButton</link> *button,
                                                         const <link linkend="gchar">gchar</link> *markup);</programlisting>
<para>
Sets the tooltip markup text to be used as tooltip for the arrow button
which pops up the menu.  See <link linkend="gtk-tool-item-set-tooltip"><function>gtk_tool_item_set_tooltip()</function></link> for setting a
tooltip on the whole <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>button</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>markup</parameter>&#160;:</term>
<listitem><simpara> markup text to be used as tooltip text for button's arrow button
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.12</para></refsect2>

</refsect1>
<refsect1 id="GtkMenuToolButton.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkMenuToolButton--menu" role="property"><title>The <literal>&quot;menu&quot;</literal> property</title>
<indexterm zone="GtkMenuToolButton--menu"><primary sortas="MenuToolButton:menu">GtkMenuToolButton:menu</primary></indexterm><programlisting>  &quot;menu&quot;                     <link linkend="GtkMenu">GtkMenu</link>*              : Read / Write</programlisting>
<para>The dropdown menu.</para></refsect2>
</refsect1>

<refsect1 id="GtkMenuToolButton.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkMenuToolButton-show-menu" role="signal"><title>The <literal>&quot;show-menu&quot;</literal> signal</title>
<indexterm zone="GtkMenuToolButton-show-menu"><primary sortas="MenuToolButton::show-menu">GtkMenuToolButton::show-menu</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkMenuToolButton">GtkMenuToolButton</link> *button,
                                                        <link linkend="gpointer">gpointer</link>           user_data)      : Run First</programlisting>
<para>
The ::show-menu signal is emitted before the menu is shown.
</para>
<para>
It can be used to populate the menu on demand, using
<link linkend="gtk-menu-tool-button-get-menu"><function>gtk_menu_tool_button_get_menu()</function></link>. 
</para>
<para>
Note that even if you populate the menu dynamically in this way, 
you must set an empty menu on the <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link> beforehand,
since the arrow is made insensitive if the menu is not set.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>button</parameter>&#160;:</term>
<listitem><simpara> the object on which the signal is emitted
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>


<refsect1 id="GtkMenuToolButton.see-also">
<title>See Also</title>
<para>
  <variablelist>
    <varlistentry>
      <term><link linkend="GtkToolbar"><type>GtkToolbar</type></link></term>
      <listitem><para>The toolbar widget</para></listitem>
      <term><link linkend="GtkToolButton"><type>GtkToolButton</type></link></term>
      <listitem>
        <para>
          The parent class of <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link>. The properties
          "label_widget", "label", "icon_widget", and "stock_id" on
          <link linkend="GtkToolButton"><type>GtkToolButton</type></link> determine the label and icon used on
          <link linkend="GtkMenuToolButton"><type>GtkMenuToolButton</type></link><!-- -->s.
        </para>
      </listitem>
    </varlistentry>
  </variablelist>
</para>
</refsect1>

</refentry>
