diff options
author | Radek Doulik <rodo@ximian.com> | 2003-01-23 00:14:14 +0800 |
---|---|---|
committer | Radek Doulik <rodo@src.gnome.org> | 2003-01-23 00:14:14 +0800 |
commit | ca805e3c7cc608a412dd41620f0bf1cbeff01a49 (patch) | |
tree | c337225db9e6b0a1a973d7fb80b8fa6d5203f2a6 /mail/mail-callbacks.c | |
parent | 813458ad8cbd7bc9b47b5801ec827a7be319bd5c (diff) | |
download | gsoc2013-evolution-ca805e3c7cc608a412dd41620f0bf1cbeff01a49.tar.gz gsoc2013-evolution-ca805e3c7cc608a412dd41620f0bf1cbeff01a49.tar.zst gsoc2013-evolution-ca805e3c7cc608a412dd41620f0bf1cbeff01a49.zip |
put unrealized html widget into top level widget (gtk window) before
2003-01-22 Radek Doulik <rodo@ximian.com>
* mail-callbacks.c (do_mail_print): put unrealized html widget
into top level widget (gtk window) before realizing it
destroy temporary widgets (w, html)
svn path=/trunk/; revision=19545
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r-- | mail/mail-callbacks.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index b5cfbc3c56..7c90847e2a 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -2844,6 +2844,7 @@ static void do_mail_print (FolderBrowser *fb, gboolean preview) { GtkHTML *html; + GtkWidget *w = NULL; GnomePrintContext *print_context; GnomePrintJob *print_master; GnomePrintConfig *config = NULL; @@ -2889,8 +2890,13 @@ do_mail_print (FolderBrowser *fb, gboolean preview) user's theme. */ fb->mail_display->printing = TRUE; - if (!GTK_WIDGET_REALIZED (GTK_WIDGET (html))) + if (!GTK_WIDGET_REALIZED (GTK_WIDGET (html))) { + /* gtk widgets don't like to be realized outside top level widget + so we put new html widget into gtk window */ + w = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_container_add (GTK_CONTAINER (w), GTK_WIDGET (html)); gtk_widget_realize (GTK_WIDGET (html)); + } mail_display_render (fb->mail_display, html, TRUE); gtk_html_print_set_master (html, print_master); @@ -2901,6 +2907,9 @@ do_mail_print (FolderBrowser *fb, gboolean preview) fb->mail_display->printing = FALSE; gnome_print_job_close (print_master); + gtk_widget_destroy (GTK_WIDGET (html)); + if (w) + gtk_widget_destroy (w); if (preview){ GtkWidget *preview; @@ -2913,8 +2922,6 @@ do_mail_print (FolderBrowser *fb, gboolean preview) if (result == -1) e_notice (FB_WINDOW (fb), GTK_MESSAGE_ERROR, _("Printing of message failed")); } - - /* FIXME: We are leaking the GtkHTML object */ } /* This is pretty evil. FolderBrowser's API should be extended to allow these sorts of |