<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Gtk::Menu class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#ffffff"> <table border="0" width="100%"> <tr> <td width="10%" height="40"><img src="../../images/gtkmm_logo.gif" alt="logo" border="0" width="100%" height="100%"/></td> <td width="90%" height="40"><img src="../../images/top.gif" alt="top" width="100%" height="40"/></td> </tr> </table> <center> <a class="qindex" href="../../index.html">Main Page</a> <a href="group__Widgets.html">Widgets</a> <a class="qindex" href="namespaces.html"> Namespaces</a> <a href="../../tutorial/html/index.html"> Book</a> </center> <hr width="100%"/> <!-- Generated by Doxygen 1.3-rc1 --> <h1>Gtk::Menu Class Reference<br> <small> [<a class="el" href="group__Widgets.html">Widgets</a>, <a class="el" href="group__Menus.html">Menu classes</a>]</small> </h1>A drop-down menu consisting of <a class="el" href="classGtk_1_1MenuItem.html">Gtk::MenuItem</a> objects which can be navigated and activated by the user to perform application functions. <a href="#_details">More...</a> <p> Inheritance diagram for Gtk::Menu:<p><center><img src="classGtk_1_1Menu__inherit__graph.png" border="0" usemap="#Gtk_1_1Menu__inherit__map" alt="Inheritance graph"></center> <map name="Gtk_1_1Menu__inherit__map"> <area href="classGtk_1_1MenuShell.html" shape="rect" coords="12,363,111,382" alt=""> <area href="classGtk_1_1Container.html" shape="rect" coords="13,294,109,313" alt=""> <area href="classGtk_1_1Widget.html" shape="rect" coords="23,225,100,243" alt=""> <area href="classGtk_1_1Object.html" shape="rect" coords="23,155,100,174" alt=""> <area href="classGlib_1_1Object.html" shape="rect" coords="21,86,101,105" alt=""> <area href="classGlib_1_1ObjectBase.html" shape="rect" coords="7,17,116,35" alt=""> </map> <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classGtk_1_1Menu-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> <tr><td></td></tr> <tr><td colspan=2><br><h2>Public Types</h2></td></tr> <tr><td nowrap align=right valign=top>typedef SigC::Slot3< void,<br> int&, int&, bool& > </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#s0">SlotPositionCalc</a></td></tr> <tr><td> </td><td><font size=-1><em>void on_menu_position(int&, int&, bool& push_in);</em> <a href="#s0"></a><em></em></font><br><br></td></tr> <tr><td colspan=2><br><h2>Public Methods</h2></td></tr> <tr><td nowrap align=right valign=top>virtual </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a0">~Menu</a> ()</td></tr> <tr><td nowrap align=right valign=top>GtkMenu* </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a1">gobj</a> ()</td></tr> <tr><td nowrap align=right valign=top>const GtkMenu* </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a2">gobj</a> () const</td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a3">Menu</a> ()</td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a4">popup</a> (<a class="el" href="classGtk_1_1MenuShell.html">MenuShell</a>& parent_menu_shell, <a class="el" href="classGtk_1_1MenuItem.html">MenuItem</a>& parent_menu_item, GtkMenuPositionFunc func, gpointer data, guint button, guint32 activate_time)</td></tr> <tr><td> </td><td><font size=-1><em>Displays a menu and makes it available for selection.</em> <a href="#a4"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a5">popup</a> (const <a class="el" href="classGtk_1_1Menu.html#s0">SlotPositionCalc</a>& position_calc_slot, guint button, guint32 activate_time)</td></tr> <tr><td> </td><td><font size=-1><em>Displays a menu and makes it available for selection.</em> <a href="#a5"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a6">popup</a> (guint button, guint32 activate_time)</td></tr> <tr><td> </td><td><font size=-1><em>Displays a menu and makes it available for selection.</em> <a href="#a6"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a7">reposition</a> ()</td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a8">popdown</a> ()</td></tr> <tr><td nowrap align=right valign=top><a class="el" href="classGtk_1_1MenuItem.html">MenuItem</a>* </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a9">get_active</a> ()</td></tr> <tr><td nowrap align=right valign=top>const <a class="el" href="classGtk_1_1MenuItem.html">MenuItem</a>* </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a10">get_active</a> () const</td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a11">set_active</a> (guint index)</td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a12">set_accel_group</a> (const <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><<a class="el" href="classGtk_1_1AccelGroup.html">AccelGroup</a>>& accel_group)</td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a13">unset_accel_group</a> ()</td></tr> <tr><td nowrap align=right valign=top><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><<a class="el" href="classGtk_1_1AccelGroup.html">AccelGroup</a>> </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a14">get_accel_group</a> ()</td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a15">set_accel_path</a> (const <a class="el" href="classGlib_1_1ustring.html">Glib::ustring</a>& accel_path)</td></tr> <tr><td> </td><td><font size=-1><em>Sets an accelerator path for this menu from which accelerator paths for its immediate children, its menu items, can be constructed.</em> <a href="#a15"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a16">detach</a> ()</td></tr> <tr><td nowrap align=right valign=top><a class="el" href="classGtk_1_1Widget.html">Widget</a>* </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a17">get_attach_widget</a> ()</td></tr> <tr><td nowrap align=right valign=top>const <a class="el" href="classGtk_1_1Widget.html">Widget</a>* </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a18">get_attach_widget</a> () const</td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a19">set_tearoff_state</a> (bool torn_off=true)</td></tr> <tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a20">get_tearoff_state</a> () const</td></tr> <tr><td> </td><td><font size=-1><em>Returns whether the menu is torn off.</em> <a href="#a20"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a21">set_title</a> (const <a class="el" href="classGlib_1_1ustring.html">Glib::ustring</a>& title)</td></tr> <tr><td> </td><td><font size=-1><em>Sets the title string for the menu.</em> <a href="#a21"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a22">unset_title</a> ()</td></tr> <tr><td nowrap align=right valign=top><a class="el" href="classGlib_1_1ustring.html">Glib::ustring</a> </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a23">get_title</a> () const</td></tr> <tr><td> </td><td><font size=-1><em>Returns the title of the menu.</em> <a href="#a23"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a24">set_screen</a> (const <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><<a class="el" href="classGdk_1_1Screen.html">Gdk::Screen</a>>& screen)</td></tr> <tr><td> </td><td><font size=-1><em>Sets the <a class="el" href="classGdk_1_1Screen.html">Gdk::Screen</a> on which the menu will be displayed.</em> <a href="#a24"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a25">reorder_child</a> (const <a class="el" href="classGtk_1_1MenuItem.html">MenuItem</a>& child, int position)</td></tr> <tr><td nowrap align=right valign=top><a class="el" href="classGlib_1_1PropertyProxy.html">Glib::PropertyProxy</a><<a class="el" href="classGlib_1_1ustring.html">Glib::ustring</a>> </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#a26">property_tearoff_title</a> ()</td></tr> <tr><td colspan=2><br><h2>Protected Methods</h2></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#b0">attach_to_widget</a> (<a class="el" href="classGtk_1_1Widget.html">Widget</a>& widget, GtkMenuDetachFunc detacher)</td></tr> <tr><td colspan=2><br><h2>Related Functions</h2></td></tr> <tr><td colspan=2>(Note that these are not member functions.)<br><br></td></tr> <tr><td nowrap align=right valign=top>Gtk::Menu* </td><td valign=bottom><a class="el" href="classGtk_1_1Menu.html#k0">wrap</a> (GtkMenu* object, bool take_copy=false)</td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> A drop-down menu consisting of <a class="el" href="classGtk_1_1MenuItem.html">Gtk::MenuItem</a> objects which can be navigated and activated by the user to perform application functions. <p> Menus are normally placed inside a <a class="el" href="classGtk_1_1MenuBar.html">Gtk::MenuBar</a> or another <a class="el" href="classGtk_1_1MenuItem.html">MenuItem</a> as a sub menu. A <a class="el" href="classGtk_1_1Menu.html">Menu</a> can also be popped up, for instance as a right-click context menu, by calling the <a class="el" href="classGtk_1_1Menu.html#a4">popup()</a> method. See also <a class="el" href="classGtk_1_1OptionMenu.html">Gtk::OptionMenu</a>. <p> <hr><h2>Member Typedef Documentation</h2> <a name="s0" doxytag="Gtk::Menu::SlotPositionCalc"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> typedef SigC::Slot3<void, int&, int&, bool&> Gtk::Menu::SlotPositionCalc </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> void on_menu_position(int&, int&, bool& push_in); <p> </td> </tr> </table> <hr><h2>Constructor & Destructor Documentation</h2> <a name="a0" doxytag="Gtk::Menu::~Menu"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual Gtk::Menu::~Menu </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a3" doxytag="Gtk::Menu::Menu"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> Gtk::Menu::Menu </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <hr><h2>Member Function Documentation</h2> <a name="b0" doxytag="Gtk::Menu::attach_to_widget"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Gtk::Menu::attach_to_widget </td> <td class="md" valign="top">(</td> <td class="md" nowrap valign="top"><a class="el" href="classGtk_1_1Widget.html">Widget</a>& </td> <td class="mdname" nowrap> <em>widget</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>GtkMenuDetachFunc </td> <td class="mdname" nowrap> <em>detacher</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [protected]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a16" doxytag="Gtk::Menu::detach"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Gtk::Menu::detach </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a14" doxytag="Gtk::Menu::get_accel_group"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><<a class="el" href="classGtk_1_1AccelGroup.html">AccelGroup</a>> Gtk::Menu::get_accel_group </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a10" doxytag="Gtk::Menu::get_active"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> const <a class="el" href="classGtk_1_1MenuItem.html">MenuItem</a>* Gtk::Menu::get_active </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a9" doxytag="Gtk::Menu::get_active"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="classGtk_1_1MenuItem.html">MenuItem</a>* Gtk::Menu::get_active </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a18" doxytag="Gtk::Menu::get_attach_widget"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> const <a class="el" href="classGtk_1_1Widget.html">Widget</a>* Gtk::Menu::get_attach_widget </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a17" doxytag="Gtk::Menu::get_attach_widget"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="classGtk_1_1Widget.html">Widget</a>* Gtk::Menu::get_attach_widget </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a20" doxytag="Gtk::Menu::get_tearoff_state"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool Gtk::Menu::get_tearoff_state </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns whether the menu is torn off. <p> See <a class="el" href="classGtk_1_1Menu.html#a19">set_tearoff_state()</a>. <dl compact><dt><b>Returns:</b></dt><dd><code>true</code> if the menu is currently torn off. </dd></dl> </td> </tr> </table> <a name="a23" doxytag="Gtk::Menu::get_title"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="classGlib_1_1ustring.html">Glib::ustring</a> Gtk::Menu::get_title </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns the title of the menu. <p> See <a class="el" href="classGtk_1_1Menu.html#a21">set_title()</a>. <dl compact><dt><b>Returns:</b></dt><dd>The title of the menu, or <code>0</code> if the menu has no title set on it. This string is owned by the widget and should not be modified or freed. </dd></dl> </td> </tr> </table> <a name="a2" doxytag="Gtk::Menu::gobj"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> const GtkMenu* Gtk::Menu::gobj </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Reimplemented from <a class="el" href="classGtk_1_1MenuShell.html#a2">Gtk::MenuShell</a>. </td> </tr> </table> <a name="a1" doxytag="Gtk::Menu::gobj"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> GtkMenu* Gtk::Menu::gobj </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Reimplemented from <a class="el" href="classGtk_1_1MenuShell.html#a1">Gtk::MenuShell</a>. </td> </tr> </table> <a name="a8" doxytag="Gtk::Menu::popdown"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Gtk::Menu::popdown </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a6" doxytag="Gtk::Menu::popup"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Gtk::Menu::popup </td> <td class="md" valign="top">(</td> <td class="md" nowrap valign="top">guint </td> <td class="mdname" nowrap> <em>button</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>guint32 </td> <td class="mdname" nowrap> <em>activate_time</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Displays a menu and makes it available for selection. <p> Applications can use this function to display context-sensitive menus. The default menu positioning function will position the menu at the current pointer position. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>button</em> </td><td>The button which was pressed to initiate the event. </td></tr> <tr><td valign=top><em>activate_time</em> </td><td>The time at which the activation event occurred. </td></tr> </table> </dl> </td> </tr> </table> <a name="a5" doxytag="Gtk::Menu::popup"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Gtk::Menu::popup </td> <td class="md" valign="top">(</td> <td class="md" nowrap valign="top">const <a class="el" href="classGtk_1_1Menu.html#s0">SlotPositionCalc</a>& </td> <td class="mdname" nowrap> <em>position_calc_slot</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>guint </td> <td class="mdname" nowrap> <em>button</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>guint32 </td> <td class="mdname" nowrap> <em>activate_time</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Displays a menu and makes it available for selection. <p> </td> </tr> </table> <a name="a4" doxytag="Gtk::Menu::popup"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Gtk::Menu::popup </td> <td class="md" valign="top">(</td> <td class="md" nowrap valign="top"><a class="el" href="classGtk_1_1MenuShell.html">MenuShell</a>& </td> <td class="mdname" nowrap> <em>parent_menu_shell</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="classGtk_1_1MenuItem.html">MenuItem</a>& </td> <td class="mdname" nowrap> <em>parent_menu_item</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>GtkMenuPositionFunc </td> <td class="mdname" nowrap> <em>func</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>gpointer </td> <td class="mdname" nowrap> <em>data</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>guint </td> <td class="mdname" nowrap> <em>button</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>guint32 </td> <td class="mdname" nowrap> <em>activate_time</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Displays a menu and makes it available for selection. <p> Applications can use this function to display context-sensitive menus, and will typically supply <code>0</code> for the <em>parent_menu_shell</em> , <em>parent_menu_item</em> , <em>func</em> and <em>data</em> parameters. The default menu positioning function will position the menu at the current mouse cursor position. <p> The <em>button</em> parameter should be the mouse button pressed to initiate the menu popup. If the menu popup was initiated by something other than a mouse button press, such as a mouse button release or a keypress, <em>button</em> should be 0. <p> The <em>activate_time</em> parameter should be the time stamp of the event that initiated the popup. If such an event is not available, use gtk_get_current_event_time() instead. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>parent_menu_shell</em> </td><td>The menu shell containing the triggering menu item, or <code>0</code>. </td></tr> <tr><td valign=top><em>parent_menu_item</em> </td><td>The menu item whose activation triggered the popup, or <code>0</code>. </td></tr> <tr><td valign=top><em>func</em> </td><td>A user supplied function used to position the menu, or <code>0</code>. </td></tr> <tr><td valign=top><em>data</em> </td><td>User supplied data to be passed to <em>func</em> . </td></tr> <tr><td valign=top><em>button</em> </td><td>The mouse button which was pressed to initiate the event. </td></tr> <tr><td valign=top><em>activate_time</em> </td><td>The time at which the activation event occurred. </td></tr> </table> </dl> </td> </tr> </table> <a name="a26" doxytag="Gtk::Menu::property_tearoff_title"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="classGlib_1_1PropertyProxy.html">Glib::PropertyProxy</a><<a class="el" href="classGlib_1_1ustring.html">Glib::ustring</a>> Gtk::Menu::property_tearoff_title </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a25" doxytag="Gtk::Menu::reorder_child"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Gtk::Menu::reorder_child </td> <td class="md" valign="top">(</td> <td class="md" nowrap valign="top">const <a class="el" href="classGtk_1_1MenuItem.html">MenuItem</a>& </td> <td class="mdname" nowrap> <em>child</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>position</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a7" doxytag="Gtk::Menu::reposition"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Gtk::Menu::reposition </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a12" doxytag="Gtk::Menu::set_accel_group"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Gtk::Menu::set_accel_group </td> <td class="md" valign="top">(</td> <td class="md" nowrap valign="top">const <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><<a class="el" href="classGtk_1_1AccelGroup.html">AccelGroup</a>>& </td> <td class="mdname1" valign="top" nowrap> <em>accel_group</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a15" doxytag="Gtk::Menu::set_accel_path"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Gtk::Menu::set_accel_path </td> <td class="md" valign="top">(</td> <td class="md" nowrap valign="top">const <a class="el" href="classGlib_1_1ustring.html">Glib::ustring</a>& </td> <td class="mdname1" valign="top" nowrap> <em>accel_path</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Sets an accelerator path for this menu from which accelerator paths for its immediate children, its menu items, can be constructed. <p> The main purpose of this function is to spare the programmer the inconvenience of having to call <a class="el" href="classGtk_1_1MenuItem.html#a18">Gtk::MenuItem::set_accel_path()</a> on each menu item that should support runtime user changable accelerators. Instead, by just calling <a class="el" href="classGtk_1_1Menu.html#a15">set_accel_path()</a> on their parent, each menu item of this menu, that contains a label describing its purpose, automatically gets an accel path assigned. For example, a menu containing menu items "New" and "Exit", will, after <code>gtk_menu_set_accel_path (menu, "<Gnumeric-Sheet>/File");</code> has been called, assign its items the accel paths: <code>"<Gnumeric-Sheet>/File/New"</code> and <code>"<Gnumeric-Sheet>/File/Exit"</code>. Assigning accel paths to menu items then enables the user to change their accelerators at runtime. More details about accelerator paths and their default setups can be found at gtk_accel_map_add_entry(). <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>accel_path</em> </td><td>A valid accelerator path. </td></tr> </table> </dl> </td> </tr> </table> <a name="a11" doxytag="Gtk::Menu::set_active"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Gtk::Menu::set_active </td> <td class="md" valign="top">(</td> <td class="md" nowrap valign="top">guint </td> <td class="mdname1" valign="top" nowrap> <em>index</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a24" doxytag="Gtk::Menu::set_screen"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Gtk::Menu::set_screen </td> <td class="md" valign="top">(</td> <td class="md" nowrap valign="top">const <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><<a class="el" href="classGdk_1_1Screen.html">Gdk::Screen</a>>& </td> <td class="mdname1" valign="top" nowrap> <em>screen</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Sets the <a class="el" href="classGdk_1_1Screen.html">Gdk::Screen</a> on which the menu will be displayed. <p> Since: 2.2 <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>screen</em> </td><td>A <a class="el" href="classGdk_1_1Screen.html">Gdk::Screen</a>, or <code>0</code> if the screen should be determined by the widget the menu is attached to. </td></tr> </table> </dl> </td> </tr> </table> <a name="a19" doxytag="Gtk::Menu::set_tearoff_state"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Gtk::Menu::set_tearoff_state </td> <td class="md" valign="top">(</td> <td class="md" nowrap valign="top">bool </td> <td class="mdname1" valign="top" nowrap> <em>torn_off</em> = true </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a21" doxytag="Gtk::Menu::set_title"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Gtk::Menu::set_title </td> <td class="md" valign="top">(</td> <td class="md" nowrap valign="top">const <a class="el" href="classGlib_1_1ustring.html">Glib::ustring</a>& </td> <td class="mdname1" valign="top" nowrap> <em>title</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Sets the title string for the menu. <p> The title is displayed when the menu is shown as a tearoff menu. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>title</em> </td><td>A string containing the title for the menu. </td></tr> </table> </dl> </td> </tr> </table> <a name="a13" doxytag="Gtk::Menu::unset_accel_group"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Gtk::Menu::unset_accel_group </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="a22" doxytag="Gtk::Menu::unset_title"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Gtk::Menu::unset_title </td> <td class="md" valign="top">(</td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <hr><h2>Friends And Related Function Documentation</h2> <a name="k0" doxytag="Gtk::Menu::wrap"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> Gtk::Menu* wrap </td> <td class="md" valign="top">(</td> <td class="md" nowrap valign="top">GtkMenu* </td> <td class="mdname" nowrap> <em>object</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>bool </td> <td class="mdname" nowrap> <em>take_copy</em> = false</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [related]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <hr>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="menu_8h.html">menu.h</a></ul> <hr><address><small> Generated for gtkmm by <a href="http://www.doxygen.org/index.html"> Doxygen</a> 1.3-rc1 © 1997-2001</small></address> </body> </html>