/usr/share/gtk-doc/html/pygtk/class-gtkcomboboxentry.html is in python-gtk2-doc 2.24.0-5.1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.ComboBoxEntry</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" 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-gtkcombobox.html" title="gtk.ComboBox"><link rel="next" href="class-gtkcomboboxtext.html" title="gtk.ComboBoxText"></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.ComboBoxEntry</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkcombobox.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkcomboboxtext.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.ComboBoxEntry"><a name="class-gtkcomboboxentry"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.ComboBoxEntry</h2><p>gtk.ComboBoxEntry — a text entry field with
a dropdown list (new in PyGTK 2.4)</p></div><div class="refsect1" title="Synopsis"><a name="id3656674"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.ComboBoxEntry</span></span>(<span class="ooclass"><span class="classname"><a class="link" href="class-gtkcombobox.html" title="gtk.ComboBox">gtk.ComboBox</a></span></span>, <span class="ooclass"><span class="classname"><a class="link" href="class-gtkcelllayout.html" title="gtk.CellLayout">gtk.CellLayout</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-gtkcomboboxentry.html#constructor-gtkcomboboxentry" title="Constructor">gtk.ComboBoxEntry</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>model</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>column</code></strong></span><span class="initializer">=-1</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkcomboboxentry.html#method-gtkcomboboxentry--set-text-column" title="gtk.ComboBoxEntry.set_text_column">set_text_column</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>text_column</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkcomboboxentry.html#method-gtkcomboboxentry--get-text-column" title="gtk.ComboBoxEntry.get_text_column">get_text_column</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table><pre class="programlisting">
<span class="bold"><strong>Functions</strong></span>
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkcomboboxentry.html#function-gtk--combo-box-entry-new-text" title="gtk.combo_box_entry_new_text">gtk.combo_box_entry_new_text</a></span>(<span class="methodparam"></span>)</code></pre></div><div class="refsect1" title="Ancestry"><a name="id3656815"></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-gtkcombobox.html" title="gtk.ComboBox">gtk.ComboBox</a>
+-- <a class="link" href="class-gtkcomboboxentry.html" title="gtk.ComboBoxEntry">gtk.ComboBoxEntry</a>
</pre></div><div class="refsect1" title="Implemented Interfaces"><a name="id3656863"></a><h2>Implemented Interfaces</h2><p>
<a class="link" href="class-gtkcomboboxentry.html" title="gtk.ComboBoxEntry"><code class="classname">gtk.ComboBoxEntry</code></a>
implements
<a class="link" href="class-gtkbuildable.html" title="gtk.Buildable"><code class="classname">gtk.Buildable</code></a>
<a class="link" href="class-gtkcelllayout.html" title="gtk.CellLayout"><code class="classname">gtk.CellLayout</code></a>
</p></div><div class="refsect1" title="gtk.ComboBoxEntry Properties"><a name="properties-gtkcomboboxentry"></a><h2>gtk.ComboBoxEntry 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><p><a class="link" href="class-gtkcombobox.html#properties-gtkcombobox" title="gtk.ComboBox Properties">gtk.ComboBox 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 width="1in"><col width="1in"><col width="4in"></colgroup><tbody><tr valign="top"><td valign="top">"text-column"</td><td valign="top">Read-Write</td><td valign="top">The column in the <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
to get the strings from.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="gtk.ComboBoxEntry Style Properties"><a name="style-properties-gtkcomboboxentry"></a><h2>gtk.ComboBoxEntry 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-gtkcombobox.html#style-properties-gtkcombobox" title="gtk.ComboBox Style Properties">gtk.ComboBox Style Properties</a></p></div><div class="refsect1" title="gtk.ComboBoxEntry Signal Prototypes"><a name="signal-prototypes-gtkcomboboxentry"></a><h2>gtk.ComboBoxEntry 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-gtkcombobox.html#signal-prototypes-gtkcombobox" title="gtk.ComboBox Signal Prototypes">gtk.ComboBox Signal Prototypes</a></p><p><a class="link" href="class-gtkcelleditable.html#signal-prototypes-gtkcelleditable" title="gtk.CellEditable Signal Prototypes">gtk.CellEditable Signal Prototypes</a></p></div><div class="refsect1" title="Description"><a name="id3657052"></a><h2>Description</h2><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This widget is available in GTK+ 2.4 and PyGTK 2.4 and
above.</p></div><p>The <a class="link" href="class-gtkcomboboxentry.html" title="gtk.ComboBoxEntry"><code class="classname">gtk.ComboBoxEntry</code></a>
is a replacement for the <a class="link" href="class-gtkcombo.html" title="gtk.Combo"><code class="classname">gtk.Combo</code></a>. The <a class="link" href="class-gtkcomboboxentry.html" title="gtk.ComboBoxEntry"><code class="classname">gtk.ComboBoxEntry</code></a>
is subclassed from <a class="link" href="class-gtkcombobox.html" title="gtk.ComboBox"><code class="classname">gtk.ComboBox</code></a> and
implements the <a class="link" href="class-gtkcelllayout.html" title="gtk.CellLayout"><code class="classname">gtk.CellLayout</code></a>
interface; refer to their descriptions for a number of useful methods and
properties for managing the contents of a combo box entry. A <a class="link" href="class-gtkcomboboxentry.html" title="gtk.ComboBoxEntry"><code class="classname">gtk.ComboBoxEntry</code></a>
also contains a child <a class="link" href="class-gtkentry.html" title="gtk.Entry"><code class="classname">gtk.Entry</code></a> accessed by
using the child attribute of the combo box entry:</p><pre class="programlisting">
entry = comboboxentry.child
</pre><p>A <a class="link" href="class-gtkcomboboxentry.html" title="gtk.ComboBoxEntry"><code class="classname">gtk.ComboBoxEntry</code></a>
is created with the <a class="link" href="class-gtkcomboboxentry.html#constructor-gtkcomboboxentry" title="Constructor">gtk.ComboBoxEntry()</a>
constructor. The constructor can also be called with the optional parameters
<em class="parameter"><code>model</code></em> (a <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a> -
default <code class="literal">None</code>) and <em class="parameter"><code>column</code></em> (a number
of a column in <em class="parameter"><code>model</code></em> - default 0). If no <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a> is
specified it can be added later with the <a class="link" href="class-gtkcombobox.html#method-gtkcombobox--set-model" title="gtk.ComboBox.set_model"><code class="methodname">set_model</code>()</a>
method. The text column can be changed using the <a class="link" href="class-gtkcomboboxentry.html#method-gtkcomboboxentry--set-text-column" title="gtk.ComboBoxEntry.set_text_column"><code class="methodname">set_text_column</code>()</a>
method. A new combo box entry is created and packed with a <a class="link" href="class-gtkcellrenderertext.html" title="gtk.CellRendererText"><code class="classname">gtk.CellRendererText</code></a>
but no attribute mappings are set on the cell renderer.</p><p>Alternatively, the <a class="link" href="class-gtkcomboboxentry.html#function-gtk--combo-box-entry-new-text" title="gtk.combo_box_entry_new_text"><code class="function">gtk.combo_box_entry_new_text</code>()</a>
function creates a <a class="link" href="class-gtkcomboboxentry.html" title="gtk.ComboBoxEntry"><code class="classname">gtk.ComboBoxEntry</code></a>
with an associated <a class="link" href="class-gtkliststore.html" title="gtk.ListStore"><code class="classname">gtk.ListStore</code></a>
model and the text column attribute mapping set to 0. In this combo box
entry each list item is a text string that can be selected. The convenience
methods <a class="link" href="class-gtkcombobox.html#method-gtkcombobox--append-text" title="gtk.ComboBox.append_text"><code class="methodname">gtk.ComboBox.append_text</code>()</a>,
<a class="link" href="class-gtkcombobox.html#method-gtkcombobox--prepend-text" title="gtk.ComboBox.prepend_text"><code class="methodname">gtk.ComboBox.prepend_text</code>()</a>,
<a class="link" href="class-gtkcombobox.html#method-gtkcombobox--insert-text" title="gtk.ComboBox.insert_text"><code class="methodname">gtk.ComboBox.insert_text</code>()</a>
and <a class="link" href="class-gtkcombobox.html#method-gtkcombobox--remove-text" title="gtk.ComboBox.remove_text"><code class="methodname">gtk.ComboBox.remove_text</code>()</a>
can be used to manage the contents of the <a class="link" href="class-gtkcomboboxentry.html" title="gtk.ComboBoxEntry"><code class="classname">gtk.ComboBoxEntry</code></a>. Using
the <a class="link" href="class-gtkcomboboxentry.html#function-gtk--combo-box-entry-new-text" title="gtk.combo_box_entry_new_text"><code class="function">gtk.combo_box_entry_new_text</code>()</a>
function is equivalent to:</p><pre class="programlisting">
liststore = gtk.ListStore(gobject.TYPE_STRING)
comboboxentry = gtk.ComboBoxEntry(liststore, 0)
</pre></div><div class="refsect1" title="Constructor"><a name="constructor-gtkcomboboxentry"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.ComboBoxEntry</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>model</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>column</code></strong></span><span class="initializer">=-1</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>model</code></strong> :</span></p></td><td>The <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
to associate with the combo box entry, or
<code class="literal">None</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>column</code></strong> :</span></p></td><td>The number of the column to use for setting the
strings of the combo box entry.</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-gtkcomboboxentry.html" title="gtk.ComboBoxEntry"><code class="classname">gtk.ComboBoxEntry</code></a>.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This constructor is available in PyGTK 2.4 and above.</p></div><p>Creates a new <a class="link" href="class-gtkcomboboxentry.html" title="gtk.ComboBoxEntry"><code class="classname">gtk.ComboBoxEntry</code></a>
that has a <a class="link" href="class-gtkentry.html" title="gtk.Entry"><code class="classname">gtk.Entry</code></a> as child
and associated with the <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
specified by <em class="parameter"><code>model</code></em> and using the column of
<em class="parameter"><code>model</code></em> specified by <em class="parameter"><code>column</code></em> to
retrieve strings. If <em class="parameter"><code>model</code></em> was not specified it
defaults to <code class="literal">None</code> but you can change the model using the
<a class="link" href="class-gtkcombobox.html#method-gtkcombobox--set-model" title="gtk.ComboBox.set_model"><code class="methodname">gtk.ComboBox.set_model()</code></a>
method. If <em class="parameter"><code>column</code></em> was not specified it defaults to -1
meaning the text column is unset but you can change it using the <a class="link" href="class-gtkcomboboxentry.html#method-gtkcomboboxentry--set-text-column" title="gtk.ComboBoxEntry.set_text_column"><code class="methodname">set_text_column</code>()</a>
method. Once the text column is set either in the constructor or using the
<a class="link" href="class-gtkcomboboxentry.html#method-gtkcomboboxentry--set-text-column" title="gtk.ComboBoxEntry.set_text_column"><code class="methodname">set_text_column</code>()</a>
method it cannot be changed. A ValueError exception is thrown if
<em class="parameter"><code>column</code></em> is outside the range of column numbers for
<em class="parameter"><code>model</code></em>.</p></div><div class="refsect1" title="Methods"><a name="id3657492"></a><h2>Methods</h2><div class="refsect2" title="gtk.ComboBoxEntry.set_text_column"><a name="method-gtkcomboboxentry--set-text-column"></a><h3>gtk.ComboBoxEntry.set_text_column</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_text_column</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>text_column</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>text_column</code></strong> :</span></p></td><td>A column in the associated <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
to use as the data source for the strings.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_text_column</code>() method sets the
"text-column" property to the value of <em class="parameter"><code>tree_column</code></em>
only if the text column has not been set (that is, "text-column" is -1). The
value of <em class="parameter"><code>tree_column</code></em> is the number of the tree model
column used as the data source for the strings of the combo box
entry.</p></div><div class="refsect2" title="gtk.ComboBoxEntry.get_text_column"><a name="method-gtkcomboboxentry--get-text-column"></a><h3>gtk.ComboBoxEntry.get_text_column</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_text_column</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 number of the column in the associated
<a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
used as the data source for the combo box
entry.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_text_column</code>() method returns
the number of the <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
column that is used as the data source for the strings of the combo box
entry.</p></div></div><div class="refsect1" title="Functions"><a name="id3657659"></a><h2>Functions</h2><div class="refsect2" title="gtk.combo_box_entry_new_text"><a name="function-gtk--combo-box-entry-new-text"></a><h3>gtk.combo_box_entry_new_text</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.combo_box_entry_new_text</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>A new <a class="link" href="class-gtkcomboboxentry.html" title="gtk.ComboBoxEntry"><code class="classname">gtk.ComboBoxEntry</code></a>
widget.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.4 and above.</p></div><p>The <code class="function">gtk.combo_box_entry_new_text</code>() function
is a convenience function which constructs a new <a class="link" href="class-gtkcomboboxentry.html" title="gtk.ComboBoxEntry"><code class="classname">gtk.ComboBoxEntry</code></a>,
just displaying strings. If you use this function to create a combo box
entry, you should only manipulate its <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
data source with the following <a class="link" href="class-gtkcombobox.html" title="gtk.ComboBox"><code class="classname">gtk.ComboBox</code></a>
convenience methods: <a class="link" href="class-gtkcombobox.html#method-gtkcombobox--append-text" title="gtk.ComboBox.append_text"><code class="methodname">gtk.ComboBox.append_text</code>()</a>,
<a class="link" href="class-gtkcombobox.html#method-gtkcombobox--insert-text" title="gtk.ComboBox.insert_text"><code class="methodname">gtk.ComboBox.insert_text</code>()</a>,
<a class="link" href="class-gtkcombobox.html#method-gtkcombobox--prepend-text" title="gtk.ComboBox.prepend_text"><code class="methodname">gtk.ComboBox.prepend_text</code>()</a>
and <a class="link" href="class-gtkcombobox.html#method-gtkcombobox--remove-text" title="gtk.ComboBox.remove_text"><code class="methodname">gtk.ComboBox.remove_text</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-gtkcombobox.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-gtkcomboboxtext.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.ComboBox </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.ComboBoxText</td></tr></table></div></body></html>
|