* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "gtkcellrenderercombo.h"
#include "gtkcellrenderertext.h"
#include "gtkcombobox.h"
-#include "gtkcomboboxentry.h"
#include "gtkmarshalers.h"
#include "gtkprivate.h"
+
+/**
+ * SECTION:gtkcellrenderercombo
+ * @Short_description: Renders a combobox in a cell
+ * @Title: GtkCellRendererCombo
+ *
+ * #GtkCellRendererCombo renders text in a cell like #GtkCellRendererText from
+ * which it is derived. But while #GtkCellRendererText offers a simple entry to
+ * edit the text, #GtkCellRendererCombo offers a #GtkComboBox
+ * widget to edit the text. The values to display in the combo box are taken from
+ * the tree model specified in the #GtkCellRendererCombo:model property.
+ *
+ * The combo cell renderer takes care of adding a text cell renderer to the combo
+ * box and sets it to display the column specified by its
+ * #GtkCellRendererCombo:text-column property. Further properties of the combo box
+ * can be set in a handler for the #GtkCellRenderer::editing-started signal.
+ *
+ * The #GtkCellRendererCombo cell renderer was added in GTK+ 2.6.
+ */
+
+
struct _GtkCellRendererComboPrivate
{
GtkTreeModel *model;
gint text_column;
- guint focus_out_id;
+ gulong focus_out_id;
};
return;
}
- if (GTK_IS_COMBO_BOX_ENTRY (combo))
+ if (gtk_combo_box_get_has_entry (GTK_COMBO_BOX (combo)))
{
entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo)));
new_text = g_strdup (gtk_entry_get_text (entry));
if (priv->has_entry)
{
- combo = gtk_combo_box_entry_new ();
+ combo = g_object_new (GTK_TYPE_COMBO_BOX, "has-entry", TRUE, NULL);
if (priv->model)
gtk_combo_box_set_model (GTK_COMBO_BOX (combo), priv->model);
- gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (combo),
+ gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (combo),
priv->text_column);
g_object_get (cell_text, "text", &text, NULL);