Commit e7f51ef6 authored by Javier Jardón's avatar Javier Jardón Committed by Matthias Clasen

Use the new GtkComboBoxText API

Also remove mentions of the old text convenience API from the docs,
and point to GtkComboBoxText instead.
parent 99cfbecf
...@@ -25,10 +25,10 @@ create_combo_box (const char **strings) ...@@ -25,10 +25,10 @@ create_combo_box (const char **strings)
GtkWidget *combo_box; GtkWidget *combo_box;
const char **str; const char **str;
combo_box = gtk_combo_box_new_text (); combo_box = gtk_combo_box_text_new ();
for (str = strings; *str; str++) for (str = strings; *str; str++)
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), *str); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), *str);
gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0); gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0);
......
...@@ -371,11 +371,11 @@ attach_widgets (GtkTextView *text_view) ...@@ -371,11 +371,11 @@ attach_widgets (GtkTextView *text_view)
} }
else if (i == 1) else if (i == 1)
{ {
widget = gtk_combo_box_new_text (); widget = gtk_combo_box_text_new ();
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Option 1"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 1");
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Option 2"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 2");
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Option 3"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 3");
} }
else if (i == 2) else if (i == 2)
{ {
......
...@@ -101,12 +101,12 @@ main(int argc, char **argv) ...@@ -101,12 +101,12 @@ main(int argc, char **argv)
vbox = gtk_vbox_new (FALSE, 0); vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox); gtk_container_add (GTK_CONTAINER (window), vbox);
combo_box = gtk_combo_box_new_text (); combo_box = gtk_combo_box_text_new ();
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "NEAREST"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), "NEAREST");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "BILINEAR"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), "BILINEAR");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "TILES"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), "TILES");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "HYPER"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), "HYPER");
gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 1); gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 1);
......
...@@ -316,8 +316,8 @@ create_combo_box (void) ...@@ -316,8 +316,8 @@ create_combo_box (void)
"}\n" "}\n"
"widget_class \"GtkComboBox\" style \"combo-box-style\"\n" ); "widget_class \"GtkComboBox\" style \"combo-box-style\"\n" );
widget = gtk_combo_box_new_text (); widget = gtk_combo_box_text_new ();
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Combo Box"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Combo Box");
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0); gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_container_add (GTK_CONTAINER (align), widget); gtk_container_add (GTK_CONTAINER (align), widget);
......
...@@ -74,12 +74,9 @@ ...@@ -74,12 +74,9 @@
* not restricted to a flat list, it can be a real tree, and the popup will * not restricted to a flat list, it can be a real tree, and the popup will
* reflect the tree structure. * reflect the tree structure.
* *
* In addition to the model-view API, GtkComboBox offers a simple API which * For a simple list of textual choices, the model-view API of GtkComboBox
* is suitable for text-only combo boxes, and hides the complexity of * can be a bit overwhelming. In this case, #GtkComboBoxText offers a
* managing the data in a model. It consists of the functions * simple alternative.
* gtk_combo_box_new_text(), gtk_combo_box_append_text(),
* gtk_combo_box_insert_text(), gtk_combo_box_prepend_text(),
* gtk_combo_box_remove_text() and gtk_combo_box_get_active_text().
*/ */
...@@ -5439,9 +5436,7 @@ gtk_combo_box_remove_text (GtkComboBox *combo_box, ...@@ -5439,9 +5436,7 @@ gtk_combo_box_remove_text (GtkComboBox *combo_box,
* @combo_box: A #GtkComboBox constructed with gtk_combo_box_new_text() * @combo_box: A #GtkComboBox constructed with gtk_combo_box_new_text()
* *
* Returns the currently active string in @combo_box or %NULL if none * Returns the currently active string in @combo_box or %NULL if none
* is selected. Note that you can only use this function with combo * is selected.
* boxes constructed with gtk_combo_box_new_text() and with
* #GtkComboBoxEntry<!-- -->s.
* *
* Returns: a newly allocated string containing the currently active text. * Returns: a newly allocated string containing the currently active text.
* Must be freed with g_free(). * Must be freed with g_free().
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "gtkcellrenderertext.h" #include "gtkcellrenderertext.h"
#include "gtkcheckmenuitem.h" #include "gtkcheckmenuitem.h"
#include "gtkclipboard.h" #include "gtkclipboard.h"
#include "gtkcombobox.h" #include "gtkcomboboxtext.h"
#include "gtkentry.h" #include "gtkentry.h"
#include "gtkexpander.h" #include "gtkexpander.h"
#include "gtkfilechooserprivate.h" #include "gtkfilechooserprivate.h"
...@@ -2409,7 +2409,7 @@ filter_create (GtkFileChooserDefault *impl) ...@@ -2409,7 +2409,7 @@ filter_create (GtkFileChooserDefault *impl)
GtkCellRenderer *cell; GtkCellRenderer *cell;
GList *cells; GList *cells;
impl->filter_combo = gtk_combo_box_new_text (); impl->filter_combo = gtk_combo_box_text_new ();
gtk_combo_box_set_focus_on_click (GTK_COMBO_BOX (impl->filter_combo), FALSE); gtk_combo_box_set_focus_on_click (GTK_COMBO_BOX (impl->filter_combo), FALSE);
/* Get the combo's text renderer and set ellipsize parameters */ /* Get the combo's text renderer and set ellipsize parameters */
...@@ -7538,7 +7538,7 @@ gtk_file_chooser_default_add_filter (GtkFileChooser *chooser, ...@@ -7538,7 +7538,7 @@ gtk_file_chooser_default_add_filter (GtkFileChooser *chooser,
if (!name) if (!name)
name = "Untitled filter"; /* Place-holder, doesn't need to be marked for translation */ name = "Untitled filter"; /* Place-holder, doesn't need to be marked for translation */
gtk_combo_box_append_text (GTK_COMBO_BOX (impl->filter_combo), name); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (impl->filter_combo), name);
if (!g_slist_find (impl->filters, impl->current_filter)) if (!g_slist_find (impl->filters, impl->current_filter))
set_current_filter (impl, filter); set_current_filter (impl, filter);
......
...@@ -3363,7 +3363,7 @@ create_page_setup_page (GtkPrintUnixDialog *dialog) ...@@ -3363,7 +3363,7 @@ create_page_setup_page (GtkPrintUnixDialog *dialog)
0, 1, 3, 4, GTK_FILL, 0, 0, 1, 3, 4, GTK_FILL, 0,
0, 0); 0, 0);
combo = gtk_combo_box_new_text (); combo = gtk_combo_box_text_new ();
priv->page_set_combo = combo; priv->page_set_combo = combo;
gtk_widget_show (combo); gtk_widget_show (combo);
gtk_table_attach (GTK_TABLE (table), combo, gtk_table_attach (GTK_TABLE (table), combo,
...@@ -3371,9 +3371,9 @@ create_page_setup_page (GtkPrintUnixDialog *dialog) ...@@ -3371,9 +3371,9 @@ create_page_setup_page (GtkPrintUnixDialog *dialog)
0, 0); 0, 0);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo); gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
/* In enum order */ /* In enum order */
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("All sheets")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("All sheets"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Even sheets")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Even sheets"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Odd sheets")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Odd sheets"));
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
label = gtk_label_new_with_mnemonic (_("Sc_ale:")); label = gtk_label_new_with_mnemonic (_("Sc_ale:"));
...@@ -3485,17 +3485,17 @@ create_page_setup_page (GtkPrintUnixDialog *dialog) ...@@ -3485,17 +3485,17 @@ create_page_setup_page (GtkPrintUnixDialog *dialog)
0, 1, 4, 5, 0, 1, 4, 5,
GTK_FILL, 0, 0, 0); GTK_FILL, 0, 0, 0);
combo = gtk_combo_box_new_text (); combo = gtk_combo_box_text_new ();
priv->orientation_combo = GTK_WIDGET (combo); priv->orientation_combo = GTK_WIDGET (combo);
gtk_table_attach (GTK_TABLE (table), combo, gtk_table_attach (GTK_TABLE (table), combo,
1, 2, 4, 5, GTK_FILL, 0, 1, 2, 4, 5, GTK_FILL, 0,
0, 0); 0, 0);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo); gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
/* In enum order */ /* In enum order */
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Portrait")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Portrait"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Landscape")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Landscape"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Reverse portrait")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Reverse portrait"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Reverse landscape")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Reverse landscape"));
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
gtk_widget_set_sensitive (combo, FALSE); gtk_widget_set_sensitive (combo, FALSE);
gtk_widget_show (combo); gtk_widget_show (combo);
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include "gtkcellrenderertext.h" #include "gtkcellrenderertext.h"
#include "gtkcheckmenuitem.h" #include "gtkcheckmenuitem.h"
#include "gtkclipboard.h" #include "gtkclipboard.h"
#include "gtkcombobox.h" #include "gtkcomboboxtext.h"
#include "gtkentry.h" #include "gtkentry.h"
#include "gtkeventbox.h" #include "gtkeventbox.h"
#include "gtkexpander.h" #include "gtkexpander.h"
...@@ -474,7 +474,7 @@ gtk_recent_chooser_default_constructor (GType type, ...@@ -474,7 +474,7 @@ gtk_recent_chooser_default_constructor (GType type,
impl->filter_combo_hbox = gtk_hbox_new (FALSE, 12); impl->filter_combo_hbox = gtk_hbox_new (FALSE, 12);
impl->filter_combo = gtk_combo_box_new_text (); impl->filter_combo = gtk_combo_box_text_new ();
gtk_combo_box_set_focus_on_click (GTK_COMBO_BOX (impl->filter_combo), FALSE); gtk_combo_box_set_focus_on_click (GTK_COMBO_BOX (impl->filter_combo), FALSE);
g_signal_connect (impl->filter_combo, "changed", g_signal_connect (impl->filter_combo, "changed",
G_CALLBACK (filter_combo_changed_cb), impl); G_CALLBACK (filter_combo_changed_cb), impl);
...@@ -1300,9 +1300,9 @@ gtk_recent_chooser_default_add_filter (GtkRecentChooser *chooser, ...@@ -1300,9 +1300,9 @@ gtk_recent_chooser_default_add_filter (GtkRecentChooser *chooser,
name = gtk_recent_filter_get_name (filter); name = gtk_recent_filter_get_name (filter);
if (!name) if (!name)
name = _("Untitled filter"); name = _("Untitled filter");
gtk_combo_box_append_text (GTK_COMBO_BOX (impl->filter_combo), name); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (impl->filter_combo), name);
if (!g_slist_find (impl->filters, impl->current_filter)) if (!g_slist_find (impl->filters, impl->current_filter))
set_current_filter (impl, filter); set_current_filter (impl, filter);
......
...@@ -819,15 +819,15 @@ property_widget (GObject *object, ...@@ -819,15 +819,15 @@ property_widget (GObject *object,
GEnumClass *eclass; GEnumClass *eclass;
gint j; gint j;
prop_edit = gtk_combo_box_new_text (); prop_edit = gtk_combo_box_text_new ();
eclass = G_ENUM_CLASS (g_type_class_ref (spec->value_type)); eclass = G_ENUM_CLASS (g_type_class_ref (spec->value_type));
j = 0; j = 0;
while (j < eclass->n_values) while (j < eclass->n_values)
{ {
gtk_combo_box_append_text (GTK_COMBO_BOX (prop_edit), gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (prop_edit),
eclass->values[j].value_name); eclass->values[j].value_name);
++j; ++j;
} }
......
...@@ -38,25 +38,25 @@ static const char* types[] = { "GtkHButtonBox", ...@@ -38,25 +38,25 @@ static const char* types[] = { "GtkHButtonBox",
NULL}; NULL};
static void static void
populate_combo_with (GtkComboBox *combo, const char** elements) populate_combo_with (GtkComboBoxText *combo, const char** elements)
{ {
int i; int i;
for (i = 0; elements[i] != NULL; i++) { for (i = 0; elements[i] != NULL; i++) {
gtk_combo_box_append_text (combo, elements[i]); gtk_combo_box_text_append_text (combo, elements[i]);
} }
gtk_combo_box_set_active (combo, 0); gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
} }
static void static void
combo_changed_cb (GtkComboBox *combo, combo_changed_cb (GtkComboBoxText *combo,
gpointer user_data) gpointer user_data)
{ {
char *text; char *text;
int i; int i;
text = gtk_combo_box_get_active_text (combo); text = gtk_combo_box_text_get_active_text (combo);
for (i = 0; styles[i]; i++) { for (i = 0; styles[i]; i++) {
if (g_str_equal (text, styles[i])) { if (g_str_equal (text, styles[i])) {
...@@ -77,7 +77,7 @@ reparent_widget (GtkWidget *widget, ...@@ -77,7 +77,7 @@ reparent_widget (GtkWidget *widget,
} }
static void static void
combo_types_changed_cb (GtkComboBox *combo, combo_types_changed_cb (GtkComboBoxText *combo,
GtkWidget **buttons) GtkWidget **buttons)
{ {
int i; int i;
...@@ -85,7 +85,7 @@ combo_types_changed_cb (GtkComboBox *combo, ...@@ -85,7 +85,7 @@ combo_types_changed_cb (GtkComboBox *combo,
GtkWidget *old_parent, *new_parent; GtkWidget *old_parent, *new_parent;
GtkButtonBoxStyle style; GtkButtonBoxStyle style;
text = gtk_combo_box_get_active_text (combo); text = gtk_combo_box_text_get_active_text (combo);
if (g_str_equal (text, "GtkHButtonBox")) { if (g_str_equal (text, "GtkHButtonBox")) {
old_parent = vbbox; old_parent = vbbox;
...@@ -156,13 +156,13 @@ main (int argc, ...@@ -156,13 +156,13 @@ main (int argc,
hbox = gtk_hbox_new (FALSE, 0); hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
combo_types = gtk_combo_box_new_text (); combo_types = gtk_combo_box_text_new ();
populate_combo_with (GTK_COMBO_BOX (combo_types), types); populate_combo_with (GTK_COMBO_BOX_TEXT (combo_types), types);
g_signal_connect (G_OBJECT (combo_types), "changed", G_CALLBACK (combo_types_changed_cb), buttons); g_signal_connect (G_OBJECT (combo_types), "changed", G_CALLBACK (combo_types_changed_cb), buttons);
gtk_box_pack_start (GTK_BOX (hbox), combo_types, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), combo_types, TRUE, TRUE, 0);
combo_styles = gtk_combo_box_new_text (); combo_styles = gtk_combo_box_text_new ();
populate_combo_with (GTK_COMBO_BOX (combo_styles), styles); populate_combo_with (GTK_COMBO_BOX_TEXT (combo_styles), styles);
g_signal_connect (G_OBJECT (combo_styles), "changed", G_CALLBACK (combo_changed_cb), NULL); g_signal_connect (G_OBJECT (combo_styles), "changed", G_CALLBACK (combo_changed_cb), NULL);
gtk_box_pack_start (GTK_BOX (hbox), combo_styles, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), combo_styles, TRUE, TRUE, 0);
......
...@@ -136,14 +136,14 @@ main (int argc, char *argv[]) ...@@ -136,14 +136,14 @@ main (int argc, char *argv[])
vbox = gtk_vbox_new (FALSE, 6); vbox = gtk_vbox_new (FALSE, 6);
gtk_container_add (GTK_CONTAINER (window), vbox); gtk_container_add (GTK_CONTAINER (window), vbox);
combo = gtk_combo_box_new_text (); combo = gtk_combo_box_text_new ();
scale = gtk_hscale_new_with_range (0, 360, 1); scale = gtk_hscale_new_with_range (0, 360, 1);
label = gtk_label_new ("This label may be ellipsized\nto make it fit."); label = gtk_label_new ("This label may be ellipsized\nto make it fit.");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "NONE"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "NONE");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "START"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "START");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "MIDDLE"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "MIDDLE");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "END"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "END");
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
......
...@@ -109,12 +109,12 @@ build_option_menu (gchar *items[], ...@@ -109,12 +109,12 @@ build_option_menu (gchar *items[],
GtkWidget *omenu; GtkWidget *omenu;
gint i; gint i;
omenu = gtk_combo_box_new_text (); omenu = gtk_combo_box_text_new ();
g_signal_connect (omenu, "changed", g_signal_connect (omenu, "changed",
G_CALLBACK (func), data); G_CALLBACK (func), data);
for (i = 0; i < num_items; i++) for (i = 0; i < num_items; i++)
gtk_combo_box_append_text (GTK_COMBO_BOX (omenu), items[i]); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (omenu), items[i]);
gtk_combo_box_set_active (GTK_COMBO_BOX (omenu), history); gtk_combo_box_set_active (GTK_COMBO_BOX (omenu), history);
...@@ -3296,8 +3296,8 @@ create_menus (GtkWidget *widget) ...@@ -3296,8 +3296,8 @@ create_menus (GtkWidget *widget)
GDK_KEY_F3, GDK_KEY_F3,
0, 0,
GTK_ACCEL_VISIBLE); GTK_ACCEL_VISIBLE);
optionmenu = gtk_combo_box_new_text (); optionmenu = gtk_combo_box_text_new ();
gtk_combo_box_set_active (GTK_COMBO_BOX (optionmenu), 3); gtk_combo_box_set_active (GTK_COMBO_BOX (optionmenu), 3);
gtk_box_pack_start (GTK_BOX (box2), optionmenu, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (box2), optionmenu, TRUE, TRUE, 0);
gtk_widget_show (optionmenu); gtk_widget_show (optionmenu);
...@@ -5646,8 +5646,8 @@ create_display_screen (GtkWidget *widget) ...@@ -5646,8 +5646,8 @@ create_display_screen (GtkWidget *widget)
"only one screen on the current display"); "only one screen on the current display");
gtk_widget_set_sensitive (radio_scr, FALSE); gtk_widget_set_sensitive (radio_scr, FALSE);
} }
combo_dpy = gtk_combo_box_new_text (); combo_dpy = gtk_combo_box_text_new ();
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_dpy), "diabolo:0.0"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_dpy), "diabolo:0.0");
gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo_dpy))), gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo_dpy))),
"<hostname>:<X Server Num>.<Screen Num>"); "<hostname>:<X Server Num>.<Screen Num>");
...@@ -8102,8 +8102,8 @@ window_controls (GtkWidget *window) ...@@ -8102,8 +8102,8 @@ window_controls (GtkWidget *window)
window, window,
G_CONNECT_SWAPPED); G_CONNECT_SWAPPED);
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
om = gtk_combo_box_new_text (); om = gtk_combo_box_text_new ();
i = 0; i = 0;
while (i < 10) while (i < 10)
{ {
...@@ -8122,7 +8122,7 @@ window_controls (GtkWidget *window) ...@@ -8122,7 +8122,7 @@ window_controls (GtkWidget *window)
}; };
g_assert (names[i]); g_assert (names[i]);
gtk_combo_box_append_text (GTK_COMBO_BOX (om), names[i]); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (om), names[i]);
++i; ++i;
} }
...@@ -8135,7 +8135,7 @@ window_controls (GtkWidget *window) ...@@ -8135,7 +8135,7 @@ window_controls (GtkWidget *window)
gtk_box_pack_end (GTK_BOX (vbox), om, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (vbox), om, FALSE, FALSE, 0);
om = gtk_combo_box_new_text (); om = gtk_combo_box_text_new ();
i = 0; i = 0;
while (i < 5) while (i < 5)
{ {
...@@ -8149,7 +8149,7 @@ window_controls (GtkWidget *window) ...@@ -8149,7 +8149,7 @@ window_controls (GtkWidget *window)
}; };
g_assert (names[i]); g_assert (names[i]);
gtk_combo_box_append_text (GTK_COMBO_BOX (om), names[i]); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (om), names[i]);
++i; ++i;
} }
......
...@@ -211,11 +211,11 @@ create_widgets (void) ...@@ -211,11 +211,11 @@ create_widgets (void)
label = gtk_label_new ("This label may be ellipsized\nto make it fit."); label = gtk_label_new ("This label may be ellipsized\nto make it fit.");
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
combo = gtk_combo_box_new_text (); combo = gtk_combo_box_text_new ();
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "NONE"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "NONE");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "START"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "START");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "MIDDLE"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "MIDDLE");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "END"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "END");
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
...@@ -237,17 +237,17 @@ create_widgets (void) ...@@ -237,17 +237,17 @@ create_widgets (void)
button = gtk_check_button_new_with_mnemonic ("_Check button"); button = gtk_check_button_new_with_mnemonic ("_Check button");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
cb = gtk_combo_box_new_text (); cb = gtk_combo_box_text_new ();
entry = gtk_entry_new (); entry = gtk_entry_new ();
gtk_widget_show (entry); gtk_widget_show (entry);
gtk_container_add (GTK_CONTAINER (cb), entry); gtk_container_add (GTK_CONTAINER (cb), entry);
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), "item0"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (cb), "item0");
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), "item1"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (cb), "item1");
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), "item1"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (cb), "item1");
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), "item2"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (cb), "item2");
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), "item2"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (cb), "item2");
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), "item2"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (cb), "item2");
gtk_entry_set_text (GTK_ENTRY (entry), "hello world ♥ foo"); gtk_entry_set_text (GTK_ENTRY (entry), "hello world ♥ foo");
gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1); gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
gtk_box_pack_start (GTK_BOX (vbox), cb, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox), cb, TRUE, TRUE, 0);
......
...@@ -205,12 +205,12 @@ create_menubar (GtkWindow *window) ...@@ -205,12 +205,12 @@ create_menubar (GtkWindow *window)
static GtkWidget * static GtkWidget *
create_combo_box (void) create_combo_box (void)
{ {
GtkComboBox *combo_box = GTK_COMBO_BOX (gtk_combo_box_new_text ()); GtkComboBoxText *combo_box = GTK_COMBO_BOX_TEXT (gtk_combo_box_text_new ());
gtk_combo_box_append_text (combo_box, "This"); gtk_combo_box_text_append_text (combo_box, "This");
gtk_combo_box_append_text (combo_box, "Is"); gtk_combo_box_text_append_text (combo_box, "Is");
gtk_combo_box_append_text (combo_box, "A"); gtk_combo_box_text_append_text (combo_box, "A");
gtk_combo_box_append_text (combo_box, "ComboBox"); gtk_combo_box_text_append_text (combo_box, "ComboBox");
return GTK_WIDGET (combo_box); return GTK_WIDGET (combo_box);
} }
......
...@@ -554,13 +554,13 @@ main (gint argc, gchar **argv) ...@@ -554,13 +554,13 @@ main (gint argc, gchar **argv)
checkbox = gtk_check_button_new_with_mnemonic("_Set Toolbar Style:"); checkbox = gtk_check_button_new_with_mnemonic("_Set Toolbar Style:");
g_signal_connect (checkbox, "toggled", G_CALLBACK (set_toolbar_style_toggled), toolbar); g_signal_connect (checkbox, "toggled", G_CALLBACK (set_toolbar_style_toggled), toolbar);
gtk_box_pack_start (GTK_BOX (hbox1), checkbox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox1), checkbox, FALSE, FALSE, 0);
option_menu = gtk_combo_box_new_text (); option_menu = gtk_combo_box_text_new ();
gtk_widget_set_sensitive (option_menu, FALSE); gtk_widget_set_sensitive (option_menu, FALSE);
g_object_set_data (G_OBJECT (checkbox), "option-menu", option_menu); g_object_set_data (G_OBJECT (checkbox), "option-menu", option_menu);
for (i = 0; i < G_N_ELEMENTS (toolbar_styles); i++) for (i = 0; i < G_N_ELEMENTS (toolbar_styles); i++)
gtk_combo_box_append_text (GTK_COMBO_BOX (option_menu), toolbar_styles[i]); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (option_menu), toolbar_styles[i]);
gtk_combo_box_set_active (GTK_COMBO_BOX (option_menu), gtk_combo_box_set_active (GTK_COMBO_BOX (option_menu),
gtk_toolbar_get_style (GTK_TOOLBAR (toolbar))); gtk_toolbar_get_style (GTK_TOOLBAR (toolbar)));
gtk_box_pack_start (GTK_BOX (hbox2), option_menu, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox2), option_menu, FALSE, FALSE, 0);
...@@ -571,11 +571,11 @@ main (gint argc, gchar **argv) ...@@ -571,11 +571,11 @@ main (gint argc, gchar **argv)
g_signal_connect (checkbox, "toggled", G_CALLBACK (set_icon_size_toggled), toolbar); g_signal_connect (checkbox, "toggled", G_CALLBACK (set_icon_size_toggled), toolbar);
gtk_box_pack_start (GTK_BOX (hbox2), checkbox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox2), checkbox, FALSE, FALSE, 0);
option_menu = gtk_combo_box_new_text (); option_menu = gtk_combo_box_text_new ();
g_object_set_data (G_OBJECT (checkbox), "option-menu", option_menu); g_object_set_data (G_OBJECT (checkbox), "option-menu", option_menu);
gtk_widget_set_sensitive (option_menu, FALSE); gtk_widget_set_sensitive (option_menu, FALSE);
gtk_combo_box_append_text (GTK_COMBO_BOX (option_menu), "small toolbar"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (option_menu), "small toolbar");
gtk_combo_box_append_text (GTK_COMBO_BOX (option_menu), "large toolbar"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (option_menu), "large toolbar");
gtk_box_pack_start (GTK_BOX (hbox2), option_menu, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox2), option_menu, FALSE, FALSE, 0);
g_signal_connect (option_menu, "changed", g_signal_connect (option_menu, "changed",
......
...@@ -98,7 +98,7 @@ combo_box_changed (GtkComboBox *combo_box, ...@@ -98,7 +98,7 @@ combo_box_changed (GtkComboBox *combo_box,
GList *list; GList *list;
GList *columns; GList *columns;
str = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combo_box)); str = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combo_box));
if (!str) if (!str)
return; return;
...@@ -182,14 +182,14 @@ main (int argc, char **argv) ...@@ -182,14 +182,14 @@ main (int argc, char **argv)
gtk_container_add (GTK_CONTAINER (window), vbox); gtk_container_add (GTK_CONTAINER (window), vbox);
/* Option menu contents */ /* Option menu contents */
combo_box = gtk_combo_box_new_text (); combo_box = gtk_combo_box_text_new ();
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), NO_EXPAND); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), NO_EXPAND);
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), SINGLE_EXPAND); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), SINGLE_EXPAND);
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), MULTI_EXPAND); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), MULTI_EXPAND);
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), LAST_EXPAND); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), LAST_EXPAND);
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), BORDER_EXPAND); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), BORDER_EXPAND);
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), ALL_EXPAND); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), ALL_EXPAND);
gtk_box_pack_start (GTK_BOX (vbox), combo_box, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), combo_box, FALSE, FALSE, 0);
......
...@@ -754,10 +754,10 @@ main (int argc, ...@@ -754,10 +754,10 @@ main (int argc,
GDK_ACTION_MOVE | GDK_ACTION_COPY); GDK_ACTION_MOVE | GDK_ACTION_COPY);
/* Model menu */ /* Model menu */
combo_box = gtk_combo_box_new_text (); combo_box = gtk_combo_box_text_new ();
for (i = 0; i < MODEL_LAST; i++) for (i = 0; i < MODEL_LAST; i++)
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), model_names[i]); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), model_names[i]);
gtk_table_attach (GTK_TABLE (table), combo_box, gtk_table_attach (GTK_TABLE (table), combo_box,
0, 1, 0, 1, 0, 1, 0, 1,
0, 0, 0, 0,
...@@ -769,10 +769,10 @@ main (int argc, ...@@ -769,10 +769,10 @@ main (int argc,
tv); tv);
/* Columns menu */ /* Columns menu */
combo_box = gtk_combo_box_new_text (); combo_box = gtk_combo_box_text_new ();
for (i = 0; i < COLUMNS_LAST; i++) for (i = 0; i < COLUMNS_LAST; i++)
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), column_type_names[i]); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), column_type_names[i]);