From d932fda48b3724f516fa5012b80c329644d72bdf Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Thu, 2 Mar 2000 11:19:39 +0000 Subject: Bonobization of the message composer, part 1. svn path=/trunk/; revision=2012 --- composer/main.c | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) (limited to 'composer/main.c') diff --git a/composer/main.c b/composer/main.c index 8fbf01b5e8..9a29e95666 100644 --- a/composer/main.c +++ b/composer/main.c @@ -1,6 +1,10 @@ /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ #include +#include +#include + +#include #include #include @@ -32,21 +36,41 @@ send_cb (EMsgComposer *composer, #endif } +static guint +create_composer (void) +{ + GtkWidget *composer; + + composer = e_msg_composer_new (); + gtk_widget_show (composer); + + gtk_signal_connect (GTK_OBJECT (composer), "send", GTK_SIGNAL_FUNC (send_cb), NULL); + + return FALSE; +} + int main (int argc, char **argv) { - GtkWidget *composer; + CORBA_Environment ev; + CORBA_ORB orb; + + CORBA_exception_init (&ev); + gnome_CORBA_init ("evolution-test-msg-composer", "0.0", &argc, argv, 0, &ev); + CORBA_exception_free (&ev); + + orb = gnome_CORBA_ORB (); - gnome_init ("test", "0.0", argc, argv); glade_gnome_init (); - composer = e_msg_composer_new (); - gtk_widget_show (composer); + if (bonobo_init (orb, NULL, NULL) == FALSE) + g_error ("Could not initialize Bonobo\n"); - gtk_signal_connect (GTK_OBJECT (composer), "send", - GTK_SIGNAL_FUNC (send_cb), NULL); + /* We can't make any CORBA calls unless we're in the main loop. So we + delay creating the container here. */ + gtk_idle_add ((GtkFunction) create_composer, NULL); - gtk_main (); + bonobo_main (); return 0; } -- cgit v1.2.3