Yasumichi Akahoshi
yasum****@users*****
2005年 8月 10日 (水) 23:22:13 JST
Index: cxplorer/src/main.c diff -u cxplorer/src/main.c:1.8 cxplorer/src/main.c:1.9 --- cxplorer/src/main.c:1.8 Thu May 12 18:55:23 2005 +++ cxplorer/src/main.c Wed Aug 10 23:22:13 2005 @@ -5,7 +5,7 @@ * This file contains main function which init cxplorer and run main loop. * @author Yasumichi Akahoshi <yasum****@users*****> * @date 2004 - * $Revision: 1.8 $ + * $Revision: 1.9 $ */ /** @@ -46,6 +46,7 @@ int main (int argc, char *argv[]) { GtkWidget *window; + gint exit_code; #ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); @@ -54,21 +55,28 @@ #endif gtk_set_locale (); - gtk_init (&argc, &argv); + if (gtk_init_check (&argc, &argv)) + { + add_pixmap_directory (PACKAGE_PIXMAPS_DIR "/"); + + /* + * The following code was added by Glade to create one of each component + * (except popup menus), just so that you see something after building + * the project. Delete any components that you don't want shown initially. + */ + window = cxplorer_window_new (); + g_signal_connect (window, "delete_event", gtk_main_quit, NULL); + gtk_window_set_title (GTK_WINDOW (window), _("Cxplorer")); + gtk_widget_show (window); + + gtk_main (); + exit_code = 0; + } + else + { + g_printerr (_("It failed in the initialization of gtk +.\n")); + exit_code = 1; + } - add_pixmap_directory (PACKAGE_PIXMAPS_DIR "/"); - - /* - * The following code was added by Glade to create one of each component - * (except popup menus), just so that you see something after building - * the project. Delete any components that you don't want shown initially. - */ - window = cxplorer_window_new (); - g_signal_connect (window, "delete_event", gtk_main_quit, NULL); - gtk_window_set_title (GTK_WINDOW (window), _("Cxplorer")); - gtk_widget_show (window); - - gtk_main (); - - return 0; + return exit_code; }