Exemple #1
0
void main_window_create(void)
{
	gnome_window_icon_set_default_from_file(PIXMAP_DIR "/" GPHPEDIT_PIXMAP_ICON);

	main_window.window = gnome_app_new ("gPHPEdit", "gPHPEdit");
	preferences_apply();
	
	gnome_app_create_menus (GNOME_APP (main_window.window), menubar1_uiinfo);
	main_window_create_appbar();
	gnome_app_install_menu_hints (GNOME_APP (main_window.window), menubar1_uiinfo);

	main_window_update_reopen_menu();
	
	plugin_setup_menu();
	
	main_window_create_toolbars();
	main_window_create_panes();
	main_window_fill_panes();

	function_list_prepare();

	gtk_signal_connect (GTK_OBJECT (main_window.window), "delete_event", GTK_SIGNAL_FUNC(main_window_delete_event), NULL);
	gtk_signal_connect (GTK_OBJECT (main_window.window), "destroy", GTK_SIGNAL_FUNC (main_window_destroy_event), NULL);
	gtk_signal_connect (GTK_OBJECT (main_window.window), "key_press_event", GTK_SIGNAL_FUNC (main_window_key_press_event), NULL);
	gtk_signal_connect (GTK_OBJECT (main_window.window), "size_allocate", GTK_SIGNAL_FUNC (main_window_resize), NULL);
	gtk_signal_connect (GTK_OBJECT (main_window.window), "window-state-event", GTK_SIGNAL_FUNC (main_window_state_changed), NULL);

	main_window.clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);

	gtk_widget_show(main_window.window);

	update_app_title();
}
Exemple #2
0
/* [ gui_construct ]
 * Create the GUI
 */
void
gui_construct (void)
{
	GtkWidget *tablabel;
        GtkWidget *statusview_page;
	GtkWidget *hitview_page;
	GtkWidget *policyview_page;

	gchar hostname[40];

	if (!gethostname (hostname, 39))
		Fortified.window = gnome_app_new (PACKAGE, g_strconcat ("Fortified ", hostname, NULL));
	else
		Fortified.window = gnome_app_new (PACKAGE, "Fortified");

	Fortified.ttips = gtk_tooltips_new ();

/* Set up the main window */
	g_signal_connect (G_OBJECT (Fortified.window), "delete_event",
			  G_CALLBACK (close_main_window), NULL);

	gnome_window_icon_set_default_from_file (
		"/usr/share/pixmaps/fortified.png");

	menus_initialize (Fortified.window);

/* The main application is spread out over a set of notebook pages */
	notebook = gtk_notebook_new ();
	gnome_app_set_contents (GNOME_APP (Fortified.window), notebook);

/* Set up the statusview page */
	statusview_page = create_statusview_page ();
	tablabel = gtk_label_new (_("Status"));
	gtk_notebook_append_page (GTK_NOTEBOOK (notebook), statusview_page, tablabel);

/* Set up the hitview page */
	hitview_page = create_hitview_page ();
	tablabel = gtk_label_new (_("Events"));
	gtk_notebook_append_page (GTK_NOTEBOOK (notebook), hitview_page, tablabel);

/* Set up the the policyview pages */
	policyview_page = create_policyview_page ();
	tablabel = gtk_label_new (_("Policy"));
	gtk_notebook_append_page (GTK_NOTEBOOK (notebook), policyview_page, tablabel);

	g_signal_connect_after (G_OBJECT (notebook), "switch-page",
			        G_CALLBACK (view_switched_cb), NULL);

	/* FIXME: By making the window non-resizable the expanders collapse properly,
	    but it would be nicer if it worked with a resizable window */
	//gtk_window_set_resizable (GTK_WINDOW (Fortified.window), FALSE);

	/* Show the tray icon */
	if (preferences_get_bool (PREFS_ENABLE_TRAY_ICON))
		tray_init ();
}
static gboolean
wireless_applet_fill (WirelessApplet *applet)
{
	gnome_window_icon_set_default_from_file
		(ICONDIR"/wireless-applet/wireless-applet.png");

	glade_gnome_init ();
	glade_file = gnome_program_locate_file
		(NULL, GNOME_FILE_DOMAIN_DATADIR,
		 "wireless-applet/wireless-applet.glade", FALSE, NULL);

	wireless_applet_new (applet);
	gtk_widget_show (GTK_WIDGET (applet));

	return TRUE;
}
/**
 * gnome_window_icon_init:
 *
 * Description: Initialize the gnome window icon by checking the
 * GNOME_DESKTOP_ICON environment variable.  This function is 
 * automatically called by the gnome_init process.
 */
void
gnome_window_icon_init (void)
{
	GnomeClient *client;
	const char *filename;

	filename = g_getenv (GNOME_DESKTOP_ICON);
        if (!filename || !filename[0])
		return;

	gnome_window_icon_set_default_from_file (filename);

	/* remove it from our environment */
	gnome_unsetenv (GNOME_DESKTOP_ICON);

#ifndef G_OS_WIN32
	client = gnome_master_client ();
	if (!GNOME_CLIENT_CONNECTED (client))
		return;
	
	/* save it for restarts */
	gnome_client_set_environment (client, GNOME_DESKTOP_ICON, filename);
#endif
}
Exemple #5
0
int
main (int argc, char *argv [])
{
	GtkWidget *label;
	GnomeClient *client;

	gnome_score_init("same-gnome");

	bindtextdomain (PACKAGE, GNOMELOCALEDIR);
	textdomain (PACKAGE);

	gnome_init_with_popt_table ("same-gnome", VERSION, argc, argv, options, 0, NULL);

	gnome_window_icon_set_default_from_file (GNOME_ICONDIR"/gnome-gsame.png");
	client= gnome_master_client ();

	gtk_signal_connect (GTK_OBJECT (client), "save_yourself",
			    GTK_SIGNAL_FUNC (save_state), argv[0]);
	gtk_signal_connect (GTK_OBJECT (client), "die",
			    GTK_SIGNAL_FUNC (client_die), NULL);

	if (GNOME_CLIENT_RESTARTED (client)){
		gnome_config_push_prefix (gnome_client_get_config_prefix (client));
	    
		restart ();
		restarted = 1;
		
		gnome_config_pop_prefix ();
	}

	srand (time (NULL));

	app = gnome_app_new("same-gnome", _("Same Gnome"));

        gtk_window_set_policy(GTK_WINDOW(app), FALSE, FALSE, TRUE);
	gtk_signal_connect (GTK_OBJECT(app), "delete_event",
			    (GtkSignalFunc)game_quit_callback, NULL);

	appbar = gnome_appbar_new(FALSE, TRUE, GNOME_PREFERENCES_USER);
	gnome_app_set_statusbar(GNOME_APP (app), GTK_WIDGET(appbar));

	gnome_appbar_set_status(GNOME_APPBAR (appbar),
				_("Welcome to Same Gnome!"));

	gnome_app_create_menus(GNOME_APP(app), mainmenu);

	gnome_app_install_menu_hints(GNOME_APP (app), mainmenu);
  
        vb = gtk_vbox_new (FALSE, 0);
	gnome_app_set_contents (GNOME_APP (app), vb);

	if (!fname) {
		fname = gnome_config_get_string
			("/same-gnome/Preferences/Scenario=stones.png");
	}

	create_same_board (fname);

	label = gtk_label_new (_("Score: "));
	scorew = gtk_label_new ("");
	set_score (score);

	gtk_box_pack_start(GTK_BOX(appbar), label, FALSE, TRUE, 0);
	gtk_box_pack_start(GTK_BOX(appbar), scorew, FALSE, TRUE, 0);
	
	if (!restarted)
		new_game ();
	
	g_free (fname);

	gtk_widget_show (vb);
	gtk_widget_show (GTK_WIDGET(label));
	gtk_widget_show (GTK_WIDGET(scorew));
        gtk_widget_show (app);

	gtk_main ();
	return 0;
}