gpt4 book ai didi

GTK+ 3.0 "No application is registered as handling this file"

转载 作者:行者123 更新时间:2023-12-04 18:05:46 28 4
gpt4 key购买 nike

我正在尝试在我的 GTK 应用程序中创建一个关于对话框。单击网站链接时出现以下错误:

Could not show link
No application is registered as handling this file

代码如下:

GtkWidget *dialog = gtk_about_dialog_new();
// some come here
gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(dialog), "http://stackoverflow.com");
// some code here
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);

问题是没有设置默认浏览器,但是在windows上怎么设置呢?

最佳答案

那是因为您没有设置默认浏览器。 XDG 规范有一些帮助工具来设置这样的东西。在 linux 发行版的 xdg-utils 包中,您会找到 xdg-setting 命令

blah@blah:~$ xdg-settings --list
Known properties:
default-web-browser Default web browser
blah@blah:~$ xdg-settings get default-web-browser
firefox.desktop

在 GNOME 中,您可以通过运行 gnome-control-center →“详细信息”→“默认应用程序”然后设置浏览器来设置它。

关于GTK+ 3.0 "No application is registered as handling this file",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26958539/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com