Re: How can I open an uri use gtk function?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Le Wed, 12 Nov 2008 10:13:38 +0800,"Guoling Gao" <gguoling@xxxxxxxxx> a écrit :
> Hi all,> Can I open URI use gtk function, except gnome-*? I want to open an> URI from a program, but not find the right method.> thanks.
xdg-open would be the simplest way of doing so, from head off:command = g_strdup_printf ("xdg-open %s", uri);gdk_spawn_command_line (command);
Otherwise you can use the GIO API, I don't know exactly so it's just arandom guess.  GAppInfo has functions to launch uris, and GFile hasfunctions to get a GAppInfo (g_file_query_default_handler andg_app_info_launch*).
I would recommend xdg-open of course.  Depending on the build systemyou are using, you can check at configure-time if the command xdg-openis installed or not and print a message, for instance.
CheersMike_______________________________________________gtk-list mailing listgtk-list@xxxxxxxxxxxxx://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux