summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-10-21 15:48:01 -0400
committerMatthias Clasen <mclasen@redhat.com>2022-10-21 21:48:39 -0400
commitde069e15c2f501d918dc8b38f65de1c9f24f9105 (patch)
treea7f9074da8d5e0f4969613c65318cfb6bfa553f8 /demos
parentf8edefd7c0903550275d210dbc7dcc68f1048139 (diff)
downloadgtk+-de069e15c2f501d918dc8b38f65de1c9f24f9105.tar.gz
gtk-demo: Remove deprecation from textview demo
Use a dropdown instead of a combobox for the widget embedding. It's better!
Diffstat (limited to 'demos')
-rw-r--r--demos/gtk-demo/textview.c9
1 files changed, 4 insertions, 5 deletions
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 <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)
{