Use the new GtkComboBoxText API

Also remove mentions of the old text convenience API from the docs,
and point to GtkComboBoxText instead.
This commit is contained in:
Javier Jardón 2010-10-02 18:19:46 +02:00 committed by Matthias Clasen
parent 99cfbecf46
commit e7f51ef6a4
17 changed files with 101 additions and 106 deletions

View File

@ -25,10 +25,10 @@ create_combo_box (const char **strings)
GtkWidget *combo_box;
const char **str;
combo_box = gtk_combo_box_new_text ();
combo_box = gtk_combo_box_text_new ();
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);

View File

@ -371,11 +371,11 @@ attach_widgets (GtkTextView *text_view)
}
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_append_text (GTK_COMBO_BOX (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 1");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 2");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 3");
}
else if (i == 2)
{

View File

@ -101,12 +101,12 @@ main(int argc, char **argv)
vbox = gtk_vbox_new (FALSE, 0);
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_append_text (GTK_COMBO_BOX (combo_box), "BILINEAR");
gtk_combo_box_append_text (GTK_COMBO_BOX (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), "NEAREST");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), "BILINEAR");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), "TILES");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), "HYPER");
gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 1);

View File

@ -316,8 +316,8 @@ create_combo_box (void)
"}\n"
"widget_class \"GtkComboBox\" style \"combo-box-style\"\n" );
widget = gtk_combo_box_new_text ();
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Combo Box");
widget = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Combo Box");
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_container_add (GTK_CONTAINER (align), widget);

View File

@ -74,12 +74,9 @@
* not restricted to a flat list, it can be a real tree, and the popup will
* reflect the tree structure.
*
* In addition to the model-view API, GtkComboBox offers a simple API which
* is suitable for text-only combo boxes, and hides the complexity of
* managing the data in a model. It consists of the functions
* 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().
* For a simple list of textual choices, the model-view API of GtkComboBox
* can be a bit overwhelming. In this case, #GtkComboBoxText offers a
* simple alternative.
*/
@ -5439,9 +5436,7 @@ gtk_combo_box_remove_text (GtkComboBox *combo_box,
* @combo_box: A #GtkComboBox constructed with gtk_combo_box_new_text()
*
* Returns the currently active string in @combo_box or %NULL if none
* is selected. Note that you can only use this function with combo
* boxes constructed with gtk_combo_box_new_text() and with
* #GtkComboBoxEntry<!-- -->s.
* is selected.
*
* Returns: a newly allocated string containing the currently active text.
* Must be freed with g_free().

View File

@ -31,7 +31,7 @@
#include "gtkcellrenderertext.h"
#include "gtkcheckmenuitem.h"
#include "gtkclipboard.h"
#include "gtkcombobox.h"
#include "gtkcomboboxtext.h"
#include "gtkentry.h"
#include "gtkexpander.h"
#include "gtkfilechooserprivate.h"
@ -2409,7 +2409,7 @@ filter_create (GtkFileChooserDefault *impl)
GtkCellRenderer *cell;
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);
/* Get the combo's text renderer and set ellipsize parameters */
@ -7538,7 +7538,7 @@ gtk_file_chooser_default_add_filter (GtkFileChooser *chooser,
if (!name)
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))
set_current_filter (impl, filter);

View File

@ -3363,7 +3363,7 @@ create_page_setup_page (GtkPrintUnixDialog *dialog)
0, 1, 3, 4, GTK_FILL, 0,
0, 0);
combo = gtk_combo_box_new_text ();
combo = gtk_combo_box_text_new ();
priv->page_set_combo = combo;
gtk_widget_show (combo);
gtk_table_attach (GTK_TABLE (table), combo,
@ -3371,9 +3371,9 @@ create_page_setup_page (GtkPrintUnixDialog *dialog)
0, 0);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
/* In enum order */
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("All sheets"));
gtk_combo_box_append_text (GTK_COMBO_BOX (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), _("All sheets"));
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Even sheets"));
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Odd sheets"));
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
label = gtk_label_new_with_mnemonic (_("Sc_ale:"));
@ -3485,17 +3485,17 @@ create_page_setup_page (GtkPrintUnixDialog *dialog)
0, 1, 4, 5,
GTK_FILL, 0, 0, 0);
combo = gtk_combo_box_new_text ();
combo = gtk_combo_box_text_new ();
priv->orientation_combo = GTK_WIDGET (combo);
gtk_table_attach (GTK_TABLE (table), combo,
1, 2, 4, 5, GTK_FILL, 0,
0, 0);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
/* In enum order */
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Portrait"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Landscape"));
gtk_combo_box_append_text (GTK_COMBO_BOX (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), _("Portrait"));
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Landscape"));
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Reverse portrait"));
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Reverse landscape"));
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
gtk_widget_set_sensitive (combo, FALSE);
gtk_widget_show (combo);

View File

@ -41,7 +41,7 @@
#include "gtkcellrenderertext.h"
#include "gtkcheckmenuitem.h"
#include "gtkclipboard.h"
#include "gtkcombobox.h"
#include "gtkcomboboxtext.h"
#include "gtkentry.h"
#include "gtkeventbox.h"
#include "gtkexpander.h"
@ -474,7 +474,7 @@ gtk_recent_chooser_default_constructor (GType type,
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);
g_signal_connect (impl->filter_combo, "changed",
G_CALLBACK (filter_combo_changed_cb), impl);
@ -1300,9 +1300,9 @@ gtk_recent_chooser_default_add_filter (GtkRecentChooser *chooser,
name = gtk_recent_filter_get_name (filter);
if (!name)
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))
set_current_filter (impl, filter);

View File

@ -819,15 +819,15 @@ property_widget (GObject *object,
GEnumClass *eclass;
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));
j = 0;
while (j < eclass->n_values)
{
gtk_combo_box_append_text (GTK_COMBO_BOX (prop_edit),
eclass->values[j].value_name);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (prop_edit),
eclass->values[j].value_name);
++j;
}

View File

@ -38,25 +38,25 @@ static const char* types[] = { "GtkHButtonBox",
NULL};
static void
populate_combo_with (GtkComboBox *combo, const char** elements)
populate_combo_with (GtkComboBoxText *combo, const char** elements)
{
int 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
combo_changed_cb (GtkComboBox *combo,
combo_changed_cb (GtkComboBoxText *combo,
gpointer user_data)
{
char *text;
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++) {
if (g_str_equal (text, styles[i])) {
@ -77,7 +77,7 @@ reparent_widget (GtkWidget *widget,
}
static void
combo_types_changed_cb (GtkComboBox *combo,
combo_types_changed_cb (GtkComboBoxText *combo,
GtkWidget **buttons)
{
int i;
@ -85,7 +85,7 @@ combo_types_changed_cb (GtkComboBox *combo,
GtkWidget *old_parent, *new_parent;
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")) {
old_parent = vbbox;
@ -156,13 +156,13 @@ main (int argc,
hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
combo_types = gtk_combo_box_new_text ();
populate_combo_with (GTK_COMBO_BOX (combo_types), types);
combo_types = gtk_combo_box_text_new ();
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);
gtk_box_pack_start (GTK_BOX (hbox), combo_types, TRUE, TRUE, 0);
combo_styles = gtk_combo_box_new_text ();
populate_combo_with (GTK_COMBO_BOX (combo_styles), styles);
combo_styles = gtk_combo_box_text_new ();
populate_combo_with (GTK_COMBO_BOX_TEXT (combo_styles), styles);
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);

View File

@ -136,14 +136,14 @@ main (int argc, char *argv[])
vbox = gtk_vbox_new (FALSE, 6);
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);
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_append_text (GTK_COMBO_BOX (combo), "START");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "MIDDLE");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "END");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "NONE");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "START");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "MIDDLE");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "END");
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);

View File

@ -109,12 +109,12 @@ build_option_menu (gchar *items[],
GtkWidget *omenu;
gint i;
omenu = gtk_combo_box_new_text ();
omenu = gtk_combo_box_text_new ();
g_signal_connect (omenu, "changed",
G_CALLBACK (func), data);
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);
@ -3296,8 +3296,8 @@ create_menus (GtkWidget *widget)
GDK_KEY_F3,
0,
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_box_pack_start (GTK_BOX (box2), optionmenu, TRUE, TRUE, 0);
gtk_widget_show (optionmenu);
@ -5646,8 +5646,8 @@ create_display_screen (GtkWidget *widget)
"only one screen on the current display");
gtk_widget_set_sensitive (radio_scr, FALSE);
}
combo_dpy = gtk_combo_box_new_text ();
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_dpy), "diabolo:0.0");
combo_dpy = gtk_combo_box_text_new ();
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))),
"<hostname>:<X Server Num>.<Screen Num>");
@ -8102,8 +8102,8 @@ window_controls (GtkWidget *window)
window,
G_CONNECT_SWAPPED);
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;
while (i < 10)
{
@ -8122,7 +8122,7 @@ window_controls (GtkWidget *window)
};
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;
}
@ -8135,7 +8135,7 @@ window_controls (GtkWidget *window)
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;
while (i < 5)
{
@ -8149,7 +8149,7 @@ window_controls (GtkWidget *window)
};
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;
}

View File

@ -211,11 +211,11 @@ create_widgets (void)
label = gtk_label_new ("This label may be ellipsized\nto make it fit.");
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
combo = gtk_combo_box_new_text ();
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "NONE");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "START");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "MIDDLE");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "END");
combo = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "NONE");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "START");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "MIDDLE");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "END");
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
@ -237,17 +237,17 @@ create_widgets (void)
button = gtk_check_button_new_with_mnemonic ("_Check button");
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 ();
gtk_widget_show (entry);
gtk_container_add (GTK_CONTAINER (cb), entry);
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), "item0");
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), "item1");
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), "item1");
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), "item2");
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), "item2");
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), "item2");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (cb), "item0");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (cb), "item1");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (cb), "item1");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (cb), "item2");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (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_editable_select_region (GTK_EDITABLE (entry), 0, -1);
gtk_box_pack_start (GTK_BOX (vbox), cb, TRUE, TRUE, 0);

View File

@ -205,12 +205,12 @@ create_menubar (GtkWindow *window)
static GtkWidget *
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_append_text (combo_box, "Is");
gtk_combo_box_append_text (combo_box, "A");
gtk_combo_box_append_text (combo_box, "ComboBox");
gtk_combo_box_text_append_text (combo_box, "This");
gtk_combo_box_text_append_text (combo_box, "Is");
gtk_combo_box_text_append_text (combo_box, "A");
gtk_combo_box_text_append_text (combo_box, "ComboBox");
return GTK_WIDGET (combo_box);
}

View File

@ -554,13 +554,13 @@ main (gint argc, gchar **argv)
checkbox = gtk_check_button_new_with_mnemonic("_Set Toolbar Style:");
g_signal_connect (checkbox, "toggled", G_CALLBACK (set_toolbar_style_toggled), toolbar);
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);
g_object_set_data (G_OBJECT (checkbox), "option-menu", option_menu);
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_toolbar_get_style (GTK_TOOLBAR (toolbar)));
gtk_box_pack_start (GTK_BOX (hbox2), option_menu, FALSE, FALSE, 0);
@ -571,11 +571,11 @@ main (gint argc, gchar **argv)
g_signal_connect (checkbox, "toggled", G_CALLBACK (set_icon_size_toggled), toolbar);
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);
gtk_widget_set_sensitive (option_menu, FALSE);
gtk_combo_box_append_text (GTK_COMBO_BOX (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), "small 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);
g_signal_connect (option_menu, "changed",

View File

@ -98,7 +98,7 @@ combo_box_changed (GtkComboBox *combo_box,
GList *list;
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)
return;
@ -182,14 +182,14 @@ main (int argc, char **argv)
gtk_container_add (GTK_CONTAINER (window), vbox);
/* 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_append_text (GTK_COMBO_BOX (combo_box), SINGLE_EXPAND);
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), MULTI_EXPAND);
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), LAST_EXPAND);
gtk_combo_box_append_text (GTK_COMBO_BOX (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), NO_EXPAND);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), SINGLE_EXPAND);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), MULTI_EXPAND);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), LAST_EXPAND);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), BORDER_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);

View File

@ -754,10 +754,10 @@ main (int argc,
GDK_ACTION_MOVE | GDK_ACTION_COPY);
/* Model menu */
combo_box = gtk_combo_box_new_text ();
combo_box = gtk_combo_box_text_new ();
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,
0, 1, 0, 1,
0, 0,
@ -769,10 +769,10 @@ main (int argc,
tv);
/* Columns menu */
combo_box = gtk_combo_box_new_text ();
combo_box = gtk_combo_box_text_new ();
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]);
gtk_table_attach (GTK_TABLE (table), combo_box,
0, 1, 1, 2,
0, 0,