示例#1
0
GtkWidget *
c2_dialog_new (C2Application *application, const gchar *title, const gchar *type, const gchar *icon, ...)
{
	C2Dialog *dialog;
	va_list args;

	dialog = gtk_type_new (c2_dialog_get_type ());
	va_start (args, icon);
	gnome_dialog_construct (GNOME_DIALOG (dialog), title, args);
	va_end (args);
	dialog->application = application;
	gtk_object_set_data (GTK_OBJECT (dialog), "type", g_strdup (type));

	if (icon)
	{
		gtk_object_set_data (GTK_OBJECT (dialog), "icon", g_strdup (icon));
#ifdef USE_GNOME_WINDOW_ICON
		gnome_window_icon_set_from_file (GTK_WINDOW (dialog), icon);
#endif
	}

	c2_application_window_add (application, GTK_WINDOW (dialog));

	return GTK_WIDGET (dialog);
}
示例#2
0
static void
gnocam_applet_about_cb (BonoboUIComponent *uic, GnocamApplet *a,
			const char *verbname)
{
	static GtkWidget *about = NULL;
	GdkPixbuf *pixbuf;
	GError *e = NULL;

	g_return_if_fail (GNOCAM_IS_APPLET (a));

	static const gchar *authors[] = {
		"Lutz Mueller <*****@*****.**>",
		NULL
	};
	const gchar *documenters[] = {NULL};
	const gchar *translator_credits = _("translator_credits");

	/* Do we already have the widget? */
	if (about) {
		gtk_window_present (GTK_WINDOW (about));
		return;
	}

	/* Create the widget. */
	pixbuf = gdk_pixbuf_new_from_file (IMAGEDIR "gnocam-camera1.png", &e);
	about = gnome_about_new (
		_("Camera Applet"), VERSION,
		_("Copyright © 2002 Lutz Mueller"),
		_("Access your digital camera."),
		authors, documenters,
		(strcmp (translator_credits, "translator_credits") ?
	 				translator_credits : NULL), pixbuf);
	if (pixbuf)
		g_object_unref (pixbuf);

	/* Set up the widget. */
	gtk_window_set_wmclass (GTK_WINDOW (about), "gnocam-applet", 
				"Camera Applet");
	gnome_window_icon_set_from_file (GTK_WINDOW (about),
					 IMAGEDIR "gnocam-camera1.png");
	g_signal_connect (about, "destroy", G_CALLBACK (gtk_widget_destroyed),
			  &about);

	/* Show the widget. */
	gtk_widget_show (about);
}
示例#3
0
void
c2_dialog_construct (C2Dialog *dialog, C2Application *application, const gchar *title,
const gchar *type, const gchar *icon, const gchar **buttons)
{
	dialog->application = application;

	gnome_dialog_constructv (GNOME_DIALOG (dialog), title, buttons);
	gtk_object_set_data (GTK_OBJECT (dialog), "type", g_strdup (type));
	if (icon)
	{
		gtk_object_set_data (GTK_OBJECT (dialog), "icon", g_strdup (icon));
#ifdef USE_GNOME_WINDOW_ICON
		gnome_window_icon_set_from_file (GTK_WINDOW (dialog), icon);
#endif
	}

	c2_application_window_add (application, GTK_WINDOW (dialog));
}