<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>gtkmm: Gtk::ComboBoxText Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="namespaceGtk.html">Gtk</a>::<a class="el" href="classGtk_1_1ComboBoxText.html">ComboBoxText</a> </div> </div> <div class="contents"> <h1>Gtk::ComboBoxText Class Reference<br/> <small> [<a class="el" href="group__Widgets.html">Widgets</a>]</small> </h1><!-- doxytag: class="Gtk::ComboBoxText" --><!-- doxytag: inherits="Gtk::ComboBox" --> <p>This is a specialisation of the <a class="el" href="classGtk_1_1ComboBox.html" title="A widget used to choose from a list of items.">ComboBox</a> which has one column of text (a simple list), and appropriate methods for setting and getting the text. <a href="#_details">More...</a></p> <p>Inherits <a class="el" href="classGtk_1_1ComboBox.html">Gtk::ComboBox</a>.</p> <div class="dynheader"> Collaboration diagram for Gtk::ComboBoxText:</div> <div class="dynsection"> <div class="center"><img src="classGtk_1_1ComboBoxText__coll__graph.png" border="0" usemap="#Gtk_1_1ComboBoxText_coll__map" alt="Collaboration graph"/></div> <map name="Gtk_1_1ComboBoxText_coll__map" id="Gtk_1_1ComboBoxText_coll__map"> <area shape="rect" href="classGtk_1_1ComboBox.html" title="A widget used to choose from a list of items." alt="" coords="1920,111,2035,140"/><area shape="rect" href="classGtk_1_1Bin.html" title="A container with just one child." alt="" coords="1580,59,1649,88"/><area shape="rect" href="classGtk_1_1Container.html" title="Abstract container class." alt="" coords="1201,59,1305,88"/><area shape="rect" href="classGtk_1_1Widget.html" title="Abstract Widget (Base class for all widgets)." alt="" coords="911,59,1001,88"/><area shape="rect" href="classGtk_1_1Object.html" title="Gtk::Object is the base class for all widgets, and for a few non-widget objects such..." alt="" coords="552,5,640,35"/><area shape="rect" href="../../../glibmm-2.4/reference/html/classGlib_1_1Object.html" title="Glib::Object" alt="" coords="340,5,431,35"/><area shape="rect" href="../../../glibmm-2.4/reference/html/classGlib_1_1ObjectBase.html" title="Glib::ObjectBase" alt="" coords="163,31,283,60"/><area shape="rect" href="../../../glibmm-2.4/reference/html/classGlib_1_1Interface.html" title="Glib::Interface" alt="" coords="333,59,437,88"/><area shape="rect" href="../../../libsigc++-2.0/reference/html/structsigc_1_1trackable.html" title="sigc::trackable" alt="" coords="5,31,112,60"/><area shape="rect" href="classAtk_1_1Implementor.html" title="Atk::Implementor" alt="" coords="536,59,656,88"/><area shape="rect" href="classGtk_1_1CellLayout.html" title="An interface for packing cells." alt="" coords="728,111,840,140"/><area shape="rect" href="classGtk_1_1ComboBoxText_1_1TextModelColumns.html" title="Gtk::ComboBoxText::TextModelColumns" alt="" coords="1848,175,2107,204"/><area shape="rect" href="classGtk_1_1TreeModelColumnRecord.html" title="Typedefed as TreeModel::ColumnRecord." alt="" coords="1513,175,1716,204"/><area shape="rect" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00716.html" title="std::vector\< GType \>" alt="" coords="1181,175,1325,204"/><area shape="rect" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00716.html" title="std::vector\< _Tp, _Alloc \>" alt="" coords="869,213,1043,243"/><area shape="rect" href="classGtk_1_1TreeModelColumn.html" title="Gtk::TreeModelColumn\< Glib::ustring \>" alt="" coords="1491,244,1739,273"/><area shape="rect" href="classGtk_1_1TreeModelColumnBase.html" title="Base class of TreeModelColumn templates." alt="" coords="864,276,1048,305"/><area shape="rect" href="classGtk_1_1TreeModelColumn.html" title="A Gtk::TreeModelColumn describes the C++ type of the data in a model column, and..." alt="" coords="1160,296,1347,325"/></map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <p><a href="classGtk_1_1ComboBoxText-members.html">List of all members.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Classes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1ComboBoxText_1_1TextModelColumns.html">TextModelColumns</a></td></tr> <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1ComboBoxText.html#a77c48f90f4e954e23851d2b159ad2bf7">ComboBoxText</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1ComboBoxText.html#ab6a4b6f833c964144ecb9ce79b9f949d">append_text</a> (const <a class="elRef" href="../../../glibmm-2.4/reference/html/classGlib_1_1ustring.html">Glib::ustring</a>& text)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Add an item to the end of the drop-down list. <a href="#ab6a4b6f833c964144ecb9ce79b9f949d"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1ComboBoxText.html#a9c8f65b084135fefe8831a60294298ee">insert_text</a> (int position, const <a class="elRef" href="../../../glibmm-2.4/reference/html/classGlib_1_1ustring.html">Glib::ustring</a>& text)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1ComboBoxText.html#a6a1e6e454739ae9b1bd4a56b1de72189">prepend_text</a> (const <a class="elRef" href="../../../glibmm-2.4/reference/html/classGlib_1_1ustring.html">Glib::ustring</a>& text)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Add an item to the beginning of the drop-down list. <a href="#a6a1e6e454739ae9b1bd4a56b1de72189"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="../../../glibmm-2.4/reference/html/classGlib_1_1ustring.html">Glib::ustring</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1ComboBoxText.html#ae05272a2c05da608573cd1d19382bdf2">get_active_text</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the currently-chosen item. <a href="#ae05272a2c05da608573cd1d19382bdf2"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1ComboBoxText.html#ab1c6c5c2567690ef2f59b10a493e0b3c">set_active_text</a> (const <a class="elRef" href="../../../glibmm-2.4/reference/html/classGlib_1_1ustring.html">Glib::ustring</a>& text)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the currently-chosen item if it matches the specified text. <a href="#ab1c6c5c2567690ef2f59b10a493e0b3c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1ComboBoxText.html#aff2f7bdb9e8796eb4f30fba36a37435e">clear</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1ComboBoxText.html#aec3e17b23e8b13957e25547f1ef08d05">clear_items</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Remove all items from the drop-down menu. <a href="#aec3e17b23e8b13957e25547f1ef08d05"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1ComboBoxText.html#ad7a41e39e26df6fbe327c5f68f0b7920">remove_text</a> (const <a class="elRef" href="../../../glibmm-2.4/reference/html/classGlib_1_1ustring.html">Glib::ustring</a>& text)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Remove the specified item if it is in the drop-down menu. <a href="#ad7a41e39e26df6fbe327c5f68f0b7920"></a><br/></td></tr> <tr><td colspan="2"><h2>Protected Attributes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classGtk_1_1ComboBoxText_1_1TextModelColumns.html">TextModelColumns</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGtk_1_1ComboBoxText.html#a9097287174645c2bb861dccc0b759912">m_text_columns</a></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>This is a specialisation of the <a class="el" href="classGtk_1_1ComboBox.html" title="A widget used to choose from a list of items.">ComboBox</a> which has one column of text (a simple list), and appropriate methods for setting and getting the text. </p> <p>Note that you can not use this class with Gnome::Glade::Xml::get_widget_derived() to wrap a GtkComboBox added in the Glade user interface designer, because Glade adds its own <a class="el" href="classGtk_1_1TreeModel.html" title="This class defines a generic tree interface for use by the Gtk::TreeView widget.">TreeModel</a> instead of using the <a class="el" href="classGtk_1_1TreeModel.html" title="This class defines a generic tree interface for use by the Gtk::TreeView widget.">TreeModel</a> from this class. You could use a normal <a class="el" href="classGtk_1_1ComboBox.html" title="A widget used to choose from a list of items.">Gtk::ComboBox</a> instead, though you can not use Glade to add rows to a <a class="el" href="classGtk_1_1TreeModel.html" title="This class defines a generic tree interface for use by the Gtk::TreeView widget.">TreeModel</a> that is defined in your C++ code. </p> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a77c48f90f4e954e23851d2b159ad2bf7"></a><!-- doxytag: member="Gtk::ComboBoxText::ComboBoxText" ref="a77c48f90f4e954e23851d2b159ad2bf7" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Gtk::ComboBoxText::ComboBoxText </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="ab6a4b6f833c964144ecb9ce79b9f949d"></a><!-- doxytag: member="Gtk::ComboBoxText::append_text" ref="ab6a4b6f833c964144ecb9ce79b9f949d" args="(const Glib::ustring &text)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Gtk::ComboBoxText::append_text </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="../../../glibmm-2.4/reference/html/classGlib_1_1ustring.html">Glib::ustring</a> & </td> <td class="paramname"> <em>text</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Add an item to the end of the drop-down list. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>text</em> </td><td>The text for the item. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="aff2f7bdb9e8796eb4f30fba36a37435e"></a><!-- doxytag: member="Gtk::ComboBoxText::clear" ref="aff2f7bdb9e8796eb4f30fba36a37435e" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Gtk::ComboBoxText::clear </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000117">Deprecated:</a></b></dt><dd>See <a class="el" href="classGtk_1_1ComboBoxText.html#aec3e17b23e8b13957e25547f1ef08d05" title="Remove all items from the drop-down menu.">clear_items()</a>. Since 2.8. </dd></dl> <p>Reimplemented from <a class="el" href="classGtk_1_1CellLayout.html#ab87faf407763c4df8985ac7ff985fad8">Gtk::CellLayout</a>.</p> </div> </div> <a class="anchor" id="aec3e17b23e8b13957e25547f1ef08d05"></a><!-- doxytag: member="Gtk::ComboBoxText::clear_items" ref="aec3e17b23e8b13957e25547f1ef08d05" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Gtk::ComboBoxText::clear_items </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Remove all items from the drop-down menu. </p> </div> </div> <a class="anchor" id="ae05272a2c05da608573cd1d19382bdf2"></a><!-- doxytag: member="Gtk::ComboBoxText::get_active_text" ref="ae05272a2c05da608573cd1d19382bdf2" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="elRef" href="../../../glibmm-2.4/reference/html/classGlib_1_1ustring.html">Glib::ustring</a> Gtk::ComboBoxText::get_active_text </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Get the currently-chosen item. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>The text of the active item. </dd></dl> </div> </div> <a class="anchor" id="a9c8f65b084135fefe8831a60294298ee"></a><!-- doxytag: member="Gtk::ComboBoxText::insert_text" ref="a9c8f65b084135fefe8831a60294298ee" args="(int position, const Glib::ustring &text)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Gtk::ComboBoxText::insert_text </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>position</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" href="../../../glibmm-2.4/reference/html/classGlib_1_1ustring.html">Glib::ustring</a> & </td> <td class="paramname"> <em>text</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <a class="anchor" id="a6a1e6e454739ae9b1bd4a56b1de72189"></a><!-- doxytag: member="Gtk::ComboBoxText::prepend_text" ref="a6a1e6e454739ae9b1bd4a56b1de72189" args="(const Glib::ustring &text)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Gtk::ComboBoxText::prepend_text </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="../../../glibmm-2.4/reference/html/classGlib_1_1ustring.html">Glib::ustring</a> & </td> <td class="paramname"> <em>text</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Add an item to the beginning of the drop-down list. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>text</em> </td><td>The text for the item. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="ad7a41e39e26df6fbe327c5f68f0b7920"></a><!-- doxytag: member="Gtk::ComboBoxText::remove_text" ref="ad7a41e39e26df6fbe327c5f68f0b7920" args="(const Glib::ustring &text)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Gtk::ComboBoxText::remove_text </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="../../../glibmm-2.4/reference/html/classGlib_1_1ustring.html">Glib::ustring</a> & </td> <td class="paramname"> <em>text</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Remove the specified item if it is in the drop-down menu. </p> <p>The text of the item that should be removed. </p> </div> </div> <a class="anchor" id="ab1c6c5c2567690ef2f59b10a493e0b3c"></a><!-- doxytag: member="Gtk::ComboBoxText::set_active_text" ref="ab1c6c5c2567690ef2f59b10a493e0b3c" args="(const Glib::ustring &text)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Gtk::ComboBoxText::set_active_text </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="../../../glibmm-2.4/reference/html/classGlib_1_1ustring.html">Glib::ustring</a> & </td> <td class="paramname"> <em>text</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Set the currently-chosen item if it matches the specified text. </p> <p>The text of the item that should be selected. </p> </div> </div> <hr/><h2>Member Data Documentation</h2> <a class="anchor" id="a9097287174645c2bb861dccc0b759912"></a><!-- doxytag: member="Gtk::ComboBoxText::m_text_columns" ref="a9097287174645c2bb861dccc0b759912" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classGtk_1_1ComboBoxText_1_1TextModelColumns.html">TextModelColumns</a> <a class="el" href="classGtk_1_1ComboBoxText.html#a9097287174645c2bb861dccc0b759912">Gtk::ComboBoxText::m_text_columns</a><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>gtkmm/comboboxtext.h</li> </ul> </div> <hr size="1"/><address style="text-align: right;"><small>Generated on Tue May 4 13:22:10 2010 for gtkmm by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> </body> </html>