On Wed, 2009-11-11 at 10:01 +0100, BALLABIO GERARDO wrote: > From: FabrÃcio Godoy [mailto:[email protected]] > > See: > > http://git.gnome.org/cgit/nemiver/tree/src/workbench/nmv-workbench.cc#n227 > > http://git.gnome.org/cgit/gnome-system-monitor/tree/src/callbacks.cpp#n175 > > From: Jonathon Jongsma [mailto:[email protected]] > > No, I wouldn't advise you to copy that method. That's just a hack since we > > don't require a new enough gtk+ yet. The real solution is to use > > gtk_show_uri(), I believe. I'm not actually sure whether this has been > > wrapped in gtkmm yet, but you can always call the gtk+ version. > > Thank you very much. > > Unfortunately I run Debian stable which has a quite old version of gtkmm > (2.12.7) and gtk_show_uri is not available yet (I found it was added in > 2.14). There is g_app_info_launch_default_for_uri (used in > gnome-system-monitor example) and it has a C++ counterpart > Gio::AppInfo::launch_default_for_uri, but again that requires glibmm 2.20 or > later and I have 2.16. Anyway I tried the C function but it didn't work, it > compiled but when I ran it I got this error message: "Operation not > supported". Maybe the function is there but the required functionality was > not implemented yet? (That seems strange.) Or does it require some > initialization (e.g., asking Gnome for the default handlers) before it can > work? > > I looked at the source code for the version of gnome-system-monitor in Debian > stable (2.22.3) and actually it doesn't use gio but gnome-vfs (the exact > function is gnome_vfs_url_show). I copied that code and it worked. I > understand gnome-vfs is deprecated but I can live with it. > > But then I found another problem: I was able to display the > gnome-system-monitor help file but not my own. The problem is that an uri in > the form "ghelp:gnome-system-monitor" requires that gnome-system-monitor has > been installed properly in order that yelp can locate its help file. How can > I get yelp to open a help file that hasn't been installed? From the command > line I just run "yelp /absolute/path/file.xml" and it works. But when I tried > giving the absolute path in the gnomevfs call, yelp opened with an error > dialog saying it couldn't find the file. I tried replacing "ghelp" with > "file" but I got an "Unsupported operation" error. I tried "http" but I > couldn't get epiphany to treat it as a local address (I even tried > "http:file:..." but it got mangled as something like > "http://www.file.com/..."). Is there any documentation on how exactly uris > can be specified? > > Gerardo
Well, before gtk_show_uri came around, the way to do this was to use libgnome (http://library.gnome.org/devel/libgnome/stable/libgnome-gnome-help.html). This library is now deprecated, but you could still use it if you want to. Otherwise I guess you could resort to a hack like we've done in nemiver. regarding displaying a uninstalled help file, did you try the following format? file:///path/to/file.xml (three '/' characters) _______________________________________________ gtkmm-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtkmm-list
