📄 gtkimagemenuitem.html
字号:
<tr><td><p><span class="term"><em class="parameter"><code>image_menu_item</code></em> :</span></p></td><td> a <a class="link" href="GtkImageMenuItem.html" title="GtkImageMenuItem"><span class="type">GtkImageMenuItem</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td><td> a widget to set as the image for the menu item.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3902895"></a><h3><a name="gtk-image-menu-item-get-image"></a>gtk_image_menu_item_get_image ()</h3><a class="indexterm" name="id3902909"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_image_menu_item_get_image (<a class="link" href="GtkImageMenuItem.html" title="GtkImageMenuItem">GtkImageMenuItem</a> *image_menu_item);</pre><p>Gets the widget that is currently set as the image of <em class="parameter"><code>image_menu_item</code></em>.See <a class="link" href="GtkImageMenuItem.html#gtk-image-menu-item-set-image"><code class="function">gtk_image_menu_item_set_image()</code></a>.</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>image_menu_item</code></em> :</span></p></td><td> a <a class="link" href="GtkImageMenuItem.html" title="GtkImageMenuItem"><span class="type">GtkImageMenuItem</span></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the widget set as image of <em class="parameter"><code>image_menu_item</code></em>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3903002"></a><h3><a name="gtk-image-menu-item-new"></a>gtk_image_menu_item_new ()</h3><a class="indexterm" name="id3903015"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_image_menu_item_new (void);</pre><p>Creates a new <a class="link" href="GtkImageMenuItem.html" title="GtkImageMenuItem"><span class="type">GtkImageMenuItem</span></a> with an empty label.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a new <a class="link" href="GtkImageMenuItem.html" title="GtkImageMenuItem"><span class="type">GtkImageMenuItem</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3903072"></a><h3><a name="gtk-image-menu-item-new-from-stock"></a>gtk_image_menu_item_new_from_stock ()</h3><a class="indexterm" name="id3903086"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_image_menu_item_new_from_stock (const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *stock_id, <a class="link" href="gtk-Keyboard-Accelerators.html#GtkAccelGroup">GtkAccelGroup</a> *accel_group);</pre><p>Creates a new <a class="link" href="GtkImageMenuItem.html" title="GtkImageMenuItem"><span class="type">GtkImageMenuItem</span></a> containing the image and text from a stock item. Some stock ids have preprocessor macros like <a class="link" href="gtk-Stock-Items.html#GTK-STOCK-OK:CAPS"><span class="type">GTK_STOCK_OK</span></a> and <a class="link" href="gtk-Stock-Items.html#GTK-STOCK-APPLY:CAPS"><span class="type">GTK_STOCK_APPLY</span></a>.</p><p>If you want this menu item to have changeable accelerators, then pass in<ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> for accel_group. Next call <a class="link" href="GtkMenuItem.html#gtk-menu-item-set-accel-path"><code class="function">gtk_menu_item_set_accel_path()</code></a> with anappropriate path for the menu item, use <a class="link" href="gtk-Stock-Items.html#gtk-stock-lookup"><code class="function">gtk_stock_lookup()</code></a> to look up thestandard accelerator for the stock item, and if one is found, call<a class="link" href="gtk-Accelerator-Maps.html#gtk-accel-map-add-entry"><code class="function">gtk_accel_map_add_entry()</code></a> to register it.</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>stock_id</code></em> :</span></p></td><td> the name of the stock item.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>accel_group</code></em> :</span></p></td><td> the <a class="link" href="gtk-Keyboard-Accelerators.html#GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> to add the menu items accelerator to, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a new <a class="link" href="GtkImageMenuItem.html" title="GtkImageMenuItem"><span class="type">GtkImageMenuItem</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3903273"></a><h3><a name="gtk-image-menu-item-new-with-label"></a>gtk_image_menu_item_new_with_label ()</h3><a class="indexterm" name="id3903288"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_image_menu_item_new_with_label (const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *label);</pre><p>Creates a new <a class="link" href="GtkImageMenuItem.html" title="GtkImageMenuItem"><span class="type">GtkImageMenuItem</span></a> containing a label.</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>label</code></em> :</span></p></td><td> the text of the menu item.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a new <a class="link" href="GtkImageMenuItem.html" title="GtkImageMenuItem"><span class="type">GtkImageMenuItem</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3903365"></a><h3><a name="gtk-image-menu-item-new-with-mnemonic"></a>gtk_image_menu_item_new_with_mnemonic ()</h3><a class="indexterm" name="id3903379"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_image_menu_item_new_with_mnemonic (const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *label);</pre><p>Creates a new <a class="link" href="GtkImageMenuItem.html" title="GtkImageMenuItem"><span class="type">GtkImageMenuItem</span></a> containing a label. The labelwill be created using <a class="link" href="GtkLabel.html#gtk-label-new-with-mnemonic"><code class="function">gtk_label_new_with_mnemonic()</code></a>, so underscoresin <em class="parameter"><code>label</code></em> indicate the mnemonic for the menu item.</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>label</code></em> :</span></p></td><td> the text of the menu item, with an underscore in front of the mnemonic character</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a new <a class="link" href="GtkImageMenuItem.html" title="GtkImageMenuItem"><span class="type">GtkImageMenuItem</span></a></td></tr></tbody></table></div></div></div><div class="refsect1" lang="en"><a name="id3903479"></a><h2>Property Details</h2><div class="refsect2" lang="en"><a name="id3903489"></a><h3><a name="GtkImageMenuItem--image"></a>The <code class="literal">"image"</code> property</h3><a class="indexterm" name="id3903506"></a><pre class="programlisting"> "image" <a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> : Read / Write</pre><p>Child widget to appear next to the menu text.</p></div></div><div class="refsect1" lang="en"><a name="id3903531"></a><div class="refsect2" lang="en"><a name="id3903532"></a></div><hr><div class="refsect2" lang="en"><a name="id3903533"></a></div></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -