AboutDialog url hook not working?
- From: "Jonathon Jongsma" <jonathon jongsma gmail com>
- To: gtkmm <gtkmm-list gnome org>
- Subject: AboutDialog url hook not working?
- Date: Sun, 11 Jun 2006 22:45:38 -0500
I don't know exactly when, but fairly recently, the website link on
the "About" dialog of my application stopped working (sometimes it
would segfault, sometimes just didn't do anything). I haven't changed
anything in that part of the application, so I'm thinking it must have
been due to a gtkmm or gtk update from my distribution. I'm currently
running Ubuntu dapper (gtkmm version 2.8.5-0ubuntu1). I've also tried
building it against my jhbuild gtkmm installation, and the same thing
happens. I haven't found an easy way of trying an earlier version. I
haven't done any hard-core digging yet, i thought I'd check first to
see whether anybody else has noticed this.
I've attached a stripped-down example application that just shows a
dialog and registers its url handler with set_url_hook(). The url hook
is just supposed to print a message to the terminal. On my computer,
the message never gets printed to the terminal. I'd appreciate
knowing whether this works for others (and what version you're trying
with). You can compile with the standard
g++ `pkg-config --cflags --libs gtkmm-2.4` about.cc
In this test app, I don't get segfaults, but clicking the link does
nothing. In my application, I sometimes get segfaults, but the one
big difference is that in my application, I inherit from
Gtk::AboutDialog instead of using it directly,
Alternatively, if somebody can see something that I'm doing wrong,
feel free to point it out.
Thanks,
Jonner
#include <vector>
#include <iostream>
#include <gtkmm/aboutdialog.h>
#include <glibmm/ustring.h>
#include <gdkmm/pixbuf.h>
#include <gtkmm/icontheme.h>
#include <gtkmm/main.h>
static void on_link_clicked(Gtk::AboutDialog& dialog,
const Glib::ustring& link)
{
// This line never gets printed to the terminal
std::cout << "on_link_clicked" << std::endl;
}
int main(int argc, char** argv)
{
Gtk::Main kit(argc, argv);
Gtk::AboutDialog about;
about.set_name("gtkmm AboutDialog Test");
about.set_url_hook(sigc::ptr_fun(&on_link_clicked));
about.set_website("http://gtkmm.org/");
about.set_website_label("gtkmm Website");
about.set_version("0.1");
about.set_copyright("\xC2\xA9 2006 Jonathon Jongsma");
about.set_comments("Comments about the application");
about.set_license("GPL");
std::vector<Glib::ustring> authors;
authors.push_back("Jonathon Jongsma");
about.set_authors(authors);
std::vector<Glib::ustring> documenters;
documenters.push_back("Jonathon Jongsma");
about.set_documenters(documenters);
about.set_translator_credits("Jonathon Jongsma");
// just use a generic 'image' icon from the theme as the logo
Glib::RefPtr<Gtk::IconTheme> theme = Gtk::IconTheme::get_default();
const Glib::ustring icon_name = "image";
if (theme->has_icon(icon_name))
{
Glib::RefPtr<Gdk::Pixbuf> logo;
logo = theme->load_icon(icon_name, 150,
Gtk::ICON_LOOKUP_USE_BUILTIN);
about.set_logo(logo);
}
kit.run(about);
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]