static void create_href(void) { TestGnomeApp *app; GtkWidget *vbox, *href, *ent1, *ent2, *wid; app = create_newwin(TRUE,"testGNOME","HRef test"); vbox = gtk_vbox_new(FALSE, 5); gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); bonobo_window_set_contents(BONOBO_WINDOW(app->app), vbox); href = gnome_href_new("http://www.gnome.org/", "Gnome Website"); gtk_box_pack_start(GTK_BOX(vbox), href, FALSE, FALSE, 0); wid = gtk_hseparator_new(); gtk_box_pack_start(GTK_BOX(vbox), wid, TRUE, FALSE, 0); wid = gtk_label_new("The launch behaviour of the\n" "configured with the control center"); gtk_box_pack_start(GTK_BOX(vbox), wid, TRUE, FALSE, 0); ent1 = gtk_entry_new(); gtk_entry_set_text (GTK_ENTRY(ent1), "http://www.gnome.org/"); gtk_box_pack_start (GTK_BOX(vbox), ent1, TRUE, TRUE, 0); ent2 = gtk_entry_new (); gtk_entry_set_text (GTK_ENTRY(ent2), "Gnome Website"); gtk_box_pack_start (GTK_BOX(vbox), ent2, TRUE, TRUE, 0); wid = gtk_button_new_with_label ("set href props"); g_object_set_data (G_OBJECT(wid), "href", href); g_object_set_data (G_OBJECT(wid), "url", ent1); g_object_set_data (G_OBJECT(wid), "label", ent2); g_signal_connect (wid, "clicked", G_CALLBACK(href_cb), NULL); gtk_box_pack_start (GTK_BOX(vbox), wid, TRUE, TRUE, 0); gtk_widget_show_all(app->app); }
void on_about_activate(GtkMenuItem *menuitem, gpointer user_data) { static GtkWidget *about = NULL; GtkWidget *href, *hbox; GdkPixbuf *pixbuf = NULL; const gchar *documenters[] = { "Ricardo Quesada, english", "Arkadiusz Lipiec, polish", NULL }; const gchar *translator_credits = _("translator_credits"); const char *authors[] = { "Main Authors:", " Ricardo Quesada, main coder", " Wolfgang Morawetz, main artist", "", "Main Contributors:", " Thomas R. Koll", " Raymond Ostertag", "", "Detailed info in the PEOPLE file or in the homepage", NULL }; { gchar* logo_filename = NULL; logo_filename = g_strdup(PIXMAPDIR"/teg_icono.png"); if (logo_filename != NULL) { pixbuf = gdk_pixbuf_new_from_file(logo_filename, NULL); g_free (logo_filename); } } if (!about) { about = gnome_about_new ( _("Tenes Empanadas Graciela"), VERSION, _("Copyright (C) 2000, 2002 Ricardo Quesada"), _("A clone of T.E.G. (a Risk clone)."), (const char**) authors, (const char**) documenters, strcmp (translator_credits, "translator_credits") != 0 ? translator_credits : NULL, pixbuf); gtk_signal_connect (GTK_OBJECT (about), "destroy", GTK_SIGNAL_FUNC (gtk_widget_destroyed), &about); hbox = gtk_hbox_new (TRUE, 0); href = gnome_href_new ("http://teg.sourceforge.net", _("TEG Home Page")); gtk_box_pack_start (GTK_BOX (hbox), href, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (about)->vbox), hbox, TRUE, FALSE, 0); gtk_widget_show_all (hbox); } gtk_widget_show_now (about); raise_and_focus (about); }
static void action_about (GtkAction *action, gpointer callback_data) { GtkamMain *m = GTKAM_MAIN (callback_data); GtkWidget *d; const gchar *comments = N_("gtkam is a program that lets you download\n" "images from many digital cameras. It uses\n" "libgphoto2. More info is available at\n" "http://www.gphoto.org.\n" "\n" "Enjoy the wonderful world of gphoto!"); #ifdef HAVE_GNOME GtkWidget *w; const gchar *authors[] = { "Scott Fritzinger <*****@*****.**>", "Lutz Mueller <*****@*****.**>", _("Many others"), NULL }; const gchar *documenters[] = { "Michael J. Rensing <*****@*****.**>", NULL }; const gchar *translator_credits = "Keld Simonsen <*****@*****.**>\n" "Marcus Meissner <*****@*****.**>\n" "Fabian Mandelbaum <*****@*****.**>\n" "Kjartan Maraas <*****@*****.**>\n" "Andraz Tori <*****@*****.**>"; GdkPixbuf *p; #else gchar *buf; #endif gchar *gcomments = NULL; int n; for (n = 0; module_versions[n].name != NULL; n++) { gchar *features; const char **v = NULL; char *name = module_versions[n].name; GPVersionFunc func = module_versions[n].version_func; CHECK_NULL (name); CHECK_NULL (func); v = func(GP_VERSION_SHORT); CHECK_NULL (v); CHECK_NULL (v[0]); CHECK_NULL (v[1]); /* FIXME: implicit conversion from char to gchar */ features = g_strjoinv(", ", &v[1]); if (gcomments == NULL) { gcomments = g_strdup_printf(_("%s\n\n%s %s with options:\n %s\n"), _(comments), name, v[0], features); } else { gchar *old = gcomments; gcomments = g_strdup_printf(_("%s\n%s %s with options:\n %s\n"), gcomments, name, v[0], features); free(old); } free(features); } #ifdef HAVE_GNOME p = gdk_pixbuf_new_from_file (IMAGE_DIR "/gtkam-camera.png", NULL); d = gnome_about_new (PACKAGE, VERSION, "GPL", gcomments, authors, documenters, translator_credits, p); g_object_unref (G_OBJECT (p)); w = gnome_href_new ("http://www.gphoto.org", "http://www.gphoto.org"); gtk_widget_show (w); gtk_box_pack_end (GTK_BOX (GTK_DIALOG (d)->vbox), w, FALSE, FALSE, 0); #else buf = g_strdup_printf ("%s-%s\n\n%s", PACKAGE, VERSION, gcomments); d = gtkam_close_new (buf); g_free (buf); #endif gtk_window_set_transient_for (GTK_WINDOW (d), GTK_WINDOW (m)); gtk_widget_show (d); /* FIXME free(gcomments); */ }