diff options
author | Tristan Van Berkom <tristanvb@openismus.com> | 2010-10-13 21:52:27 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2010-10-13 21:52:27 -0400 |
commit | 9612c648176378bf237ad0e1a8c6c995b0ca7c61 (patch) | |
tree | 875a7b2a6ce93657d756b2bae1a3c5ae07a75574 /docs/tools | |
parent | 7c8ee80c5af0909735d1e36b8aba7aa02bf83c95 (diff) | |
download | gtk+-9612c648176378bf237ad0e1a8c6c995b0ca7c61.tar.gz |
Deprecate GtkComboBoxEntry in favor of added properties to GtkComboBox
GtkComboBox now sports a construct-only "has-entry" property which
decides if it uses a GtkEntry to allow additional user input. Also
it has a new "entry-text-column" to fetch strings for the entry
from the model.
This patch deprecates the GtkComboBoxEntry and updates the rest of GTK+
to use the new semantics on GtkComboBox instead.
GtkComboBoxEntry will be removed altogether before GTK+ 3, in a
later commit.
Diffstat (limited to 'docs/tools')
-rw-r--r-- | docs/tools/widgets.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c index 45d678c5f0..d5a9901ae5 100644 --- a/docs/tools/widgets.c +++ b/docs/tools/widgets.c @@ -282,12 +282,21 @@ create_combo_box_entry (void) GtkWidget *widget; GtkWidget *align; GtkWidget *child; + GtkTreeModel *model; gtk_rc_parse_string ("style \"combo-box-entry-style\" {\n" " GtkComboBox::appears-as-list = 1\n" "}\n" "widget_class \"GtkComboBoxEntry\" style \"combo-box-entry-style\"\n" ); - widget = gtk_combo_box_entry_new_text (); + + model = (GtkTreeModel *)gtk_list_store_new (1, G_TYPE_STRING); + widget = g_object_new (GTK_TYPE_COMBO_BOX, + "has-entry", TRUE, + "model", model, + "entry-text-column", 0, + NULL); + g_object_unref (model); + child = gtk_bin_get_child (GTK_BIN (widget)); gtk_entry_set_text (GTK_ENTRY (child), "Combo Box Entry"); align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); |