editable case.
The selection of the display style — menu or list —
is no longer done at the API level, but has been made themeable via
- the style property #GtkComboBox:appearance.
+ the style property #GtkComboBox:appears-as-list.
</para>
<section id="migrating-GtkOptionMenu">
<para>
Here is an example of a simple, but typical use of
- #GtkOptionMenu:
+ #GtkOptionMenu<!---->:
<informalexample><programlisting>
GtkWidget *option_menu, *menu, *menu_item;
gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
</programlisting></informalexample>
- In order to react to the user's selection, connect to the "changed"
+ In order to react to the user's selection, connect to the #GtkOptionMenu::changed
signal on the option menu and use gtk_option_menu_get_history()
to retrieve the index of the selected item.
</para>
<para>
- And here is how it would be done with a #GtkComboBox:
+ And here is how it would be done with a #GtkComboBox<!---->:
<informalexample><programlisting>
GtkWidget *combo_box;
<title>Migrating from GtkCombo to GtkComboBoxEntry</title>
<para>
- Here is an example of a simple, but typical use of a #GtkCombo:
+ Here is an example of a simple, but typical use of a #GtkCombo<!---->:
<informalexample><programlisting>
GtkWidget *combo;
GList *items = NULL;
combo = gtk_combo_new (<!-- -->);
gtk_combo_set_popdown_strings (GTK_COMBO (combo), items);
</programlisting></informalexample>
- In order to react to the user's selection, connect to the "changed"
+ In order to react to the user's selection, connect to the #GtkCombo::changed
signal on the combo and use
<literal>gtk_entry_get_text (GTK_ENTRY (combo->entry))</literal>
to retrieve the selected text.
</para>
<para>
- And here is how it would be done using #GtkComboBoxEntry:
+ And here is how it would be done using #GtkComboBoxEntry<!---->:
<informalexample><programlisting>
combo_box = gtk_combo_box_entry_new_text (<!-- -->);
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "Second Item");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "Third Item");
</programlisting></informalexample>
- In order to react to the user's selection, connect to the "changed"
+ In order to react to the user's selection, connect to the #GtkComboBox::changed
signal on the combo and use
<literal>gtk_entry_get_text (GTK_ENTRY (GTK_BIN (combo_box)->child))</literal>
to retrieve the selected text.