From: Matthias Clasen Date: Fri, 21 Oct 2022 19:48:01 +0000 (-0400) Subject: gtk-demo: Remove deprecation from textview demo X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~9^2~141^2~10 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=de069e15c2f501d918dc8b38f65de1c9f24f9105;p=gtk4.git gtk-demo: Remove deprecation from textview demo Use a dropdown instead of a combobox for the widget embedding. It's better! --- diff --git a/demos/gtk-demo/textview.c b/demos/gtk-demo/textview.c index 2ee8bf8c7e..ad7da1b1da 100644 --- a/demos/gtk-demo/textview.c +++ b/demos/gtk-demo/textview.c @@ -11,7 +11,6 @@ #include /* for exit() */ #include "paintable.h" -G_GNUC_BEGIN_IGNORE_DEPRECATIONS static void easter_egg_callback (GtkWidget *button, gpointer data); @@ -431,11 +430,11 @@ attach_widgets (GtkTextView *text_view) } else if (i == 1) { - widget = gtk_combo_box_text_new (); + const char *options[] = { + "Option 1", "Option 2", "Option 3", NULL + }; - 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"); + widget = gtk_drop_down_new_from_strings (options); } else if (i == 2) {