Gtk ::带有标准图标的按钮 [英] Gtk::Button with standard Icons
问题描述
如果我使用:
Gtk::Button* button = Gtk::manage( new Gtk::Button(Gtk::Stock::DELETE));
它可以完美工作,但是文档和标题显示:已弃用,请使用标签_Delete
it works perfect, but the documentation and the header says: Deprecated, use label _Delete
但是如果我只是写
Gtk::Button* button = Gtk::manage( new Gtk::Button("_Delete"));
该按钮仅显示文本 _Delete
.
如何以新"方式创建标准按钮?
How can I create a standard button in the "new" fashion?
更新:根本没有计划在gtk中将任何东西自动化.在开发人员邮件列表上进行了长时间的讨论.他们决定不再替换库存物品.这只是意味着:自己做所有事情!:-(
Update: There is simply no plan to make anything automated anymore in gtk. There was a long discussion on the developers mailing list. They decided that there will no replacement for the stock items anymore. This simply means: Do all the things yourself! :-(
推荐答案
想法是,GTK +通常已经弃用了按钮中的图标,这可能是GNOME设计团队的总体决定.
The idea is that GTK+ in general has deprecated icons in buttons, possibly as an overarching decision by the GNOME design team.
即使没有这个决定,一般还是建议使用库存商品,而不是使用名为icon.freedesktop.org的商品.
Even without this decision, stock items in general are deprecated in favor of using freedesktop.org named icons.
话虽如此,您可以:
- 继续使用股票名称
- 使用名为
edit-delete
的图标并将按钮的always-show-image
属性设置为true
- continue to use the stock name
- use the icon named
edit-delete
and set thealways-show-image
property of the button to true
这篇关于Gtk ::带有标准图标的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!