/***************************************************************************** * Run: Gtk+ thread ***************************************************************************** * this part of the interface is in a separate thread so that we can call * gtk_main() from within it without annoying the rest of the program. *****************************************************************************/ static void Run( intf_thread_t *p_intf ) { #ifdef NEED_GTK2_MAIN gdk_threads_enter(); #else /* gnome_program_init needs to know the command line. We don't care, so * we give it an empty one */ char *p_args[] = { "", NULL }; int i_args = 1; int i_dummy; gtk_set_locale(); gnome_program_init( PACKAGE, VERSION, LIBGNOMEUI_MODULE, i_args, p_args, GNOME_PARAM_APP_DATADIR, "",//PACKAGE_DATA_DIR, NULL ); #endif /* Create some useful widgets that will certainly be used */ p_intf->p_sys->p_app = create_app1(); /* Set the title of the main window */ //gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_app), // VOUT_TITLE " (Gtk+ interface)" ); /* Show the control window */ gtk_widget_show( p_intf->p_sys->p_app ); #ifdef NEED_GTK2_MAIN while( !p_intf->b_die ) { Manage( p_intf ); /* Sleep to avoid using all CPU - since some interfaces need to * access keyboard events, a 100ms delay is a good compromise */ gdk_threads_leave(); msleep( INTF_IDLE_SLEEP ); gdk_threads_enter(); } #else /* Sleep to avoid using all CPU - since some interfaces needs to access * keyboard events, a 100ms delay is a good compromise */ i_dummy = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, (GtkFunction)Manage, p_intf ); /* Enter Gtk mode */ gtk_main(); /* Remove the timeout */ gtk_timeout_remove( i_dummy ); #endif gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_app) ); #ifdef NEED_GTK2_MAIN gdk_threads_leave(); #endif }
int main (int argc, char *argv[]) { bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR); textdomain (PACKAGE); gnome_init ("psxcdmaker", VERSION, argc, argv); /* * 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. */ app = create_app1 (); gtk_widget_show (app); init(); gtk_main (); return 0; }