forked from AuroraMiddleware/gtk
migrating-GtkComboBox.sgml: Do not use deprecated API in the examples
This commit is contained in:
parent
e9b0f9e81a
commit
8f3f5fab27
@ -56,11 +56,11 @@ gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
|
||||
<informalexample><programlisting>
|
||||
GtkWidget *combo_box;
|
||||
|
||||
combo_box = gtk_combo_box_new_text (<!-- -->);
|
||||
combo_box = gtk_combo_box_text_new (<!-- -->);
|
||||
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "First Item");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "Second Item");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "Third Item");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo_box), "First Item");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo_box), "Second Item");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo_box), "Third Item");
|
||||
</programlisting></informalexample>
|
||||
In order to react to the user's selection, connect to the
|
||||
#GtkComboBox::changed signal and use gtk_combo_box_get_active()
|
||||
@ -149,11 +149,11 @@ gtk_combo_set_popdown_strings (GTK_COMBO (combo), items);
|
||||
<para>
|
||||
And here is how it would be done using #GtkComboBoxEntry<!---->:
|
||||
<informalexample><programlisting>
|
||||
combo_box = gtk_combo_box_entry_new_text (<!-- -->);
|
||||
combo_box = gtk_combo_box_text_new_with_entry (<!-- -->);
|
||||
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "First Item");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "Second Item");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "Third Item");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo_box), "First Item");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo_box), "Second Item");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo_box), "Third Item");
|
||||
</programlisting></informalexample>
|
||||
In order to react to the user's selection, connect to the #GtkComboBox::changed
|
||||
signal on the combo and use
|
||||
|
Loading…
Reference in New Issue
Block a user