aboutsummaryrefslogtreecommitdiffstats
path: root/mail/test-mail.c
blob: 1f8b217ce59a053aa9130835d3c4c27b2e280cc1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 * Tests the mail summary display bonobo component
 *
 * Author:
 *   Miguel de Icaza (miguel@kernel.org)
 *
 * (C) 2000 Helix Code, Inc.
 */
#include <gnome.h>
#include <bonobo.h>

static void
create_container (void)
{
    GtkWidget *window, *control;
    BonoboUIHandler *uih;

    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_widget_show (window);

    uih = bonobo_ui_handler_new ();
    control = bonobo_widget_new_control ("GOADID:Evolution:FolderBrowser:1.0",
                         bonobo_object_corba_objref (BONOBO_OBJECT (uih)));

    if (control == NULL){
        printf ("Could not launch mail control\n");
        exit (1);
    }
    gtk_container_add (GTK_CONTAINER (window), control);

    gtk_widget_show (window);
    gtk_widget_show (control);
}

int
main (int argc, char *argv [])
{
    CORBA_Environment ev;
    CORBA_ORB orb;

    CORBA_exception_init (&ev);

    gnome_CORBA_init ("sample-control-container", "1.0", &argc, argv, 0, &ev);

    CORBA_exception_free (&ev);

    orb = gnome_CORBA_ORB ();

    if (bonobo_init (orb, NULL, NULL) == FALSE)
        g_error ("Could not initialize Bonobo\n");

    bonobo_activate ();
    
    create_container ();

    /*
     * Main loop
     */
    gtk_main ();
    
    return 0;
}