为什么我这里不能用GtkTooltips,其他都正常

软件和网站开发以及相关技术探讨
回复
gerber
帖子: 3
注册时间: 2019-01-09 16:29
系统: ubuntu

为什么我这里不能用GtkTooltips,其他都正常

#1

帖子 gerber » 2019-01-09 16:36

为什么我这里不能用GtkTooltips,其他都正常, 要把一个软件移植到gtk,好多界面都做好了,工具栏发现需要做个提示,用了这个,总是提示没有。
什么原因啊,有什么没有安装么?还是... ?
GtkTooltips *tooltip;
tooltip=gtk_tooltips_new();

错误信息如下(没有这两行,则一切正常,编译后软件界面也运行良好):
error: 'GtkTooltips' was not declared in this scope
GtkTooltips *tooltip;
^~~~~~~~~~~
error: 'gtk_tooltips_new' was not declared in this scope
tooltip=gtk_tooltips_new();
^~~~~~~~~~~~~~~~

折磨我三天了!
谢谢了,大神们!!
gerber
帖子: 3
注册时间: 2019-01-09 16:29
系统: ubuntu

Re: 为什么我这里不能用GtkTooltips,其他都正常

#2

帖子 gerber » 2019-01-09 23:38

版本不同,2.0以后就没有gtk_tooltips_new。 但是2.0以后要怎么实现同样的功能呢,有没有朋友给简单介绍下
头像
astolia
论坛版主
帖子: 6436
注册时间: 2008-09-18 13:11

Re: 为什么我这里不能用GtkTooltips,其他都正常

#3

帖子 astolia » 2019-01-10 10:50

文档上面啥都有,不读文档挠破头
https://developer.gnome.org/gtk3/stable ... escription
gerber
帖子: 3
注册时间: 2019-01-09 16:29
系统: ubuntu

Re: 为什么我这里不能用GtkTooltips,其他都正常

#4

帖子 gerber » 2019-01-10 14:02

astolia 写了: 2019-01-10 10:50 文档上面啥都有,不读文档挠破头
https://developer.gnome.org/gtk3/stable ... escription
看了不会用啊。 :Cry :Cry :Cry
头像
astolia
论坛版主
帖子: 6436
注册时间: 2008-09-18 13:11

Re: 为什么我这里不能用GtkTooltips,其他都正常

#5

帖子 astolia » 2019-01-10 20:36

如果你连文档上说得那么明白的一句话都不知道怎么办,恕我直言,你可能不太适合搞程序开发
Basic tooltips can be realized simply by using gtk_widget_set_tooltip_text() or gtk_widget_set_tooltip_markup() without any explicit tooltip object.
非要走这条路,从gtk基础学起吧
回复