From e5c6f92bf6260a75dfb9476adb88529db606f703 Mon Sep 17 00:00:00 2001 From: Erwann Chenede Date: Mon, 1 Oct 2001 14:35:33 +0000 Subject: [PATCH] (01/10/01) Erwann Chenede - * gtktextview.c : check if widget is realized before creating the layout. --- gtk/gtktextview.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 86e9294625..fca04bd5c0 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -5161,24 +5161,23 @@ gtk_text_view_value_changed (GtkAdjustment *adj, */ text_window_scroll (text_view->text_window, dx, dy); } - - /* This could result in invalidation, which would install the - * first_validate_idle, which would validate onscreen; - * but we're going to go ahead and validate here, so - * first_validate_idle shouldn't have anything to do. - */ - gtk_text_view_update_layout_width (text_view); - - /* note that validation of onscreen could invoke this function - * recursively, by scrolling to maintain first_para, or in response - * to updating the layout width, however there is no problem with - * that, or shouldn't be. - */ - gtk_text_view_validate_onscreen (text_view); - /* process exposes */ if (GTK_WIDGET_REALIZED (text_view)) { + /* This could result in invalidation, which would install the + * first_validate_idle, which would validate onscreen; + * but we're going to go ahead and validate here, so + * first_validate_idle shouldn't have anything to do. + */ + gtk_text_view_update_layout_width (text_view); + + /* note that validation of onscreen could invoke this function + * recursively, by scrolling to maintain first_para, or in response + * to updating the layout width, however there is no problem with + * that, or shouldn't be. + */ + gtk_text_view_validate_onscreen (text_view); + if (text_view->left_window) gdk_window_process_updates (text_view->left_window->bin_window, TRUE);