From e4affa9382419295eb9911d5528c1b9e38cb6283 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Fri, 23 Mar 2001 06:46:46 +0000 Subject: Made this not create the new font until realize instead of at new_view 2001-03-23 Christopher James Lahey * e-cell-text.c: Made this not create the new font until realize instead of at new_view time. * e-table-item.c: Don't request heights or do other things that you aren't allowed to do before realization unless you're realized. svn path=/trunk/; revision=8915 --- widgets/table/e-cell-text.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'widgets/table/e-cell-text.c') diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 969e17f84f..4143491c64 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -323,27 +323,12 @@ ect_cancel_edit (ECellTextView *text_view) static ECellView * ect_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) { - ECellText *ect = E_CELL_TEXT (ecell); ECellTextView *text_view = g_new0 (ECellTextView, 1); GnomeCanvas *canvas = GNOME_CANVAS_ITEM (e_table_item_view)->canvas; text_view->cell_view.ecell = ecell; text_view->cell_view.e_table_model = table_model; text_view->cell_view.e_table_item_view = e_table_item_view; - - if (ect->font_name){ -#if 0 - GdkFont *f; - - f = gdk_fontset_load (ect->font_name); - text_view->font = f; -#endif - text_view->font = e_font_from_gdk_name (ect->font_name); - } - if (!text_view->font){ - gdk_font_ref (GTK_WIDGET (canvas)->style->font); - text_view->font = e_font_from_gdk_font (GTK_WIDGET (canvas)->style->font); - } text_view->canvas = canvas; @@ -371,11 +356,20 @@ static void ect_realize (ECellView *ecell_view) { ECellTextView *text_view = (ECellTextView *) ecell_view; + ECellText *ect = (ECellText *) ecell_view->ecell; text_view->gc = gdk_gc_new (GTK_WIDGET (text_view->canvas)->window); text_view->i_cursor = gdk_cursor_new (GDK_XTERM); + if (ect->font_name){ + text_view->font = e_font_from_gdk_name (ect->font_name); + } + if (!text_view->font){ + gdk_font_ref (GTK_WIDGET (text_view->canvas)->style->font); + text_view->font = e_font_from_gdk_font (GTK_WIDGET (text_view->canvas)->style->font); + } + calc_ellipsis (text_view); if (parent_class->realize) -- cgit v1.2.3