gint text_column;
GtkCellRenderer *text_renderer;
- gint id_column;
-
GSList *cells;
guint popup_in_progress : 1;
PROP_EDITING_CANCELED,
PROP_HAS_ENTRY,
PROP_ENTRY_TEXT_COLUMN,
- PROP_POPUP_FIXED_WIDTH,
- PROP_ID_COLUMN
+ PROP_POPUP_FIXED_WIDTH
};
static guint combo_box_signals[LAST_SIGNAL] = {0,};
-1, G_MAXINT, -1,
GTK_PARAM_READWRITE));
- /**
- * GtkComboBox:id-column:
- *
- * The column in the combo box's model that provides numeric
- * IDs for the values in the model, if != -1.
- *
- * Since: 3.0
- */
- g_object_class_install_property (object_class,
- PROP_ID_COLUMN,
- g_param_spec_int ("id-column",
- P_("ID Column"),
- P_("The column in the combo box's model that provides "
- "numeric IDs for the values in the model"),
- -1, G_MAXINT, -1,
- GTK_PARAM_READWRITE));
-
/**
* GtkComboBox:popup-fixed-width:
*
priv->text_column = -1;
priv->text_renderer = NULL;
- priv->id_column = -1;
gtk_combo_box_check_appearance (combo_box);
}
gtk_combo_box_set_entry_text_column (combo_box, g_value_get_int (value));
break;
- case PROP_ID_COLUMN:
- gtk_combo_box_set_id_column (combo_box, g_value_get_int (value));
- break;
-
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
g_value_set_int (value, priv->text_column);
break;
- case PROP_ID_COLUMN:
- g_value_set_int (value, priv->id_column);
- break;
-
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
gtk_widget_set_parent (priv->button,
gtk_widget_get_parent (child));
- priv->box = gtk_hbox_new (FALSE, 0);
+ priv->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
gtk_container_add (GTK_CONTAINER (priv->button), priv->box);
- priv->separator = gtk_vseparator_new ();
+ priv->separator = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
gtk_container_add (GTK_CONTAINER (priv->box), priv->separator);
priv->arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
return GTK_WIDGET (combo_box);
}
+/**
+ * gtk_combo_box_new_with_model_and_entry:
+ *
+ * Creates a new empty #GtkComboBox with an entry
+ * and with the model initialized to @model.
+ *
+ * Return value: A new #GtkComboBox
+ */
+GtkWidget *
+gtk_combo_box_new_with_model_and_entry (GtkTreeModel *model)
+{
+ return g_object_new (GTK_TYPE_COMBO_BOX,
+ "has-entry", TRUE,
+ "model", model,
+ NULL);
+}
+
/**
* gtk_combo_box_get_wrap_width:
* @combo_box: A #GtkComboBox
* @combo_box: a #GtkComboBox
* @fixed: whether to use a fixed popup width
*
- * Specifies whether the popup's width should be a fixed width matching
- * the allocated width of the combo box.
+ * Specifies whether the popup's width should be a fixed width
+ * matching the allocated width of the combo box.
*
* Since: 3.0
**/
void
gtk_combo_box_set_popup_fixed_width (GtkComboBox *combo_box,
- gboolean fixed)
+ gboolean fixed)
{
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
* gtk_combo_box_get_popup_fixed_width:
* @combo_box: a #GtkComboBox
*
- * Gets whether the popup uses a fixed width matching
+ * Gets whether the popup uses a fixed width matching
* the allocated width of the combo box.
*
+ * Returns: %TRUE if the popup uses a fixed width
+ *
* Since: 3.0
**/
gboolean
xpad = 2 * (border_width + cell_style->xthickness);
ypad = 2 * (border_width + cell_style->ythickness);
- }
+ }
size -= but_width;
size -= 2 * focus_width;
if (natural_size)
*natural_size = nat_height;
}
-
-/**
- * gtk_combo_box_set_id_column:
- * @combo_box: A #GtkComboBox
- * @id_column: A column in @model to get numeric IDs for values from
- *
- * Sets the model column which @combo_box should use to get numeric IDs
- * for values from. The column @id_column in the model of @combo_box
- * must be of type %G_TYPE_INT.
- *
- * Since: 3.0
- */
-void
-gtk_combo_box_set_id_column (GtkComboBox *combo_box,
- gint id_column)
-{
- GtkComboBoxPrivate *priv = combo_box->priv;
- GtkTreeModel *model;
-
- g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
-
- model = gtk_combo_box_get_model (combo_box);
-
- g_return_if_fail (id_column >= 0);
- g_return_if_fail (model == NULL || id_column < gtk_tree_model_get_n_columns (model));
-
- priv->id_column = id_column;
-}
-
-/**
- * gtk_combo_box_get_id_column:
- * @combo_box: A #GtkComboBox
- *
- * Returns the column which @combo_box is using to get numeric IDs
- * for values from.
- *
- * Return value: A column in the data source model of @combo_box.
- *
- * Since: 3.0
- */
-gint
-gtk_combo_box_get_id_column (GtkComboBox *combo_box)
-{
- g_return_val_if_fail (GTK_IS_COMBO_BOX (combo_box), 0);
-
- return combo_box->priv->id_column;
-}