gtk-demo: Remove deprecation from textview demo
authorMatthias Clasen <mclasen@redhat.com>
Fri, 21 Oct 2022 19:48:01 +0000 (15:48 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 22 Oct 2022 01:48:39 +0000 (21:48 -0400)
Use a dropdown instead of a combobox for the widget
embedding. It's better!

demos/gtk-demo/textview.c

index 2ee8bf8c7ee33adb8b463d66eb0c32a33f18957a..ad7da1b1da3c86c1ffc0149fcfff6faf5f05a6d7 100644 (file)
@@ -11,7 +11,6 @@
 #include <stdlib.h> /* 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)
         {