分页: 1 / 1

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

发表于 : 2019-01-09 16:36
gerber
为什么我这里不能用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();
^~~~~~~~~~~~~~~~

折磨我三天了!
谢谢了,大神们!!

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

发表于 : 2019-01-09 23:38
gerber
版本不同,2.0以后就没有gtk_tooltips_new。 但是2.0以后要怎么实现同样的功能呢,有没有朋友给简单介绍下

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

发表于 : 2019-01-10 10:50
astolia
文档上面啥都有,不读文档挠破头
https://developer.gnome.org/gtk3/stable ... escription

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

发表于 : 2019-01-10 14:02
gerber
astolia 写了: 2019-01-10 10:50 文档上面啥都有,不读文档挠破头
https://developer.gnome.org/gtk3/stable ... escription
看了不会用啊。 :Cry :Cry :Cry

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

发表于 : 2019-01-10 20:36
astolia
如果你连文档上说得那么明白的一句话都不知道怎么办,恕我直言,你可能不太适合搞程序开发
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基础学起吧