gtk3/docs/reference/gtk/html/GtkMenu.html
2022-11-23 15:09:27 +00:00

2476 lines
135 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkMenu: GTK+ 3 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
<link rel="up" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar">
<link rel="prev" href="GtkComboBoxText.html" title="GtkComboBoxText">
<link rel="next" href="GtkMenuBar.html" title="GtkMenuBar">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#GtkMenu.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
<a href="#GtkMenu.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_interfaces">  <span class="dim">|</span> 
<a href="#GtkMenu.implemented-interfaces" class="shortcut">Implemented Interfaces</a></span><span id="nav_properties">  <span class="dim">|</span> 
<a href="#GtkMenu.properties" class="shortcut">Properties</a></span><span id="nav_child_properties">  <span class="dim">|</span> 
<a href="#GtkMenu.child-properties" class="shortcut">Child Properties</a></span><span id="nav_style_properties">  <span class="dim">|</span> 
<a href="#GtkMenu.style-properties" class="shortcut">Style Properties</a></span><span id="nav_signals">  <span class="dim">|</span> 
<a href="#GtkMenu.signals" class="shortcut">Signals</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="MenusAndCombos.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GtkComboBoxText.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GtkMenuBar.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GtkMenu"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GtkMenu.top_of_page"></a>GtkMenu</span></h2>
<p>GtkMenu — A menu widget</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GtkMenu.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-new" title="gtk_menu_new ()">gtk_menu_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-new-from-model" title="gtk_menu_new_from_model ()">gtk_menu_new_from_model</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-set-screen" title="gtk_menu_set_screen ()">gtk_menu_set_screen</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-reorder-child" title="gtk_menu_reorder_child ()">gtk_menu_reorder_child</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-attach" title="gtk_menu_attach ()">gtk_menu_attach</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-popup-at-rect" title="gtk_menu_popup_at_rect ()">gtk_menu_popup_at_rect</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-popup-at-widget" title="gtk_menu_popup_at_widget ()">gtk_menu_popup_at_widget</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-popup-at-pointer" title="gtk_menu_popup_at_pointer ()">gtk_menu_popup_at_pointer</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-popup-for-device" title="gtk_menu_popup_for_device ()">gtk_menu_popup_for_device</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-popup" title="gtk_menu_popup ()">gtk_menu_popup</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-set-accel-group" title="gtk_menu_set_accel_group ()">gtk_menu_set_accel_group</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup"><span class="returnvalue">GtkAccelGroup</span></a> *
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-get-accel-group" title="gtk_menu_get_accel_group ()">gtk_menu_get_accel_group</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-set-accel-path" title="gtk_menu_set_accel_path ()">gtk_menu_set_accel_path</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-get-accel-path" title="gtk_menu_get_accel_path ()">gtk_menu_get_accel_path</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-set-title" title="gtk_menu_set_title ()">gtk_menu_set_title</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-get-title" title="gtk_menu_get_title ()">gtk_menu_get_title</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-set-monitor" title="gtk_menu_set_monitor ()">gtk_menu_set_monitor</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gint</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-get-monitor" title="gtk_menu_get_monitor ()">gtk_menu_get_monitor</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-place-on-monitor" title="gtk_menu_place_on_monitor ()">gtk_menu_place_on_monitor</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-get-tearoff-state" title="gtk_menu_get_tearoff_state ()">gtk_menu_get_tearoff_state</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-set-reserve-toggle-size" title="gtk_menu_set_reserve_toggle_size ()">gtk_menu_set_reserve_toggle_size</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-get-reserve-toggle-size" title="gtk_menu_get_reserve_toggle_size ()">gtk_menu_get_reserve_toggle_size</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-popdown" title="gtk_menu_popdown ()">gtk_menu_popdown</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-reposition" title="gtk_menu_reposition ()">gtk_menu_reposition</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-get-active" title="gtk_menu_get_active ()">gtk_menu_get_active</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-set-active" title="gtk_menu_set_active ()">gtk_menu_set_active</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-set-tearoff-state" title="gtk_menu_set_tearoff_state ()">gtk_menu_set_tearoff_state</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-attach-to-widget" title="gtk_menu_attach_to_widget ()">gtk_menu_attach_to_widget</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-detach" title="gtk_menu_detach ()">gtk_menu_detach</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-get-attach-widget" title="gtk_menu_get_attach_widget ()">gtk_menu_get_attach_widget</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GList</span> *
</td>
<td class="function_name">
<a class="link" href="GtkMenu.html#gtk-menu-get-for-attach-widget" title="gtk_menu_get_for_attach_widget ()">gtk_menu_get_for_attach_widget</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GtkMenu.html#GtkMenuPositionFunc" title="GtkMenuPositionFunc ()">*GtkMenuPositionFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GtkMenu.html#GtkMenuDetachFunc" title="GtkMenuDetachFunc ()">*GtkMenuDetachFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkMenu.properties"></a><h2>Properties</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="properties_type">
<col width="300px" class="properties_name">
<col width="200px" class="properties_flags">
</colgroup>
<tbody>
<tr>
<td class="property_type">
<a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> *</td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--accel-group" title="The “accel-group” property">accel-group</a></td>
<td class="property_flags">Read / Write</td>
</tr>
<tr>
<td class="property_type">
<span class="type">char</span> *</td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--accel-path" title="The “accel-path” property">accel-path</a></td>
<td class="property_flags">Read / Write</td>
</tr>
<tr>
<td class="property_type"><span class="type">int</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--active" title="The “active” property">active</a></td>
<td class="property_flags">Read / Write</td>
</tr>
<tr>
<td class="property_type"><span class="type">GdkAnchorHints</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--anchor-hints" title="The “anchor-hints” property">anchor-hints</a></td>
<td class="property_flags">Read / Write / Construct</td>
</tr>
<tr>
<td class="property_type">
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *</td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--attach-widget" title="The “attach-widget” property">attach-widget</a></td>
<td class="property_flags">Read / Write</td>
</tr>
<tr>
<td class="property_type"><span class="type">GdkWindowTypeHint</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--menu-type-hint" title="The “menu-type-hint” property">menu-type-hint</a></td>
<td class="property_flags">Read / Write / Construct</td>
</tr>
<tr>
<td class="property_type"><span class="type">int</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--monitor" title="The “monitor” property">monitor</a></td>
<td class="property_flags">Read / Write</td>
</tr>
<tr>
<td class="property_type"><span class="type">int</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--rect-anchor-dx" title="The “rect-anchor-dx” property">rect-anchor-dx</a></td>
<td class="property_flags">Read / Write / Construct</td>
</tr>
<tr>
<td class="property_type"><span class="type">int</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--rect-anchor-dy" title="The “rect-anchor-dy” property">rect-anchor-dy</a></td>
<td class="property_flags">Read / Write / Construct</td>
</tr>
<tr>
<td class="property_type"><span class="type">gboolean</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--reserve-toggle-size" title="The “reserve-toggle-size” property">reserve-toggle-size</a></td>
<td class="property_flags">Read / Write</td>
</tr>
<tr>
<td class="property_type"><span class="type">gboolean</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--tearoff-state" title="The “tearoff-state” property">tearoff-state</a></td>
<td class="property_flags">Read / Write</td>
</tr>
<tr>
<td class="property_type">
<span class="type">char</span> *</td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--tearoff-title" title="The “tearoff-title” property">tearoff-title</a></td>
<td class="property_flags">Read / Write</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkMenu.child-properties"></a><h2>Child Properties</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="child_properties_type">
<col width="300px" class="child_properties_name">
<col width="200px" class="child_properties_flags">
</colgroup>
<tbody>
<tr>
<td class="property_type"><span class="type">int</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--c-bottom-attach" title="The “bottom-attach” child property">bottom-attach</a></td>
<td class="property_flags">Read / Write</td>
</tr>
<tr>
<td class="property_type"><span class="type">int</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--c-left-attach" title="The “left-attach” child property">left-attach</a></td>
<td class="property_flags">Read / Write</td>
</tr>
<tr>
<td class="property_type"><span class="type">int</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--c-right-attach" title="The “right-attach” child property">right-attach</a></td>
<td class="property_flags">Read / Write</td>
</tr>
<tr>
<td class="property_type"><span class="type">int</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--c-top-attach" title="The “top-attach” child property">top-attach</a></td>
<td class="property_flags">Read / Write</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkMenu.style-properties"></a><h2>Style Properties</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="style_properties_type">
<col width="300px" class="style_properties_name">
<col width="200px" class="style_properties_flags">
</colgroup>
<tbody>
<tr>
<td class="property_type"><a class="link" href="GtkMenu.html#GtkArrowPlacement" title="enum GtkArrowPlacement"><span class="type">GtkArrowPlacement</span></a></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--s-arrow-placement" title="The “arrow-placement” style property">arrow-placement</a></td>
<td class="property_flags">Read</td>
</tr>
<tr>
<td class="property_type"><span class="type">float</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--s-arrow-scaling" title="The “arrow-scaling” style property">arrow-scaling</a></td>
<td class="property_flags">Read</td>
</tr>
<tr>
<td class="property_type"><span class="type">gboolean</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--s-double-arrows" title="The “double-arrows” style property">double-arrows</a></td>
<td class="property_flags">Read</td>
</tr>
<tr>
<td class="property_type"><span class="type">int</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--s-horizontal-offset" title="The “horizontal-offset” style property">horizontal-offset</a></td>
<td class="property_flags">Read</td>
</tr>
<tr>
<td class="property_type"><span class="type">int</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--s-horizontal-padding" title="The “horizontal-padding” style property">horizontal-padding</a></td>
<td class="property_flags">Read</td>
</tr>
<tr>
<td class="property_type"><span class="type">int</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--s-vertical-offset" title="The “vertical-offset” style property">vertical-offset</a></td>
<td class="property_flags">Read</td>
</tr>
<tr>
<td class="property_type"><span class="type">int</span></td>
<td class="property_name"><a class="link" href="GtkMenu.html#GtkMenu--s-vertical-padding" title="The “vertical-padding” style property">vertical-padding</a></td>
<td class="property_flags">Read</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkMenu.signals"></a><h2>Signals</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="signal_proto_type">
<col width="300px" class="signal_proto_name">
<col width="200px" class="signal_proto_flags">
</colgroup>
<tbody>
<tr>
<td class="signal_type"><span class="returnvalue">void</span></td>
<td class="signal_name"><a class="link" href="GtkMenu.html#GtkMenu-move-scroll" title="The “move-scroll” signal">move-scroll</a></td>
<td class="signal_flags">Action</td>
</tr>
<tr>
<td class="signal_type"><span class="returnvalue">void</span></td>
<td class="signal_name"><a class="link" href="GtkMenu.html#GtkMenu-popped-up" title="The “popped-up” signal">popped-up</a></td>
<td class="signal_flags">Run First</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkMenu.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GtkMenu.html#GtkMenu-struct" title="struct GtkMenu">GtkMenu</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="GtkMenu.html#GtkArrowPlacement" title="enum GtkArrowPlacement">GtkArrowPlacement</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkMenu.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen"> GObject
<span class="lineart">╰──</span> GInitiallyUnowned
<span class="lineart">╰──</span> <a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>
<span class="lineart">╰──</span> <a class="link" href="GtkContainer.html" title="GtkContainer">GtkContainer</a>
<span class="lineart">╰──</span> <a class="link" href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a>
<span class="lineart">╰──</span> GtkMenu
<span class="lineart">╰──</span> <a class="link" href="GtkRecentChooserMenu.html" title="GtkRecentChooserMenu">GtkRecentChooserMenu</a>
</pre>
</div>
<div class="refsect1">
<a name="GtkMenu.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
GtkMenu implements
AtkImplementorIface and <a class="link" href="GtkBuildable.html" title="GtkBuildable">GtkBuildable</a>.</p>
</div>
<div class="refsect1">
<a name="GtkMenu.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gtk/gtk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GtkMenu.description"></a><h2>Description</h2>
<p>A <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> is a <a class="link" href="GtkMenuShell.html" title="GtkMenuShell"><span class="type">GtkMenuShell</span></a> that implements a drop down menu
consisting of a list of <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> objects which can be navigated
and activated by the user to perform application functions.</p>
<p>A <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> is most commonly dropped down by activating a
<a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> in a <a class="link" href="GtkMenuBar.html" title="GtkMenuBar"><span class="type">GtkMenuBar</span></a> or popped up by activating a
<a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> in another <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a>.</p>
<p>A <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> can also be popped up by activating a <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a>.
Other composite widgets such as the <a class="link" href="GtkNotebook.html" title="GtkNotebook"><span class="type">GtkNotebook</span></a> can pop up a
<a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> as well.</p>
<p>Applications can display a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> as a popup menu by calling the
<a class="link" href="GtkMenu.html#gtk-menu-popup" title="gtk_menu_popup ()"><code class="function">gtk_menu_popup()</code></a> function. The example below shows how an application
can pop up a menu when the 3rd mouse button is pressed. </p>
<div class="refsect3">
<a name="id-1.3.13.4.12.6"></a><h4>Connecting the popup signal handler.</h4>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="c1">// connect our handler which will popup the menu</span>
<span class="n">g_signal_connect_swapped</span><span class="w"> </span><span class="p">(</span><span class="n">window</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;button_press_event&quot;</span><span class="p">,</span><span class="w"></span>
<span class="n">G_CALLBACK</span><span class="w"> </span><span class="p">(</span><span class="n">my_popup_handler</span><span class="p">),</span><span class="w"> </span><span class="n">menu</span><span class="p">);</span><span class="w"></span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
</div>
<div class="refsect3">
<a name="id-1.3.13.4.12.7"></a><h4>Signal handler which displays a popup menu.</h4>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="k">static</span><span class="w"> </span><span class="n">gint</span><span class="w"></span>
<span class="nf">my_popup_handler</span><span class="w"> </span><span class="p">(</span><span class="n">GtkWidget</span><span class="w"> </span><span class="o">*</span><span class="n">widget</span><span class="p">,</span><span class="w"> </span><span class="n">GdkEvent</span><span class="w"> </span><span class="o">*</span><span class="n">event</span><span class="p">)</span><span class="w"></span>
<span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="n">GtkMenu</span><span class="w"> </span><span class="o">*</span><span class="n">menu</span><span class="p">;</span><span class="w"></span>
<span class="w"> </span><span class="n">GdkEventButton</span><span class="w"> </span><span class="o">*</span><span class="n">event_button</span><span class="p">;</span><span class="w"></span>
<span class="w"> </span><span class="n">g_return_val_if_fail</span><span class="w"> </span><span class="p">(</span><span class="n">widget</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="n">FALSE</span><span class="p">);</span><span class="w"></span>
<span class="w"> </span><span class="n">g_return_val_if_fail</span><span class="w"> </span><span class="p">(</span><span class="n">GTK_IS_MENU</span><span class="w"> </span><span class="p">(</span><span class="n">widget</span><span class="p">),</span><span class="w"> </span><span class="n">FALSE</span><span class="p">);</span><span class="w"></span>
<span class="w"> </span><span class="n">g_return_val_if_fail</span><span class="w"> </span><span class="p">(</span><span class="n">event</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="n">FALSE</span><span class="p">);</span><span class="w"></span>
<span class="w"> </span><span class="c1">// The &quot;widget&quot; is the menu that was supplied when </span>
<span class="w"> </span><span class="c1">// g_signal_connect_swapped() was called.</span>
<span class="w"> </span><span class="n">menu</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">GTK_MENU</span><span class="w"> </span><span class="p">(</span><span class="n">widget</span><span class="p">);</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">event</span><span class="o">-&gt;</span><span class="n">type</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">GDK_BUTTON_PRESS</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="n">event_button</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">GdkEventButton</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="w"> </span><span class="n">event</span><span class="p">;</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">event_button</span><span class="o">-&gt;</span><span class="n">button</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">GDK_BUTTON_SECONDARY</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="n">gtk_menu_popup</span><span class="w"> </span><span class="p">(</span><span class="n">menu</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span>
<span class="w"> </span><span class="n">event_button</span><span class="o">-&gt;</span><span class="n">button</span><span class="p">,</span><span class="w"> </span><span class="n">event_button</span><span class="o">-&gt;</span><span class="n">time</span><span class="p">);</span><span class="w"></span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">TRUE</span><span class="p">;</span><span class="w"></span>
<span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">FALSE</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
</div>
<div class="refsect2">
<a name="id-1.3.13.4.12.8"></a><h3>CSS nodes</h3>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="n">menu</span><span class="w"></span>
<span class="err">├──</span><span class="w"> </span><span class="n">arrow</span><span class="p">.</span><span class="n">top</span><span class="w"></span>
<span class="err">├──</span><span class="w"> </span><span class="o">&lt;</span><span class="n">child</span><span class="o">&gt;</span><span class="w"></span>
<span class="err"></span><span class="w"></span>
<span class="err">├──</span><span class="w"> </span><span class="o">&lt;</span><span class="n">child</span><span class="o">&gt;</span><span class="w"></span>
<span class="err">╰──</span><span class="w"> </span><span class="n">arrow</span><span class="p">.</span><span class="n">bottom</span><span class="w"></span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>The main CSS node of GtkMenu has name menu, and there are two subnodes
with name arrow, for scrolling menu arrows. These subnodes get the
.top and .bottom style classes.</p>
</div>
</div>
<div class="refsect1">
<a name="GtkMenu.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gtk-menu-new"></a><h3>gtk_menu_new ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
gtk_menu_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Creates a new <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p>
<div class="refsect3">
<a name="gtk-menu-new.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-new-from-model"></a><h3>gtk_menu_new_from_model ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
gtk_menu_new_from_model (<em class="parameter"><code><span class="type">GMenuModel</span> *model</code></em>);</pre>
<p>Creates a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> and populates it with menu items and
submenus according to <em class="parameter"><code>model</code></em>
.</p>
<p>The created menu items are connected to actions found in the
<a class="link" href="GtkApplicationWindow.html" title="GtkApplicationWindow"><span class="type">GtkApplicationWindow</span></a> to which the menu belongs - typically
by means of being attached to a widget (see <a class="link" href="GtkMenu.html#gtk-menu-attach-to-widget" title="gtk_menu_attach_to_widget ()"><code class="function">gtk_menu_attach_to_widget()</code></a>)
that is contained within the <a href="GtkApplicationWindow.html#GtkApplicationWindow-struct"><span class="type">GtkApplicationWindows</span></a> widget hierarchy.</p>
<p>Actions can also be added using <a class="link" href="GtkWidget.html#gtk-widget-insert-action-group" title="gtk_widget_insert_action_group ()"><code class="function">gtk_widget_insert_action_group()</code></a> on the menu's
attach widget or on any of its parent widgets.</p>
<div class="refsect3">
<a name="gtk-menu-new-from-model.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>model</p></td>
<td class="parameter_description"><p>a <span class="type">GMenuModel</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-menu-new-from-model.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-4.html#api-index-3.4">3.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-set-screen"></a><h3>gtk_menu_set_screen ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_set_screen (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code><span class="type">GdkScreen</span> *screen</code></em>);</pre>
<p>Sets the <span class="type">GdkScreen</span> on which the menu will be displayed.</p>
<div class="refsect3">
<a name="gtk-menu-set-screen.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>screen</p></td>
<td class="parameter_description"><p>a <span class="type">GdkScreen</span>, or <code class="literal">NULL</code> if the screen should be
determined by the widget the menu is attached to. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-reorder-child"></a><h3>gtk_menu_reorder_child ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_reorder_child (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *child</code></em>,
<em class="parameter"><code><span class="type">gint</span> position</code></em>);</pre>
<p>Moves <em class="parameter"><code>child</code></em>
to a new <em class="parameter"><code>position</code></em>
in the list of <em class="parameter"><code>menu</code></em>
children.</p>
<div class="refsect3">
<a name="gtk-menu-reorder-child.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>child</p></td>
<td class="parameter_description"><p>the <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> to move</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>position</p></td>
<td class="parameter_description"><p>the new position to place <em class="parameter"><code>child</code></em>
.
Positions are numbered from 0 to n - 1</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-attach"></a><h3>gtk_menu_attach ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_attach (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *child</code></em>,
<em class="parameter"><code><span class="type">guint</span> left_attach</code></em>,
<em class="parameter"><code><span class="type">guint</span> right_attach</code></em>,
<em class="parameter"><code><span class="type">guint</span> top_attach</code></em>,
<em class="parameter"><code><span class="type">guint</span> bottom_attach</code></em>);</pre>
<p>Adds a new <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> to a (table) menu. The number of “cells” that
an item will occupy is specified by <em class="parameter"><code>left_attach</code></em>
, <em class="parameter"><code>right_attach</code></em>
,
<em class="parameter"><code>top_attach</code></em>
and <em class="parameter"><code>bottom_attach</code></em>
. These each represent the leftmost,
rightmost, uppermost and lower column and row numbers of the table.
(Columns and rows are indexed from zero).</p>
<p>Note that this function is not related to <a class="link" href="GtkMenu.html#gtk-menu-detach" title="gtk_menu_detach ()"><code class="function">gtk_menu_detach()</code></a>.</p>
<div class="refsect3">
<a name="gtk-menu-attach.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>child</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>left_attach</p></td>
<td class="parameter_description"><p>The column number to attach the left side of the item to</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>right_attach</p></td>
<td class="parameter_description"><p>The column number to attach the right side of the item to</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>top_attach</p></td>
<td class="parameter_description"><p>The row number to attach the top of the item to</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>bottom_attach</p></td>
<td class="parameter_description"><p>The row number to attach the bottom of the item to</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-popup-at-rect"></a><h3>gtk_menu_popup_at_rect ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_popup_at_rect (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code><span class="type">GdkWindow</span> *rect_window</code></em>,
<em class="parameter"><code>const <span class="type">GdkRectangle</span> *rect</code></em>,
<em class="parameter"><code><span class="type">GdkGravity</span> rect_anchor</code></em>,
<em class="parameter"><code><span class="type">GdkGravity</span> menu_anchor</code></em>,
<em class="parameter"><code>const <span class="type">GdkEvent</span> *trigger_event</code></em>);</pre>
<p>Displays <em class="parameter"><code>menu</code></em>
and makes it available for selection.</p>
<p>See <a class="link" href="GtkMenu.html#gtk-menu-popup-at-widget" title="gtk_menu_popup_at_widget ()"><code class="function">gtk_menu_popup_at_widget()</code></a> and <a class="link" href="GtkMenu.html#gtk-menu-popup-at-pointer" title="gtk_menu_popup_at_pointer ()"><code class="function">gtk_menu_popup_at_pointer()</code></a>, which
handle more common cases for popping up menus.</p>
<p><em class="parameter"><code>menu</code></em>
will be positioned at <em class="parameter"><code>rect</code></em>
, aligning their anchor points. <em class="parameter"><code>rect</code></em>
is
relative to the top-left corner of <em class="parameter"><code>rect_window</code></em>
. <em class="parameter"><code>rect_anchor</code></em>
and
<em class="parameter"><code>menu_anchor</code></em>
determine anchor points on <em class="parameter"><code>rect</code></em>
and <em class="parameter"><code>menu</code></em>
to pin together.
<em class="parameter"><code>menu</code></em>
can optionally be offset by <a class="link" href="GtkMenu.html#GtkMenu--rect-anchor-dx" title="The “rect-anchor-dx” property"><span class="type">“rect-anchor-dx”</span></a> and
<a class="link" href="GtkMenu.html#GtkMenu--rect-anchor-dy" title="The “rect-anchor-dy” property"><span class="type">“rect-anchor-dy”</span></a>.</p>
<p>Anchors should be specified under the assumption that the text direction is
left-to-right; they will be flipped horizontally automatically if the text
direction is right-to-left.</p>
<p>Other properties that influence the behaviour of this function are
<a class="link" href="GtkMenu.html#GtkMenu--anchor-hints" title="The “anchor-hints” property"><span class="type">“anchor-hints”</span></a> and <a class="link" href="GtkMenu.html#GtkMenu--menu-type-hint" title="The “menu-type-hint” property"><span class="type">“menu-type-hint”</span></a>. Connect to the
<a class="link" href="GtkMenu.html#GtkMenu-popped-up" title="The “popped-up” signal"><span class="type">“popped-up”</span></a> signal to find out how it was actually positioned.</p>
<div class="refsect3">
<a name="gtk-menu-popup-at-rect.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>the <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> to pop up</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>rect_window</p></td>
<td class="parameter_description"><p>the <span class="type">GdkWindow</span> <em class="parameter"><code>rect</code></em>
is relative to. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL must not be passed as the value in, out, in-out; or as a return value."><span class="acronym">not nullable</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>rect</p></td>
<td class="parameter_description"><p>the <span class="type">GdkRectangle</span> to align <em class="parameter"><code>menu</code></em>
with. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL must not be passed as the value in, out, in-out; or as a return value."><span class="acronym">not nullable</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>rect_anchor</p></td>
<td class="parameter_description"><p>the point on <em class="parameter"><code>rect</code></em>
to align with <em class="parameter"><code>menu</code></em>
's anchor point</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>menu_anchor</p></td>
<td class="parameter_description"><p>the point on <em class="parameter"><code>menu</code></em>
to align with <em class="parameter"><code>rect</code></em>
's anchor point</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>trigger_event</p></td>
<td class="parameter_description"><p>the <span class="type">GdkEvent</span> that initiated this request or
<code class="literal">NULL</code> if it's the current event. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-popup-at-widget"></a><h3>gtk_menu_popup_at_widget ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_popup_at_widget (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><span class="type">GdkGravity</span> widget_anchor</code></em>,
<em class="parameter"><code><span class="type">GdkGravity</span> menu_anchor</code></em>,
<em class="parameter"><code>const <span class="type">GdkEvent</span> *trigger_event</code></em>);</pre>
<p>Displays <em class="parameter"><code>menu</code></em>
and makes it available for selection.</p>
<p>See <a class="link" href="GtkMenu.html#gtk-menu-popup-at-pointer" title="gtk_menu_popup_at_pointer ()"><code class="function">gtk_menu_popup_at_pointer()</code></a> to pop up a menu at the master pointer.
<a class="link" href="GtkMenu.html#gtk-menu-popup-at-rect" title="gtk_menu_popup_at_rect ()"><code class="function">gtk_menu_popup_at_rect()</code></a> also allows you to position a menu at an arbitrary
rectangle.</p>
<p><span class="inlinemediaobject"><img src="popup-anchors.png"></span></p>
<p><em class="parameter"><code>menu</code></em>
will be positioned at <em class="parameter"><code>widget</code></em>
, aligning their anchor points.
<em class="parameter"><code>widget_anchor</code></em>
and <em class="parameter"><code>menu_anchor</code></em>
determine anchor points on <em class="parameter"><code>widget</code></em>
and <em class="parameter"><code>menu</code></em>
to pin together. <em class="parameter"><code>menu</code></em>
can optionally be offset by <a class="link" href="GtkMenu.html#GtkMenu--rect-anchor-dx" title="The “rect-anchor-dx” property"><span class="type">“rect-anchor-dx”</span></a>
and <a class="link" href="GtkMenu.html#GtkMenu--rect-anchor-dy" title="The “rect-anchor-dy” property"><span class="type">“rect-anchor-dy”</span></a>.</p>
<p>Anchors should be specified under the assumption that the text direction is
left-to-right; they will be flipped horizontally automatically if the text
direction is right-to-left.</p>
<p>Other properties that influence the behaviour of this function are
<a class="link" href="GtkMenu.html#GtkMenu--anchor-hints" title="The “anchor-hints” property"><span class="type">“anchor-hints”</span></a> and <a class="link" href="GtkMenu.html#GtkMenu--menu-type-hint" title="The “menu-type-hint” property"><span class="type">“menu-type-hint”</span></a>. Connect to the
<a class="link" href="GtkMenu.html#GtkMenu-popped-up" title="The “popped-up” signal"><span class="type">“popped-up”</span></a> signal to find out how it was actually positioned.</p>
<div class="refsect3">
<a name="gtk-menu-popup-at-widget.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>the <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> to pop up</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>the <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> to align <em class="parameter"><code>menu</code></em>
with. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL must not be passed as the value in, out, in-out; or as a return value."><span class="acronym">not nullable</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>widget_anchor</p></td>
<td class="parameter_description"><p>the point on <em class="parameter"><code>widget</code></em>
to align with <em class="parameter"><code>menu</code></em>
's anchor point</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>menu_anchor</p></td>
<td class="parameter_description"><p>the point on <em class="parameter"><code>menu</code></em>
to align with <em class="parameter"><code>widget</code></em>
's anchor point</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>trigger_event</p></td>
<td class="parameter_description"><p>the <span class="type">GdkEvent</span> that initiated this request or
<code class="literal">NULL</code> if it's the current event. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-popup-at-pointer"></a><h3>gtk_menu_popup_at_pointer ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_popup_at_pointer (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code>const <span class="type">GdkEvent</span> *trigger_event</code></em>);</pre>
<p>Displays <em class="parameter"><code>menu</code></em>
and makes it available for selection.</p>
<p>See <a class="link" href="GtkMenu.html#gtk-menu-popup-at-widget" title="gtk_menu_popup_at_widget ()"><code class="function">gtk_menu_popup_at_widget()</code></a> to pop up a menu at a widget.
<a class="link" href="GtkMenu.html#gtk-menu-popup-at-rect" title="gtk_menu_popup_at_rect ()"><code class="function">gtk_menu_popup_at_rect()</code></a> also allows you to position a menu at an arbitrary
rectangle.</p>
<p><em class="parameter"><code>menu</code></em>
will be positioned at the pointer associated with <em class="parameter"><code>trigger_event</code></em>
.</p>
<p>Properties that influence the behaviour of this function are
<a class="link" href="GtkMenu.html#GtkMenu--anchor-hints" title="The “anchor-hints” property"><span class="type">“anchor-hints”</span></a>, <a class="link" href="GtkMenu.html#GtkMenu--rect-anchor-dx" title="The “rect-anchor-dx” property"><span class="type">“rect-anchor-dx”</span></a>, <a class="link" href="GtkMenu.html#GtkMenu--rect-anchor-dy" title="The “rect-anchor-dy” property"><span class="type">“rect-anchor-dy”</span></a>, and
<a class="link" href="GtkMenu.html#GtkMenu--menu-type-hint" title="The “menu-type-hint” property"><span class="type">“menu-type-hint”</span></a>. Connect to the <a class="link" href="GtkMenu.html#GtkMenu-popped-up" title="The “popped-up” signal"><span class="type">“popped-up”</span></a> signal to find
out how it was actually positioned.</p>
<div class="refsect3">
<a name="gtk-menu-popup-at-pointer.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>the <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> to pop up</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>trigger_event</p></td>
<td class="parameter_description"><p>the <span class="type">GdkEvent</span> that initiated this request or
<code class="literal">NULL</code> if it's the current event. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-popup-for-device"></a><h3>gtk_menu_popup_for_device ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_popup_for_device (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code><span class="type">GdkDevice</span> *device</code></em>,
<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *parent_menu_shell</code></em>,
<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *parent_menu_item</code></em>,
<em class="parameter"><code><a class="link" href="GtkMenu.html#GtkMenuPositionFunc" title="GtkMenuPositionFunc ()"><span class="type">GtkMenuPositionFunc</span></a> func</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> data</code></em>,
<em class="parameter"><code><span class="type">GDestroyNotify</span> destroy</code></em>,
<em class="parameter"><code><span class="type">guint</span> button</code></em>,
<em class="parameter"><code><span class="type">guint32</span> activate_time</code></em>);</pre>
<div class="warning">
<p><code class="literal">gtk_menu_popup_for_device</code> has been deprecated since version 3.22 and should not be used in newly-written code.</p>
<p>Please use <a class="link" href="GtkMenu.html#gtk-menu-popup-at-widget" title="gtk_menu_popup_at_widget ()"><code class="function">gtk_menu_popup_at_widget()</code></a>,
<a class="link" href="GtkMenu.html#gtk-menu-popup-at-pointer" title="gtk_menu_popup_at_pointer ()"><code class="function">gtk_menu_popup_at_pointer()</code></a>. or <a class="link" href="GtkMenu.html#gtk-menu-popup-at-rect" title="gtk_menu_popup_at_rect ()"><code class="function">gtk_menu_popup_at_rect()</code></a> instead</p>
</div>
<p>Displays a menu and makes it available for selection.</p>
<p>Applications can use this function to display context-sensitive menus,
and will typically supply <code class="literal">NULL</code> for the <em class="parameter"><code>parent_menu_shell</code></em>
,
<em class="parameter"><code>parent_menu_item</code></em>
, <em class="parameter"><code>func</code></em>
, <em class="parameter"><code>data</code></em>
and <em class="parameter"><code>destroy</code></em>
parameters. The default
menu positioning function will position the menu at the current position
of <em class="parameter"><code>device</code></em>
(or its corresponding pointer).</p>
<p>The <em class="parameter"><code>button</code></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 class="parameter"><code>button</code></em>
should be 0.</p>
<p>The <em class="parameter"><code>activate_time</code></em>
parameter is used to conflict-resolve initiation of
concurrent requests for mouse/keyboard grab requests. To function
properly, this needs to be the time stamp of the user event (such as
a mouse click or key press) that caused the initiation of the popup.
Only if no such event is available, <a class="link" href="gtk3-General.html#gtk-get-current-event-time" title="gtk_get_current_event_time ()"><code class="function">gtk_get_current_event_time()</code></a> can
be used instead.</p>
<p>Note that this function does not work very well on GDK backends that
do not have global coordinates, such as Wayland or Mir. You should
probably use one of the gtk_menu_popup_at_ variants, which do not
have this problem.</p>
<div class="refsect3">
<a name="gtk-menu-popup-for-device.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>device</p></td>
<td class="parameter_description"><p>a <span class="type">GdkDevice</span>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>parent_menu_shell</p></td>
<td class="parameter_description"><p>the menu shell containing the triggering
menu item, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>parent_menu_item</p></td>
<td class="parameter_description"><p>the menu item whose activation triggered
the popup, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>func</p></td>
<td class="parameter_description"><p>a user supplied function used to position the menu,
or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>user supplied data to be passed to <em class="parameter"><code>func</code></em>
. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>destroy</p></td>
<td class="parameter_description"><p>destroy notify for <em class="parameter"><code>data</code></em>
. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>button</p></td>
<td class="parameter_description"><p>the mouse button which was pressed to initiate the event</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>activate_time</p></td>
<td class="parameter_description"><p>the time at which the activation event occurred</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-0.html#api-index-3.0">3.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-popup"></a><h3>gtk_menu_popup ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_popup (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *parent_menu_shell</code></em>,
<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *parent_menu_item</code></em>,
<em class="parameter"><code><a class="link" href="GtkMenu.html#GtkMenuPositionFunc" title="GtkMenuPositionFunc ()"><span class="type">GtkMenuPositionFunc</span></a> func</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> data</code></em>,
<em class="parameter"><code><span class="type">guint</span> button</code></em>,
<em class="parameter"><code><span class="type">guint32</span> activate_time</code></em>);</pre>
<div class="warning">
<p><code class="literal">gtk_menu_popup</code> has been deprecated since version 3.22 and should not be used in newly-written code.</p>
<p>Please use <a class="link" href="GtkMenu.html#gtk-menu-popup-at-widget" title="gtk_menu_popup_at_widget ()"><code class="function">gtk_menu_popup_at_widget()</code></a>,
<a class="link" href="GtkMenu.html#gtk-menu-popup-at-pointer" title="gtk_menu_popup_at_pointer ()"><code class="function">gtk_menu_popup_at_pointer()</code></a>. or <a class="link" href="GtkMenu.html#gtk-menu-popup-at-rect" title="gtk_menu_popup_at_rect ()"><code class="function">gtk_menu_popup_at_rect()</code></a> instead</p>
</div>
<p>Displays a menu and makes it available for selection.</p>
<p>Applications can use this function to display context-sensitive
menus, and will typically supply <code class="literal">NULL</code> for the <em class="parameter"><code>parent_menu_shell</code></em>
,
<em class="parameter"><code>parent_menu_item</code></em>
, <em class="parameter"><code>func</code></em>
and <em class="parameter"><code>data</code></em>
parameters. The default menu
positioning function will position the menu at the current mouse
cursor position.</p>
<p>The <em class="parameter"><code>button</code></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 class="parameter"><code>button</code></em>
should be 0.</p>
<p>The <em class="parameter"><code>activate_time</code></em>
parameter is used to conflict-resolve initiation
of concurrent requests for mouse/keyboard grab requests. To function
properly, this needs to be the timestamp of the user event (such as
a mouse click or key press) that caused the initiation of the popup.
Only if no such event is available, <a class="link" href="gtk3-General.html#gtk-get-current-event-time" title="gtk_get_current_event_time ()"><code class="function">gtk_get_current_event_time()</code></a> can
be used instead.</p>
<p>Note that this function does not work very well on GDK backends that
do not have global coordinates, such as Wayland or Mir. You should
probably use one of the gtk_menu_popup_at_ variants, which do not
have this problem.</p>
<div class="refsect3">
<a name="gtk-menu-popup.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>parent_menu_shell</p></td>
<td class="parameter_description"><p>the menu shell containing the
triggering menu item, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>parent_menu_item</p></td>
<td class="parameter_description"><p>the menu item whose activation
triggered the popup, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>func</p></td>
<td class="parameter_description"><p>a user supplied function used to position
the menu, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>user supplied data to be passed to <em class="parameter"><code>func</code></em>
.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>button</p></td>
<td class="parameter_description"><p>the mouse button which was pressed to initiate the event.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>activate_time</p></td>
<td class="parameter_description"><p>the time at which the activation event occurred.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-set-accel-group"></a><h3>gtk_menu_set_accel_group ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_set_accel_group (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code><a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> *accel_group</code></em>);</pre>
<p>Set the <a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> which holds global accelerators for the
menu. This accelerator group needs to also be added to all windows
that this menu is being used in with <a class="link" href="GtkWindow.html#gtk-window-add-accel-group" title="gtk_window_add_accel_group ()"><code class="function">gtk_window_add_accel_group()</code></a>,
in order for those windows to support all the accelerators
contained in this group.</p>
<div class="refsect3">
<a name="gtk-menu-set-accel-group.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>accel_group</p></td>
<td class="parameter_description"><p>the <a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> to be associated
with the menu. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-accel-group"></a><h3>gtk_menu_get_accel_group ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup"><span class="returnvalue">GtkAccelGroup</span></a> *
gtk_menu_get_accel_group (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>Gets the <a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> which holds global accelerators for the
menu. See <a class="link" href="GtkMenu.html#gtk-menu-set-accel-group" title="gtk_menu_set_accel_group ()"><code class="function">gtk_menu_set_accel_group()</code></a>.</p>
<div class="refsect3">
<a name="gtk-menu-get-accel-group.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-menu-get-accel-group.returns"></a><h4>Returns</h4>
<p>the <a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> associated with the menu. </p>
<p><span class="annotation">[<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-set-accel-path"></a><h3>gtk_menu_set_accel_path ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_set_accel_path (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *accel_path</code></em>);</pre>
<p>Sets an accelerator path for this menu from which accelerator paths
for its immediate children, its menu items, can be constructed.
The main purpose of this function is to spare the programmer the
inconvenience of having to call <a class="link" href="GtkMenuItem.html#gtk-menu-item-set-accel-path" title="gtk_menu_item_set_accel_path ()"><code class="function">gtk_menu_item_set_accel_path()</code></a> on
each menu item that should support runtime user changable accelerators.
Instead, by just calling <a class="link" href="GtkMenu.html#gtk-menu-set-accel-path" title="gtk_menu_set_accel_path ()"><code class="function">gtk_menu_set_accel_path()</code></a> on their parent,
each menu item of this menu, that contains a label describing its
purpose, automatically gets an accel path assigned.</p>
<p>For example, a menu containing menu items “New” and “Exit”, will, after
<code class="literal">gtk_menu_set_accel_path (menu, "&amp;lt;Gnumeric-Sheet&gt;/File");</code> has been
called, assign its items the accel paths: <code class="literal">"&amp;lt;Gnumeric-Sheet&gt;/File/New"</code>
and <code class="literal">"&amp;lt;Gnumeric-Sheet&gt;/File/Exit"</code>.</p>
<p>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 <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-add-entry" title="gtk_accel_map_add_entry ()"><code class="function">gtk_accel_map_add_entry()</code></a>.</p>
<p>Note that <em class="parameter"><code>accel_path</code></em>
string will be stored in a <span class="type">GQuark</span>. Therefore,
if you pass a static string, you can save some memory by interning
it first with <code class="function">g_intern_static_string()</code>.</p>
<div class="refsect3">
<a name="gtk-menu-set-accel-path.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a valid <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>accel_path</p></td>
<td class="parameter_description"><p>a valid accelerator path, or <code class="literal">NULL</code> to unset the path. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-accel-path"></a><h3>gtk_menu_get_accel_path ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> *
gtk_menu_get_accel_path (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>Retrieves the accelerator path set on the menu.</p>
<div class="refsect3">
<a name="gtk-menu-get-accel-path.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a valid <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-menu-get-accel-path.returns"></a><h4>Returns</h4>
<p> the accelerator path set on the menu.</p>
</div>
<p class="since">Since: 2.14</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-set-title"></a><h3>gtk_menu_set_title ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_set_title (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *title</code></em>);</pre>
<div class="warning"><p><code class="literal">gtk_menu_set_title</code> has been deprecated since version 3.10 and should not be used in newly-written code.</p></div>
<p>Sets the title string for the menu.</p>
<p>The title is displayed when the menu is shown as a tearoff
menu. If <em class="parameter"><code>title</code></em>
is <code class="literal">NULL</code>, the menu will see if it is attached
to a parent menu item, and if so it will try to use the same
text as that menu items label.</p>
<div class="refsect3">
<a name="gtk-menu-set-title.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>title</p></td>
<td class="parameter_description"><p>a string containing the title for the menu, or <code class="literal">NULL</code> to
inherit the title of the parent menu item, if any. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-title"></a><h3>gtk_menu_get_title ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> *
gtk_menu_get_title (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<div class="warning"><p><code class="literal">gtk_menu_get_title</code> has been deprecated since version 3.10 and should not be used in newly-written code.</p></div>
<p>Returns the title of the menu. See <a class="link" href="GtkMenu.html#gtk-menu-set-title" title="gtk_menu_set_title ()"><code class="function">gtk_menu_set_title()</code></a>.</p>
<div class="refsect3">
<a name="gtk-menu-get-title.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-menu-get-title.returns"></a><h4>Returns</h4>
<p> the title of the menu, or <code class="literal">NULL</code> if the menu
has no title set on it. This string is owned by GTK+
and should not be modified or freed.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-set-monitor"></a><h3>gtk_menu_set_monitor ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_set_monitor (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code><span class="type">gint</span> monitor_num</code></em>);</pre>
<p>Informs GTK+ on which monitor a menu should be popped up.
See <code class="function">gdk_monitor_get_geometry()</code>.</p>
<p>This function should be called from a <a class="link" href="GtkMenu.html#GtkMenuPositionFunc" title="GtkMenuPositionFunc ()"><span class="type">GtkMenuPositionFunc</span></a>
if the menu should not appear on the same monitor as the pointer.
This information cant be reliably inferred from the coordinates
returned by a <a class="link" href="GtkMenu.html#GtkMenuPositionFunc" title="GtkMenuPositionFunc ()"><span class="type">GtkMenuPositionFunc</span></a>, since, for very long menus,
these coordinates may extend beyond the monitor boundaries or even
the screen boundaries.</p>
<div class="refsect3">
<a name="gtk-menu-set-monitor.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>monitor_num</p></td>
<td class="parameter_description"><p>the number of the monitor on which the menu should
be popped up</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-monitor"></a><h3>gtk_menu_get_monitor ()</h3>
<pre class="programlisting"><span class="returnvalue">gint</span>
gtk_menu_get_monitor (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>Retrieves the number of the monitor on which to show the menu.</p>
<div class="refsect3">
<a name="gtk-menu-get-monitor.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-menu-get-monitor.returns"></a><h4>Returns</h4>
<p> the number of the monitor on which the menu should
be popped up or -1, if no monitor has been set</p>
</div>
<p class="since">Since: 2.14</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-place-on-monitor"></a><h3>gtk_menu_place_on_monitor ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_place_on_monitor (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code><span class="type">GdkMonitor</span> *monitor</code></em>);</pre>
<p>Places <em class="parameter"><code>menu</code></em>
on the given monitor.</p>
<div class="refsect3">
<a name="gtk-menu-place-on-monitor.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>monitor</p></td>
<td class="parameter_description"><p>the monitor to place the menu on</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-tearoff-state"></a><h3>gtk_menu_get_tearoff_state ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gtk_menu_get_tearoff_state (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<div class="warning"><p><code class="literal">gtk_menu_get_tearoff_state</code> has been deprecated since version 3.10 and should not be used in newly-written code.</p></div>
<p>Returns whether the menu is torn off.
See <a class="link" href="GtkMenu.html#gtk-menu-set-tearoff-state" title="gtk_menu_set_tearoff_state ()"><code class="function">gtk_menu_set_tearoff_state()</code></a>.</p>
<div class="refsect3">
<a name="gtk-menu-get-tearoff-state.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-menu-get-tearoff-state.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the menu is currently torn off.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-set-reserve-toggle-size"></a><h3>gtk_menu_set_reserve_toggle_size ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_set_reserve_toggle_size (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code><span class="type">gboolean</span> reserve_toggle_size</code></em>);</pre>
<p>Sets whether the menu should reserve space for drawing toggles
or icons, regardless of their actual presence.</p>
<div class="refsect3">
<a name="gtk-menu-set-reserve-toggle-size.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>reserve_toggle_size</p></td>
<td class="parameter_description"><p>whether to reserve size for toggles</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.18</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-reserve-toggle-size"></a><h3>gtk_menu_get_reserve_toggle_size ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gtk_menu_get_reserve_toggle_size (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>Returns whether the menu reserves space for toggles and
icons, regardless of their actual presence.</p>
<div class="refsect3">
<a name="gtk-menu-get-reserve-toggle-size.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-menu-get-reserve-toggle-size.returns"></a><h4>Returns</h4>
<p> Whether the menu reserves toggle space</p>
</div>
<p class="since">Since: 2.18</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-popdown"></a><h3>gtk_menu_popdown ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_popdown (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>Removes the menu from the screen.</p>
<div class="refsect3">
<a name="gtk-menu-popdown.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-reposition"></a><h3>gtk_menu_reposition ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_reposition (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>Repositions the menu according to its position function.</p>
<div class="refsect3">
<a name="gtk-menu-reposition.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-active"></a><h3>gtk_menu_get_active ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
gtk_menu_get_active (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>Returns the selected menu item from the menu. This is used by the
<a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a>.</p>
<div class="refsect3">
<a name="gtk-menu-get-active.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-menu-get-active.returns"></a><h4>Returns</h4>
<p>the <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> that was last selected
in the menu. If a selection has not yet been made, the
first menu item is selected. </p>
<p><span class="annotation">[<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-set-active"></a><h3>gtk_menu_set_active ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_set_active (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code><span class="type">guint</span> index</code></em>);</pre>
<p>Selects the specified menu item within the menu. This is used by
the <a class="link" href="GtkComboBox.html" title="GtkComboBox"><span class="type">GtkComboBox</span></a> and should not be used by anyone else.</p>
<div class="refsect3">
<a name="gtk-menu-set-active.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>index</p></td>
<td class="parameter_description"><p>the index of the menu item to select. Index values are
from 0 to n-1</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-set-tearoff-state"></a><h3>gtk_menu_set_tearoff_state ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_set_tearoff_state (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code><span class="type">gboolean</span> torn_off</code></em>);</pre>
<div class="warning"><p><code class="literal">gtk_menu_set_tearoff_state</code> has been deprecated since version 3.10 and should not be used in newly-written code.</p></div>
<p>Changes the tearoff state of the menu. A menu is normally
displayed as drop down menu which persists as long as the menu is
active. It can also be displayed as a tearoff menu which persists
until it is closed or reattached.</p>
<div class="refsect3">
<a name="gtk-menu-set-tearoff-state.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>torn_off</p></td>
<td class="parameter_description"><p>If <code class="literal">TRUE</code>, menu is displayed as a tearoff menu.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-attach-to-widget"></a><h3>gtk_menu_attach_to_widget ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_attach_to_widget (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *attach_widget</code></em>,
<em class="parameter"><code><a class="link" href="GtkMenu.html#GtkMenuDetachFunc" title="GtkMenuDetachFunc ()"><span class="type">GtkMenuDetachFunc</span></a> detacher</code></em>);</pre>
<p>Attaches the menu to the widget and provides a callback function
that will be invoked when the menu calls <a class="link" href="GtkMenu.html#gtk-menu-detach" title="gtk_menu_detach ()"><code class="function">gtk_menu_detach()</code></a> during
its destruction.</p>
<p>If the menu is attached to the widget then it will be destroyed
when the widget is destroyed, as if it was a child widget.
An attached menu will also move between screens correctly if the
widgets moves between screens.</p>
<div class="refsect3">
<a name="gtk-menu-attach-to-widget.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>attach_widget</p></td>
<td class="parameter_description"><p>the <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> that the menu will be attached to</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>detacher</p></td>
<td class="parameter_description"><p>the user supplied callback function
that will be called when the menu calls <a class="link" href="GtkMenu.html#gtk-menu-detach" title="gtk_menu_detach ()"><code class="function">gtk_menu_detach()</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-detach"></a><h3>gtk_menu_detach ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_menu_detach (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>Detaches the menu from the widget to which it had been attached.
This function will call the callback function, <em class="parameter"><code>detacher</code></em>
, provided
when the <a class="link" href="GtkMenu.html#gtk-menu-attach-to-widget" title="gtk_menu_attach_to_widget ()"><code class="function">gtk_menu_attach_to_widget()</code></a> function was called.</p>
<div class="refsect3">
<a name="gtk-menu-detach.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-attach-widget"></a><h3>gtk_menu_get_attach_widget ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
gtk_menu_get_attach_widget (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>Returns the <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> that the menu is attached to.</p>
<div class="refsect3">
<a name="gtk-menu-get-attach-widget.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-menu-get-attach-widget.returns"></a><h4>Returns</h4>
<p>the <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> that the menu is attached to. </p>
<p><span class="annotation">[<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-get-for-attach-widget"></a><h3>gtk_menu_get_for_attach_widget ()</h3>
<pre class="programlisting"><span class="returnvalue">GList</span> *
gtk_menu_get_for_attach_widget (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>Returns a list of the menus which are attached to this widget.
This list is owned by GTK+ and must not be modified.</p>
<div class="refsect3">
<a name="gtk-menu-get-for-attach-widget.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-menu-get-for-attach-widget.returns"></a><h4>Returns</h4>
<p>the list
of menus attached to his widget. </p>
<p><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GtkWidget][<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenuPositionFunc"></a><h3>GtkMenuPositionFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*GtkMenuPositionFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>,
<em class="parameter"><code><span class="type">gint</span> *x</code></em>,
<em class="parameter"><code><span class="type">gint</span> *y</code></em>,
<em class="parameter"><code><span class="type">gboolean</span> *push_in</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
<p>A user function supplied when calling <a class="link" href="GtkMenu.html#gtk-menu-popup" title="gtk_menu_popup ()"><code class="function">gtk_menu_popup()</code></a> which
controls the positioning of the menu when it is displayed. The
function sets the <em class="parameter"><code>x</code></em>
and <em class="parameter"><code>y</code></em>
parameters to the coordinates where the
menu is to be drawn. To make the menu appear on a different
monitor than the mouse pointer, <a class="link" href="GtkMenu.html#gtk-menu-set-monitor" title="gtk_menu_set_monitor ()"><code class="function">gtk_menu_set_monitor()</code></a> must be
called.</p>
<div class="refsect3">
<a name="GtkMenuPositionFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p>address of the <span class="type">gint</span> representing the horizontal
position where the menu shall be drawn. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>y</p></td>
<td class="parameter_description"><p>address of the <span class="type">gint</span> representing the vertical position
where the menu shall be drawn. This is an output parameter. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>push_in</p></td>
<td class="parameter_description"><p>This parameter controls how menus placed outside
the monitor are handled. If this is set to <code class="literal">TRUE</code> and part of
the menu is outside the monitor then GTK+ pushes the window
into the visible area, effectively modifying the popup
position. Note that moving and possibly resizing the menu
around will alter the scroll position to keep the menu items
“in place”, i.e. at the same monitor position they would have
been without resizing. In practice, this behavior is only
useful for combobox popups or option menus and cannot be used
to simply confine a menu to monitor boundaries. In that case,
changing the scroll offset is not desirable. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>the data supplied by the user in the <a class="link" href="GtkMenu.html#gtk-menu-popup" title="gtk_menu_popup ()"><code class="function">gtk_menu_popup()</code></a>
<em class="parameter"><code>data</code></em>
parameter.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenuDetachFunc"></a><h3>GtkMenuDetachFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*GtkMenuDetachFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *attach_widget</code></em>,
<em class="parameter"><code><a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre>
<p>A user function supplied when calling <a class="link" href="GtkMenu.html#gtk-menu-attach-to-widget" title="gtk_menu_attach_to_widget ()"><code class="function">gtk_menu_attach_to_widget()</code></a> which
will be called when the menu is later detached from the widget.</p>
<div class="refsect3">
<a name="GtkMenuDetachFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>attach_widget</p></td>
<td class="parameter_description"><p>the <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> that the menu is being detached from.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>the <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> being detached.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="GtkMenu.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GtkMenu-struct"></a><h3>struct GtkMenu</h3>
<pre class="programlisting">struct GtkMenu;</pre>
</div>
<hr>
<div class="refsect2">
<a name="GtkArrowPlacement"></a><h3>enum GtkArrowPlacement</h3>
<p>Used to specify the placement of scroll arrows in scrolling menus.</p>
<div class="refsect3">
<a name="GtkArrowPlacement.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GTK-ARROWS-BOTH:CAPS"></a>GTK_ARROWS_BOTH</p></td>
<td class="enum_member_description">
<p>Place one arrow on each end of the menu.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-ARROWS-START:CAPS"></a>GTK_ARROWS_START</p></td>
<td class="enum_member_description">
<p>Place both arrows at the top of the menu.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-ARROWS-END:CAPS"></a>GTK_ARROWS_END</p></td>
<td class="enum_member_description">
<p>Place both arrows at the bottom of the menu.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="GtkMenu.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GtkMenu--accel-group"></a><h3>The <code class="literal">“accel-group”</code> property</h3>
<pre class="programlisting"> “accel-group” <a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> *</pre>
<p>The accel group holding accelerators for the menu.</p>
<p>Owner: GtkMenu</p>
<p>Flags: Read / Write</p>
<p class="since">Since: 2.14</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--accel-path"></a><h3>The <code class="literal">“accel-path”</code> property</h3>
<pre class="programlisting"> “accel-path” <span class="type">char</span> *</pre>
<p>An accel path used to conveniently construct accel paths of child items.</p>
<p>Owner: GtkMenu</p>
<p>Flags: Read / Write</p>
<p>Default value: NULL</p>
<p class="since">Since: 2.14</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--active"></a><h3>The <code class="literal">“active”</code> property</h3>
<pre class="programlisting"> “active” <span class="type">int</span></pre>
<p>The index of the currently selected menu item, or -1 if no
menu item is selected.</p>
<p>Owner: GtkMenu</p>
<p>Flags: Read / Write</p>
<p>Allowed values: &gt;= -1</p>
<p>Default value: -1</p>
<p class="since">Since: 2.14</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--anchor-hints"></a><h3>The <code class="literal">“anchor-hints”</code> property</h3>
<pre class="programlisting"> “anchor-hints” <span class="type">GdkAnchorHints</span></pre>
<p>Positioning hints for aligning the menu relative to a rectangle.</p>
<p>These hints determine how the menu should be positioned in the case that
the menu would fall off-screen if placed in its ideal position.</p>
<p><span class="inlinemediaobject"><img src="popup-flip.png"></span></p>
<p>For example, <code class="literal">GDK_ANCHOR_FLIP_Y</code> will replace <code class="literal">GDK_GRAVITY_NORTH_WEST</code> with
<code class="literal">GDK_GRAVITY_SOUTH_WEST</code> and vice versa if the menu extends beyond the
bottom edge of the monitor.</p>
<p>See <a class="link" href="GtkMenu.html#gtk-menu-popup-at-rect" title="gtk_menu_popup_at_rect ()"><code class="function">gtk_menu_popup_at_rect()</code></a>, <a class="link" href="GtkMenu.html#gtk-menu-popup-at-widget" title="gtk_menu_popup_at_widget ()"><code class="function">gtk_menu_popup_at_widget()</code></a>,
<a class="link" href="GtkMenu.html#gtk-menu-popup-at-pointer" title="gtk_menu_popup_at_pointer ()"><code class="function">gtk_menu_popup_at_pointer()</code></a>, <a class="link" href="GtkMenu.html#GtkMenu--rect-anchor-dx" title="The “rect-anchor-dx” property"><span class="type">“rect-anchor-dx”</span></a>,
<a class="link" href="GtkMenu.html#GtkMenu--rect-anchor-dy" title="The “rect-anchor-dy” property"><span class="type">“rect-anchor-dy”</span></a>, <a class="link" href="GtkMenu.html#GtkMenu--menu-type-hint" title="The “menu-type-hint” property"><span class="type">“menu-type-hint”</span></a>, and <a class="link" href="GtkMenu.html#GtkMenu-popped-up" title="The “popped-up” signal"><span class="type">“popped-up”</span></a>.</p>
<p>Owner: GtkMenu</p>
<p>Flags: Read / Write / Construct</p>
<p>Default value: GDK_ANCHOR_FLIP_X | GDK_ANCHOR_FLIP_Y | GDK_ANCHOR_SLIDE_X | GDK_ANCHOR_SLIDE_Y | GDK_ANCHOR_RESIZE_X | GDK_ANCHOR_RESIZE_Y</p>
<p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--attach-widget"></a><h3>The <code class="literal">“attach-widget”</code> property</h3>
<pre class="programlisting"> “attach-widget” <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *</pre>
<p>The widget the menu is attached to. Setting this property attaches
the menu without a <a class="link" href="GtkMenu.html#GtkMenuDetachFunc" title="GtkMenuDetachFunc ()"><span class="type">GtkMenuDetachFunc</span></a>. If you need to use a detacher,
use <a class="link" href="GtkMenu.html#gtk-menu-attach-to-widget" title="gtk_menu_attach_to_widget ()"><code class="function">gtk_menu_attach_to_widget()</code></a> directly.</p>
<p>Owner: GtkMenu</p>
<p>Flags: Read / Write</p>
<p class="since">Since: 2.14</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--menu-type-hint"></a><h3>The <code class="literal">“menu-type-hint”</code> property</h3>
<pre class="programlisting"> “menu-type-hint” <span class="type">GdkWindowTypeHint</span></pre>
<p>The <span class="type">GdkWindowTypeHint</span> to use for the menu's <span class="type">GdkWindow</span>.</p>
<p>See <a class="link" href="GtkMenu.html#gtk-menu-popup-at-rect" title="gtk_menu_popup_at_rect ()"><code class="function">gtk_menu_popup_at_rect()</code></a>, <a class="link" href="GtkMenu.html#gtk-menu-popup-at-widget" title="gtk_menu_popup_at_widget ()"><code class="function">gtk_menu_popup_at_widget()</code></a>,
<a class="link" href="GtkMenu.html#gtk-menu-popup-at-pointer" title="gtk_menu_popup_at_pointer ()"><code class="function">gtk_menu_popup_at_pointer()</code></a>, <a class="link" href="GtkMenu.html#GtkMenu--anchor-hints" title="The “anchor-hints” property"><span class="type">“anchor-hints”</span></a>,
<a class="link" href="GtkMenu.html#GtkMenu--rect-anchor-dx" title="The “rect-anchor-dx” property"><span class="type">“rect-anchor-dx”</span></a>, <a class="link" href="GtkMenu.html#GtkMenu--rect-anchor-dy" title="The “rect-anchor-dy” property"><span class="type">“rect-anchor-dy”</span></a>, and <a class="link" href="GtkMenu.html#GtkMenu-popped-up" title="The “popped-up” signal"><span class="type">“popped-up”</span></a>.</p>
<p>Owner: GtkMenu</p>
<p>Flags: Read / Write / Construct</p>
<p>Default value: GDK_WINDOW_TYPE_HINT_POPUP_MENU</p>
<p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--monitor"></a><h3>The <code class="literal">“monitor”</code> property</h3>
<pre class="programlisting"> “monitor” <span class="type">int</span></pre>
<p>The monitor the menu will be popped up on.</p>
<p>Owner: GtkMenu</p>
<p>Flags: Read / Write</p>
<p>Allowed values: &gt;= -1</p>
<p>Default value: -1</p>
<p class="since">Since: 2.14</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--rect-anchor-dx"></a><h3>The <code class="literal">“rect-anchor-dx”</code> property</h3>
<pre class="programlisting"> “rect-anchor-dx” <span class="type">int</span></pre>
<p>Horizontal offset to apply to the menu, i.e. the rectangle or widget
anchor.</p>
<p>See <a class="link" href="GtkMenu.html#gtk-menu-popup-at-rect" title="gtk_menu_popup_at_rect ()"><code class="function">gtk_menu_popup_at_rect()</code></a>, <a class="link" href="GtkMenu.html#gtk-menu-popup-at-widget" title="gtk_menu_popup_at_widget ()"><code class="function">gtk_menu_popup_at_widget()</code></a>,
<a class="link" href="GtkMenu.html#gtk-menu-popup-at-pointer" title="gtk_menu_popup_at_pointer ()"><code class="function">gtk_menu_popup_at_pointer()</code></a>, <a class="link" href="GtkMenu.html#GtkMenu--anchor-hints" title="The “anchor-hints” property"><span class="type">“anchor-hints”</span></a>,
<a class="link" href="GtkMenu.html#GtkMenu--rect-anchor-dy" title="The “rect-anchor-dy” property"><span class="type">“rect-anchor-dy”</span></a>, <a class="link" href="GtkMenu.html#GtkMenu--menu-type-hint" title="The “menu-type-hint” property"><span class="type">“menu-type-hint”</span></a>, and <a class="link" href="GtkMenu.html#GtkMenu-popped-up" title="The “popped-up” signal"><span class="type">“popped-up”</span></a>.</p>
<p>Owner: GtkMenu</p>
<p>Flags: Read / Write / Construct</p>
<p>Default value: 0</p>
<p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--rect-anchor-dy"></a><h3>The <code class="literal">“rect-anchor-dy”</code> property</h3>
<pre class="programlisting"> “rect-anchor-dy” <span class="type">int</span></pre>
<p>Vertical offset to apply to the menu, i.e. the rectangle or widget anchor.</p>
<p>See <a class="link" href="GtkMenu.html#gtk-menu-popup-at-rect" title="gtk_menu_popup_at_rect ()"><code class="function">gtk_menu_popup_at_rect()</code></a>, <a class="link" href="GtkMenu.html#gtk-menu-popup-at-widget" title="gtk_menu_popup_at_widget ()"><code class="function">gtk_menu_popup_at_widget()</code></a>,
<a class="link" href="GtkMenu.html#gtk-menu-popup-at-pointer" title="gtk_menu_popup_at_pointer ()"><code class="function">gtk_menu_popup_at_pointer()</code></a>, <a class="link" href="GtkMenu.html#GtkMenu--anchor-hints" title="The “anchor-hints” property"><span class="type">“anchor-hints”</span></a>,
<a class="link" href="GtkMenu.html#GtkMenu--rect-anchor-dx" title="The “rect-anchor-dx” property"><span class="type">“rect-anchor-dx”</span></a>, <a class="link" href="GtkMenu.html#GtkMenu--menu-type-hint" title="The “menu-type-hint” property"><span class="type">“menu-type-hint”</span></a>, and <a class="link" href="GtkMenu.html#GtkMenu-popped-up" title="The “popped-up” signal"><span class="type">“popped-up”</span></a>.</p>
<p>Owner: GtkMenu</p>
<p>Flags: Read / Write / Construct</p>
<p>Default value: 0</p>
<p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--reserve-toggle-size"></a><h3>The <code class="literal">“reserve-toggle-size”</code> property</h3>
<pre class="programlisting"> “reserve-toggle-size” <span class="type">gboolean</span></pre>
<p>A boolean that indicates whether the menu reserves space for
toggles and icons, regardless of their actual presence.</p>
<p>This property should only be changed from its default value
for special-purposes such as tabular menus. Regular menus that
are connected to a menu bar or context menus should reserve
toggle space for consistency.</p>
<p>Owner: GtkMenu</p>
<p>Flags: Read / Write</p>
<p>Default value: TRUE</p>
<p class="since">Since: 2.18</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--tearoff-state"></a><h3>The <code class="literal">“tearoff-state”</code> property</h3>
<pre class="programlisting"> “tearoff-state” <span class="type">gboolean</span></pre>
<p>A boolean that indicates whether the menu is torn-off.</p>
<div class="warning"><p><code class="literal">GtkMenu:tearoff-state</code> has been deprecated since version 3.10 and should not be used in newly-written code.</p></div>
<p>Owner: GtkMenu</p>
<p>Flags: Read / Write</p>
<p>Default value: FALSE</p>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--tearoff-title"></a><h3>The <code class="literal">“tearoff-title”</code> property</h3>
<pre class="programlisting"> “tearoff-title” <span class="type">char</span> *</pre>
<p>A title that may be displayed by the window manager when this
menu is torn-off.</p>
<div class="warning"><p><code class="literal">GtkMenu:tearoff-title</code> has been deprecated since version 3.10 and should not be used in newly-written code.</p></div>
<p>Owner: GtkMenu</p>
<p>Flags: Read / Write</p>
<p>Default value: NULL</p>
</div>
</div>
<div class="refsect1">
<a name="GtkMenu.child-property-details"></a><h2>Child Property Details</h2>
<div class="refsect2">
<a name="GtkMenu--c-bottom-attach"></a><h3>The <code class="literal">“bottom-attach”</code> child property</h3>
<pre class="programlisting"> “bottom-attach” <span class="type">int</span></pre>
<p>The row number to attach the bottom of the child to.</p>
<p>Owner: GtkMenu</p>
<p>Flags: Read / Write</p>
<p>Allowed values: &gt;= -1</p>
<p>Default value: -1</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--c-left-attach"></a><h3>The <code class="literal">“left-attach”</code> child property</h3>
<pre class="programlisting"> “left-attach” <span class="type">int</span></pre>
<p>The column number to attach the left side of the child to.</p>
<p>Owner: GtkMenu</p>
<p>Flags: Read / Write</p>
<p>Allowed values: &gt;= -1</p>
<p>Default value: -1</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--c-right-attach"></a><h3>The <code class="literal">“right-attach”</code> child property</h3>
<pre class="programlisting"> “right-attach” <span class="type">int</span></pre>
<p>The column number to attach the right side of the child to.</p>
<p>Owner: GtkMenu</p>
<p>Flags: Read / Write</p>
<p>Allowed values: &gt;= -1</p>
<p>Default value: -1</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--c-top-attach"></a><h3>The <code class="literal">“top-attach”</code> child property</h3>
<pre class="programlisting"> “top-attach” <span class="type">int</span></pre>
<p>The row number to attach the top of the child to.</p>
<p>Owner: GtkMenu</p>
<p>Flags: Read / Write</p>
<p>Allowed values: &gt;= -1</p>
<p>Default value: -1</p>
</div>
</div>
<div class="refsect1">
<a name="GtkMenu.style-property-details"></a><h2>Style Property Details</h2>
<div class="refsect2">
<a name="GtkMenu--s-arrow-placement"></a><h3>The <code class="literal">“arrow-placement”</code> style property</h3>
<pre class="programlisting"> “arrow-placement” <a class="link" href="GtkMenu.html#GtkArrowPlacement" title="enum GtkArrowPlacement"><span class="type">GtkArrowPlacement</span></a></pre>
<p>Indicates where scroll arrows should be placed.</p>
<div class="warning">
<p><code class="literal">GtkMenu:arrow-placement</code> has been deprecated since version 3.20 and should not be used in newly-written code.</p>
<p>the value of this style property is ignored.</p>
</div>
<p>Owner: GtkMenu</p>
<p>Flags: Read</p>
<p>Default value: GTK_ARROWS_BOTH</p>
<p class="since">Since: 2.16</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--s-arrow-scaling"></a><h3>The <code class="literal">“arrow-scaling”</code> style property</h3>
<pre class="programlisting"> “arrow-scaling” <span class="type">float</span></pre>
<p>Arbitrary constant to scale down the size of the scroll arrow.</p>
<div class="warning">
<p><code class="literal">GtkMenu:arrow-scaling</code> has been deprecated since version 3.20 and should not be used in newly-written code.</p>
<p>use the standard min-width/min-height CSS properties on
the arrow node; the value of this style property is ignored.</p>
</div>
<p>Owner: GtkMenu</p>
<p>Flags: Read</p>
<p>Allowed values: [0,1]</p>
<p>Default value: 0.7</p>
<p class="since">Since: 2.16</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--s-double-arrows"></a><h3>The <code class="literal">“double-arrows”</code> style property</h3>
<pre class="programlisting"> “double-arrows” <span class="type">gboolean</span></pre>
<p>When <code class="literal">TRUE</code>, both arrows are shown when scrolling.</p>
<div class="warning">
<p><code class="literal">GtkMenu:double-arrows</code> has been deprecated since version 3.20 and should not be used in newly-written code.</p>
<p>the value of this style property is ignored.</p>
</div>
<p>Owner: GtkMenu</p>
<p>Flags: Read</p>
<p>Default value: TRUE</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--s-horizontal-offset"></a><h3>The <code class="literal">“horizontal-offset”</code> style property</h3>
<pre class="programlisting"> “horizontal-offset” <span class="type">int</span></pre>
<p>When the menu is a submenu, position it this number of pixels offset horizontally.</p>
<p>Owner: GtkMenu</p>
<p>Flags: Read</p>
<p>Default value: -2</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--s-horizontal-padding"></a><h3>The <code class="literal">“horizontal-padding”</code> style property</h3>
<pre class="programlisting"> “horizontal-padding” <span class="type">int</span></pre>
<p>Extra space at the left and right edges of the menu.</p>
<div class="warning">
<p><code class="literal">GtkMenu:horizontal-padding</code> has been deprecated since version 3.8 and should not be used in newly-written code.</p>
<p>use the standard padding CSS property (through objects
like <a class="link" href="GtkStyleContext.html" title="GtkStyleContext"><span class="type">GtkStyleContext</span></a> and <a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a>); the value of this style
property is ignored.</p>
</div>
<p>Owner: GtkMenu</p>
<p>Flags: Read</p>
<p>Allowed values: &gt;= 0</p>
<p>Default value: 0</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--s-vertical-offset"></a><h3>The <code class="literal">“vertical-offset”</code> style property</h3>
<pre class="programlisting"> “vertical-offset” <span class="type">int</span></pre>
<p>When the menu is a submenu, position it this number of pixels offset vertically.</p>
<p>Owner: GtkMenu</p>
<p>Flags: Read</p>
<p>Default value: 0</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu--s-vertical-padding"></a><h3>The <code class="literal">“vertical-padding”</code> style property</h3>
<pre class="programlisting"> “vertical-padding” <span class="type">int</span></pre>
<p>Extra space at the top and bottom of the menu.</p>
<div class="warning">
<p><code class="literal">GtkMenu:vertical-padding</code> has been deprecated since version 3.8 and should not be used in newly-written code.</p>
<p>use the standard padding CSS property (through objects
like <a class="link" href="GtkStyleContext.html" title="GtkStyleContext"><span class="type">GtkStyleContext</span></a> and <a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a>); the value of this style
property is ignored.</p>
</div>
<p>Owner: GtkMenu</p>
<p>Flags: Read</p>
<p>Allowed values: &gt;= 0</p>
<p>Default value: 1</p>
</div>
</div>
<div class="refsect1">
<a name="GtkMenu.signal-details"></a><h2>Signal Details</h2>
<div class="refsect2">
<a name="GtkMenu-move-scroll"></a><h3>The <code class="literal">“move-scroll”</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
user_function (<a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu,
<a class="link" href="gtk3-Standard-Enumerations.html#GtkScrollType" title="enum GtkScrollType"><span class="type">GtkScrollType</span></a> scroll_type,
<span class="type">gpointer</span> user_data)</pre>
<div class="refsect3">
<a name="GtkMenu-move-scroll.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>scroll_type</p></td>
<td class="parameter_description"><p>a <a class="link" href="gtk3-Standard-Enumerations.html#GtkScrollType" title="enum GtkScrollType"><span class="type">GtkScrollType</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p>Flags: Action</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkMenu-popped-up"></a><h3>The <code class="literal">“popped-up”</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
user_function (<a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> *menu,
<span class="type">gpointer</span> flipped_rect,
<span class="type">gpointer</span> final_rect,
<span class="type">gboolean</span> flipped_x,
<span class="type">gboolean</span> flipped_y,
<span class="type">gpointer</span> user_data)</pre>
<p>Emitted when the position of <em class="parameter"><code>menu</code></em>
is finalized after being popped up
using <a class="link" href="GtkMenu.html#gtk-menu-popup-at-rect" title="gtk_menu_popup_at_rect ()"><code class="function">gtk_menu_popup_at_rect()</code></a>, <a class="link" href="GtkMenu.html#gtk-menu-popup-at-widget" title="gtk_menu_popup_at_widget ()"><code class="function">gtk_menu_popup_at_widget()</code></a>, or
<a class="link" href="GtkMenu.html#gtk-menu-popup-at-pointer" title="gtk_menu_popup_at_pointer ()"><code class="function">gtk_menu_popup_at_pointer()</code></a>.</p>
<p><em class="parameter"><code>menu</code></em>
might be flipped over the anchor rectangle in order to keep it
on-screen, in which case <em class="parameter"><code>flipped_x</code></em>
and <em class="parameter"><code>flipped_y</code></em>
will be set to <code class="literal">TRUE</code>
accordingly.</p>
<p><em class="parameter"><code>flipped_rect</code></em>
is the ideal position of <em class="parameter"><code>menu</code></em>
after any possible flipping,
but before any possible sliding. <em class="parameter"><code>final_rect</code></em>
is <em class="parameter"><code>flipped_rect</code></em>
, but possibly
translated in the case that flipping is still ineffective in keeping <em class="parameter"><code>menu</code></em>
on-screen.</p>
<p><span class="inlinemediaobject"><img src="popup-slide.png"></span></p>
<p>The blue menu is <em class="parameter"><code>menu</code></em>
's ideal position, the green menu is <em class="parameter"><code>flipped_rect</code></em>
,
and the red menu is <em class="parameter"><code>final_rect</code></em>
.</p>
<p>See <a class="link" href="GtkMenu.html#gtk-menu-popup-at-rect" title="gtk_menu_popup_at_rect ()"><code class="function">gtk_menu_popup_at_rect()</code></a>, <a class="link" href="GtkMenu.html#gtk-menu-popup-at-widget" title="gtk_menu_popup_at_widget ()"><code class="function">gtk_menu_popup_at_widget()</code></a>,
<a class="link" href="GtkMenu.html#gtk-menu-popup-at-pointer" title="gtk_menu_popup_at_pointer ()"><code class="function">gtk_menu_popup_at_pointer()</code></a>, <a class="link" href="GtkMenu.html#GtkMenu--anchor-hints" title="The “anchor-hints” property"><span class="type">“anchor-hints”</span></a>,
<a class="link" href="GtkMenu.html#GtkMenu--rect-anchor-dx" title="The “rect-anchor-dx” property"><span class="type">“rect-anchor-dx”</span></a>, <a class="link" href="GtkMenu.html#GtkMenu--rect-anchor-dy" title="The “rect-anchor-dy” property"><span class="type">“rect-anchor-dy”</span></a>, and
<a class="link" href="GtkMenu.html#GtkMenu--menu-type-hint" title="The “menu-type-hint” property"><span class="type">“menu-type-hint”</span></a>.</p>
<div class="refsect3">
<a name="GtkMenu-popped-up.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>menu</p></td>
<td class="parameter_description"><p>the <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> that popped up</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flipped_rect</p></td>
<td class="parameter_description"><p>the position of <em class="parameter"><code>menu</code></em>
after any possible
flipping or <code class="literal">NULL</code> if the backend can't obtain it. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>final_rect</p></td>
<td class="parameter_description"><p>the final position of <em class="parameter"><code>menu</code></em>
or <code class="literal">NULL</code> if the
backend can't obtain it. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>flipped_x</p></td>
<td class="parameter_description"><p><code class="literal">TRUE</code> if the anchors were flipped horizontally</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flipped_y</p></td>
<td class="parameter_description"><p><code class="literal">TRUE</code> if the anchors were flipped vertically</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p>Flags: Run First</p>
<p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>