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 28 29 30 31 32 33 34 35 36
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.ImageMenuItem</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="prev" href="class-gtkimage.html" title="gtk.Image"><link rel="next" href="class-gtkimcontext.html" title="gtk.IMContext"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.ImageMenuItem</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkimage.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkimcontext.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkimagemenuitem"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.ImageMenuItem</h2><p>gtk.ImageMenuItem — a menuitem that displays an image with an accel
label</p></div><div class="refsect1" lang="en"><a name="id3358630"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.ImageMenuItem</span></span>(<span class="ooclass"><span class="classname"><a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem">gtk.MenuItem</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-gtkimagemenuitem.html#constructor-gtkimagemenuitem" title="Constructor">gtk.ImageMenuItem</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>stock_id</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_group</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkimagemenuitem.html#method-gtkimagemenuitem--set-image" title="gtk.ImageMenuItem.set_image">set_image</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>image</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkimagemenuitem.html#method-gtkimagemenuitem--get-image" title="gtk.ImageMenuItem.get_image">get_image</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3358752"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
+-- <a class="link" href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
+-- <a class="link" href="class-gtkcontainer.html" title="gtk.Container">gtk.Container</a>
+-- <a class="link" href="class-gtkbin.html" title="gtk.Bin">gtk.Bin</a>
+-- <a class="link" href="class-gtkitem.html" title="gtk.Item">gtk.Item</a>
+-- <a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem">gtk.MenuItem</a>
+-- <a class="link" href="class-gtkimagemenuitem.html" title="gtk.ImageMenuItem">gtk.ImageMenuItem</a>
</pre></div><div class="refsect1" lang="en"><a name="id3358816"></a><h2>Implemented Interfaces</h2><p>
<a class="link" href="class-gtkimagemenuitem.html" title="gtk.ImageMenuItem"><code class="classname">gtk.ImageMenuItem</code></a>
implements
<a class="link" href="class-gtkbuildable.html" title="gtk.Buildable"><code class="classname">gtk.Buildable</code></a>
</p></div><div class="refsect1" lang="en"><a name="properties-gtkimagemenuitem"></a><h2>gtk.ImageMenuItem Properties</h2><p><a class="link" href="class-gtkobject.html#properties-gtkobject" title="gtk.Object Properties">gtk.Object Properties</a></p><p><a class="link" href="class-gtkwidget.html#properties-gtkwidget" title="gtk.Widget Properties">gtk.Widget Properties</a></p><p><a class="link" href="class-gtkcontainer.html#properties-gtkcontainer" title="gtk.Container Properties">gtk.Container Properties</a></p><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"image"</td><td valign="top">Read-Write</td><td valign="top">the child widget that is next to the text in the menu
item</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="style-properties-gtkimagemenuitem"></a><h2>gtk.ImageMenuItem Style Properties</h2><p><a class="link" href="class-gtkwidget.html#style-properties-gtkwidget" title="gtk.Widget Style Properties">gtk.Widget Style Properties</a></p><p><a class="link" href="class-gtkmenuitem.html#style-properties-gtkmenuitem" title="gtk.MenuItem Style Properties">gtk.MenuItem Style Properties</a></p></div><div class="refsect1" lang="en"><a name="signal-prototypes-gtkimagemenuitem"></a><h2>gtk.ImageMenuItem Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></p><p><a class="link" href="class-gtkobject.html#signal-prototypes-gtkobject" title="gtk.Object Signal Prototypes">gtk.Object Signal Prototypes</a></p><p><a class="link" href="class-gtkwidget.html#signal-prototypes-gtkwidget" title="gtk.Widget Signal Prototypes">gtk.Widget Signal Prototypes</a></p><p><a class="link" href="class-gtkcontainer.html#signal-prototypes-gtkcontainer" title="gtk.Container Signal Prototypes">gtk.Container Signal Prototypes</a></p><p><a class="link" href="class-gtkitem.html#signal-prototypes-gtkitem" title="gtk.Item Signal Prototypes">gtk.Item Signal Prototypes</a></p><p><a class="link" href="class-gtkmenuitem.html#signal-prototypes-gtkmenuitem" title="gtk.MenuItem Signal Prototypes">gtk.MenuItem Signal Prototypes</a></p></div><div class="refsect1" lang="en"><a name="id3359025"></a><h2>Description</h2><p>The <a class="link" href="class-gtkimagemenuitem.html" title="gtk.ImageMenuItem"><code class="classname">gtk.ImageMenuItem</code></a>
widget is a subclass of <a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem"><code class="classname">gtk.MenuItem</code></a> that
contains an image widget and a <a class="link" href="class-gtkaccellabel.html" title="gtk.AccelLabel"><code class="classname">gtk.AccelLabel</code></a>
though a <a class="link" href="class-gtkimagemenuitem.html" title="gtk.ImageMenuItem"><code class="classname">gtk.ImageMenuItem</code></a>
can be created that has no image and an empty label.</p></div><div class="refsect1" lang="en"><a name="constructor-gtkimagemenuitem"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.ImageMenuItem</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>stock_id</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_group</code></strong></span><span class="initializer">=None</span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>stock_id</code></strong> :</span></p></td><td>the stock icon ID or <code class="literal">None</code> if
no image is needed</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>accel_group</code></strong> :</span></p></td><td>the accel group to add the accel label mnemonic
to</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="class-gtkimagemenuitem.html" title="gtk.ImageMenuItem"><code class="classname">gtk.ImageMenuItem</code></a>
widget</td></tr></tbody></table><p>Creates a new <a class="link" href="class-gtkimagemenuitem.html" title="gtk.ImageMenuItem"><code class="classname">gtk.ImageMenuItem</code></a>
with a stock label and image specified by <em class="parameter"><code>stock_id</code></em>.
If <em class="parameter"><code>stock_id</code></em> is not a stock item then the image will
be the "broken image" and the label text will be the string in
<em class="parameter"><code>stock_id</code></em>. The label text will be parsed for
underscore characters to indicate the mnemonic character for the
accelerator.</p><p>If <em class="parameter"><code>stock_id</code></em> specifies a stock item and
<em class="parameter"><code>accel_group</code></em> specifies a <a class="link" href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><code class="classname">gtk.AccelGroup</code></a>
the accelerator is added to <em class="parameter"><code>accel_group</code></em>.</p></div><div class="refsect1" lang="en"><a name="id3359260"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkimagemenuitem--set-image"></a><h3>gtk.ImageMenuItem.set_image</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_image</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>image</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>image</code></strong> :</span></p></td><td>a widget to set as the image for the menu
item.</td></tr></tbody></table><p>The <code class="methodname">set_image</code>() method sets the image
of the image menu item to the widget specified in
<em class="parameter"><code>image</code></em>.</p></div><div class="refsect2" lang="en"><a name="method-gtkimagemenuitem--get-image"></a><h3>gtk.ImageMenuItem.get_image</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_image</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the image in the image menu
item</td></tr></tbody></table><p>The <code class="methodname">get_image</code>() method gets the widget
that is currently set as the image of image menu item. See <a class="link" href="class-gtkimagemenuitem.html#method-gtkimagemenuitem--set-image" title="gtk.ImageMenuItem.set_image"><code class="methodname">set_image</code>()</a>.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gtkimage.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gtk-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-gtkimcontext.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.Image </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.IMContext</td></tr></table></div></body></html>
|