From 994338982fc75978670f0a42cf361b51e2f6e0cc Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Mon, 21 Jan 2002 01:57:23 +0000 Subject: Request a reflow and an update when the text model changes. Fixes Ximian 2002-01-20 Christopher James Lahey * gal/e-text/e-text.c (e_text_text_model_changed): Request a reflow and an update when the text model changes. Fixes Ximian bug #16459. (e_text_set_arg): (ARG_TEXT) Don't set the number of lines to one here. svn path=/trunk/; revision=15411 --- widgets/text/e-text.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'widgets') diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index c4b5bb5cf6..4439a3e9bf 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -556,14 +556,16 @@ e_text_text_model_changed (ETextModel *model, EText *text) text->text = e_text_model_get_text(model); e_text_free_lines(text); - gtk_signal_emit (GTK_OBJECT (text), e_text_signals[E_TEXT_CHANGED]); - /* Make sure our selection doesn't extend past the bounds of our text. */ text->selection_start = CLAMP (text->selection_start, 0, model_len); text->selection_end = CLAMP (text->selection_end, 0, model_len); text->needs_split_into_lines = 1; + text->needs_redraw = 1; e_canvas_item_request_reflow (GNOME_CANVAS_ITEM(text)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (text)); + + gtk_signal_emit (GTK_OBJECT (text), e_text_signals[E_TEXT_CHANGED]); } static void @@ -1185,7 +1187,6 @@ e_text_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) break; case ARG_TEXT: - text->num_lines = 1; e_text_model_set_text(text->model, GTK_VALUE_STRING (*arg)); break; -- cgit