⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gtkmenu.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 5 页
字号:
</table></div></div><hr><div class="refsect2" lang="en"><a name="id3886544"></a><h3><a name="gtk-menu-attach-to-widget"></a>gtk_menu_attach_to_widget ()</h3><a class="indexterm" name="id3886558"></a><pre class="programlisting">void                gtk_menu_attach_to_widget           (<a class="link" href="GtkMenu.html" title="GtkMenu">GtkMenu</a> *menu,                                                         <a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *attach_widget,                                                         <a class="link" href="GtkMenu.html#GtkMenuDetachFunc">GtkMenuDetachFunc</a> detacher);</pre><p>Attaches the menu to the widget and provides a callback function that willbe invoked when the menu calls <a class="link" href="GtkMenu.html#gtk-menu-detach"><code class="function">gtk_menu_detach()</code></a> during its destruction.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>menu</code></em>&#160;:</span></p></td><td>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>attach_widget</code></em>&#160;:</span></p></td><td>the <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> that the menu will be attached to.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>detacher</code></em>&#160;:</span></p></td><td>the user supplied callback function that will be called when the menu calls <a class="link" href="GtkMenu.html#gtk-menu-detach"><code class="function">gtk_menu_detach()</code></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3886689"></a><h3><a name="gtk-menu-detach"></a>gtk_menu_detach ()</h3><a class="indexterm" name="id3886701"></a><pre class="programlisting">void                gtk_menu_detach                     (<a class="link" href="GtkMenu.html" title="GtkMenu">GtkMenu</a> *menu);</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>, providedwhen the <a class="link" href="GtkMenu.html#gtk-menu-attach-to-widget"><code class="function">gtk_menu_attach_to_widget()</code></a> function was called.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>menu</code></em>&#160;:</span></p></td><td>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3886775"></a><h3><a name="gtk-menu-get-attach-widget"></a>gtk_menu_get_attach_widget ()</h3><a class="indexterm" name="id3886789"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>*          gtk_menu_get_attach_widget          (<a class="link" href="GtkMenu.html" title="GtkMenu">GtkMenu</a> *menu);</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="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>menu</code></em>&#160;:</span></p></td><td>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td>the <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> that the menu is attached to.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3886870"></a><h3><a name="gtk-menu-get-for-attach-widget"></a>gtk_menu_get_for_attach_widget ()</h3><a class="indexterm" name="id3886886"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList">GList</a>*              gtk_menu_get_for_attach_widget      (<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget);</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><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>widget</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> the list of menus attached to his widget.</td></tr></tbody></table></div><p class="since">Since  2.6</p></div><hr><div class="refsect2" lang="en"><a name="id3886963"></a><h3><a name="GtkMenuPositionFunc"></a>GtkMenuPositionFunc ()</h3><a class="indexterm" name="id3886976"></a><pre class="programlisting">void                (*GtkMenuPositionFunc)              (<a class="link" href="GtkMenu.html" title="GtkMenu">GtkMenu</a> *menu,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> *x,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> *y,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> *push_in,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre><p>A user function supplied when calling <a class="link" href="GtkMenu.html#gtk-menu-popup"><code class="function">gtk_menu_popup()</code></a> which controls thepositioning 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.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>menu</code></em>&#160;:</span></p></td><td>a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>x</code></em>&#160;:</span></p></td><td>address of the <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> representing the horizontal position where themenu shall be drawn.  This is an output parameter.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>y</code></em>&#160;:</span></p></td><td>address of the <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> representing the vertical position where themenu shall be drawn.  This is an output parameter.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>push_in</code></em>&#160;:</span></p></td><td>This parameter controls how menus placed outside the monitor are handled.        If this is set to TRUE 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.        To simply constrain the menu within the monitor, get its size with        <a class="link" href="GtkWidget.html#gtk-widget-size-request"><code class="function">gtk_widget_size_request()</code></a> before showing it, and alter the coordinates        passed to <a class="link" href="GtkMenu.html#gtk-menu-popup"><code class="function">gtk_menu_popup()</code></a> accordingly.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td><td>the data supplied by the user in the <a class="link" href="GtkMenu.html#gtk-menu-popup"><code class="function">gtk_menu_popup()</code></a> <em class="parameter"><code>data</code></em>parameter.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3887215"></a><h3><a name="GtkMenuDetachFunc"></a>GtkMenuDetachFunc ()</h3><a class="indexterm" name="id3887228"></a><pre class="programlisting">void                (*GtkMenuDetachFunc)                (<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *attach_widget,                                                         <a class="link" href="GtkMenu.html" title="GtkMenu">GtkMenu</a> *menu);</pre><p>A user function supplied when calling <a class="link" href="GtkMenu.html#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="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>attach_widget</code></em>&#160;:</span></p></td><td>the <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> that the menu is being detached from.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>menu</code></em>&#160;:</span></p></td><td>the <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> being detached.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3887326"></a><h3><a name="gtk-menu-set-monitor"></a>gtk_menu_set_monitor ()</h3><a class="indexterm" name="id3887341"></a><pre class="programlisting">void                gtk_menu_set_monitor                (<a class="link" href="GtkMenu.html" title="GtkMenu">GtkMenu</a> *menu,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> monitor_num);</pre><p>Informs GTK+ on which monitor a menu should be popped up. See <ahref="/usr/share/gtk-doc/html/gdk/GdkScreen.html#gdk-screen-get-monitor-geometry"><code class="function">gdk_screen_get_monitor_geometry()</code></a>.</p><p>This function should be called from a <a class="link" href="GtkMenu.html#GtkMenuPositionFunc"><span class="type">GtkMenuPositionFunc</span></a> if themenu should not appear on the same monitor as the pointer. This information can't be reliably inferred from the coordinates returnedby a <a class="link" href="GtkMenu.html#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><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>menu</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>monitor_num</code></em>&#160;:</span></p></td><td> the number of the monitor on which the menu should   be popped up</td></tr></tbody>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -