#include <config.h>
#include <string.h>
-#include "gtkalias.h"
#include "gtkintl.h"
#include "gtkbin.h"
#include "gtkentry.h"
#include "gtkcellrenderertext.h"
#include "gtkcombobox.h"
#include "gtkcomboboxentry.h"
+#include "gtkprivate.h"
+#include "gtkalias.h"
static void gtk_cell_renderer_combo_class_init (GtkCellRendererComboClass *klass);
static void gtk_cell_renderer_combo_init (GtkCellRendererCombo *self);
#define GTK_CELL_RENDERER_COMBO_PATH "gtk-cell-renderer-combo-path"
-G_DEFINE_TYPE (GtkCellRendererCombo, gtk_cell_renderer_combo, GTK_TYPE_CELL_RENDERER_TEXT);
+G_DEFINE_TYPE (GtkCellRendererCombo, gtk_cell_renderer_combo, GTK_TYPE_CELL_RENDERER_TEXT)
static void
gtk_cell_renderer_combo_class_init (GtkCellRendererComboClass *klass)
P_("Model"),
P_("The model containing the possible values for the combo box"),
GTK_TYPE_TREE_MODEL,
- G_PARAM_READWRITE));
+ GTK_PARAM_READWRITE));
/**
* GtkCellRendererCombo:text-column:
*
- * Specifies the model column which holds the possible values for the combo box.
+ * Specifies the model column which holds the possible values for the
+ * combo box.
+ *
* Note that this refers to the model specified in the model property,
- * <emphasis>not</emphasis> the model backing the tree view to which this cell
- * renderer is attached.
+ * <emphasis>not</emphasis> the model backing the tree view to which
+ * this cell renderer is attached.
*
+ * #GtkCellRendererCombo automatically adds a text cell renderer for
+ * this column to its combo box.
+ *
* Since: 2.6
*/
g_object_class_install_property (object_class,
PROP_TEXT_COLUMN,
- g_param_spec_int ("text_column",
+ g_param_spec_int ("text-column",
P_("Text Column"),
P_("A column in the data source model to get the strings from"),
-1,
G_MAXINT,
-1,
- G_PARAM_READWRITE));
+ GTK_PARAM_READWRITE));
/**
* GtkCellRendererCombo:has-entry:
*
- * If %TRUE, the cell renderer will include an entry and allow to enter values
- * other than the ones in the popup list.
+ * If %TRUE, the cell renderer will include an entry and allow to enter
+ * values other than the ones in the popup list.
*
* Since: 2.6
*/
g_object_class_install_property (object_class,
PROP_HAS_ENTRY,
- g_param_spec_boolean ("has_entry",
+ g_param_spec_boolean ("has-entry",
P_("Has Entry"),
P_("If FALSE, don't allow to enter strings other than the chosen ones"),
TRUE,
- G_PARAM_READWRITE));
+ GTK_PARAM_READWRITE));
}
/**
* gtk_cell_renderer_combo_new:
*
- * Creates a new #GtkCellRendererCombo
+ * Creates a new #GtkCellRendererCombo.
* Adjust how text is drawn using object properties.
* Object properties can be set globally (with g_object_set()).
* Also, with #GtkTreeViewColumn, you can bind a property to a value
GtkTreeIter iter;
GtkCellRendererCombo *cell;
GtkEntry *entry;
+ gboolean canceled;
cell = GTK_CELL_RENDERER_COMBO (data);
g_signal_handler_disconnect (combo, cell->focus_out_id);
cell->focus_out_id = 0;
}
-
- if (_gtk_combo_box_editing_canceled (GTK_COMBO_BOX (combo)))
- {
- gtk_cell_renderer_editing_canceled (GTK_CELL_RENDERER (data));
- return;
- }
+
+ canceled = _gtk_combo_box_editing_canceled (GTK_COMBO_BOX (combo));
+ gtk_cell_renderer_stop_editing (GTK_CELL_RENDERER (data), canceled);
+ if (canceled)
+ return;
if (GTK_IS_COMBO_BOX_ENTRY (combo))
{
&(search_data.iter));
}
- g_object_set (combo, "has_frame", FALSE, NULL);
+ g_object_set (combo, "has-frame", FALSE, NULL);
g_object_set_data_full (G_OBJECT (combo),
- GTK_CELL_RENDERER_COMBO_PATH,
+ I_(GTK_CELL_RENDERER_COMBO_PATH),
g_strdup (path), g_free);
gtk_widget_show (combo);
return GTK_CELL_EDITABLE (combo);
}
+
+#define __GTK_CELL_RENDERER_COMBO_C__
+#include "gtkaliasdef.c"