From 0d2a7f876b5c6602c3c20112e1c4b16745b4a345 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 1 May 2019 21:12:36 +0000 Subject: [PATCH] gtk-demo: Make the expander demo behave again Changes to the dialog hierarchy have affected this demo, that admittedly pokes at message dialog internals. Do that some more, to fix things up. --- demos/gtk-demo/expander.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/demos/gtk-demo/expander.c b/demos/gtk-demo/expander.c index c7deb3b2c8..c54f9feec2 100644 --- a/demos/gtk-demo/expander.c +++ b/demos/gtk-demo/expander.c @@ -31,6 +31,7 @@ do_expander (GtkWidget *do_widget) GtkWidget *toplevel; GtkWidget *area; GtkWidget *expander; + GtkWidget *label; GtkWidget *sw; GtkWidget *tv; GtkTextBuffer *buffer; @@ -50,13 +51,19 @@ do_expander (GtkWidget *do_widget) area = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (window)); + label = gtk_widget_get_last_child (area); + gtk_label_set_line_wrap (GTK_LABEL (label), FALSE); + gtk_widget_set_vexpand (label, FALSE); + expander = gtk_expander_new ("Details:"); + gtk_widget_set_vexpand (expander, TRUE); sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (sw), 100); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_propagate_natural_height (GTK_SCROLLED_WINDOW (sw), TRUE); tv = gtk_text_view_new (); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tv));