From b3e9bc2921eacac30e81406bab99ee8fe8e74c26 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Mon, 25 Dec 2000 22:06:45 +0000 Subject: Always have some text. Fixes crash. 2000-12-25 Miguel de Icaza * gal/e-text/e-text.c (e_text_init): Always have some text. Fixes crash. svn path=/trunk/; revision=7171 --- widgets/text/e-entry.c | 4 ++-- widgets/text/e-text.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'widgets/text') diff --git a/widgets/text/e-entry.c b/widgets/text/e-entry.c index 0ae2803744..bbf65c76ff 100644 --- a/widgets/text/e-entry.c +++ b/widgets/text/e-entry.c @@ -105,9 +105,9 @@ canvas_size_request (GtkWidget *widget, GtkRequisition *requisition, static gint canvas_focus_in_event (GtkWidget *widget, GdkEventFocus *focus, EEntry *e_entry) { - if (e_entry->canvas->focused_item != GNOME_CANVAS_ITEM(e_entry->item)) { + if (e_entry->canvas->focused_item != GNOME_CANVAS_ITEM(e_entry->item)) gnome_canvas_item_grab_focus(GNOME_CANVAS_ITEM(e_entry->item)); - } + return 0; } diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index b011a492c0..3345493ad7 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -313,10 +313,11 @@ e_text_class_init (ETextClass *klass) static void e_text_init (EText *text) { - text->text = NULL; text->model = e_text_model_new(); - gtk_object_ref(GTK_OBJECT(text->model)); - gtk_object_sink(GTK_OBJECT(text->model)); + text->text = e_text_model_get_text (text->model); + + gtk_object_ref (GTK_OBJECT(text->model)); + gtk_object_sink (GTK_OBJECT(text->model)); text->model_changed_signal_id = gtk_signal_connect(GTK_OBJECT(text->model), "changed", @@ -1014,6 +1015,7 @@ e_text_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) text); e_text_free_lines(text); + text->text = e_text_model_get_text(text->model); text->needs_split_into_lines = 1; -- cgit