# testgtkchem3dviewer.c

Go to the documentation of this file.

    00001 #include "config.h"
    00002 #include <gcu/chemistry.h>
    00003 #include <gcu/gtkchem3dviewer.h>
    00004 #include <glib.h>
    00005 #include <gtk/gtk.h>
    00006 #include <stdio.h>
    00007 #include <libgnomevfs/gnome-vfs.h>
    00008
    00022 int main (int argc, char *argv[])
    00023 {
    00024         GtkWidget *window;
    00025         GtkWidget *viewer;
    00026         gchar* uri;
    00027         gtk_init (&argc, &argv);
    00028         if (!gnome_vfs_init ()) {
    00029                 printf ("Could not initialize GnomeVFS\n");
    00030                 return 1;
    00031         }
    00032
    00033         gcu_element_load_databases ("radii", NULL);
    00034
    00035         window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    00036         gtk_window_set_title (GTK_WINDOW (window), "GtkChem3dViewer test");
    00037         g_signal_connect (G_OBJECT (window), "destroy",
    00038                  G_CALLBACK (gtk_main_quit),
    00039                  NULL);
    00040
    00041         if (argc >= 2)
    00042                 uri = argv[1];
    00043         else
    00044                 uri = "file://"SRCDIR"/methane.xyz";
    00045
    00046         viewer = gtk_chem3d_viewer_new (uri);
    00047         gtk_container_add (GTK_CONTAINER (window), viewer);
    00048         gtk_widget_show_all (window);
    00049
    00050         gtk_main ();
    00051
    00052         return 0;
    00053 }