GtkMenuItem可以有彩色标签吗
所以我基本上正在执行以下操作,我希望 SomeText 具有红色前景颜色。 如何实现这一点:
GtkWidget *menu_item =gtk_menu_item_new_with_labelex("SomeText");
我正在使用 GDK 2.0
谢谢
So I am basically doing the following and I want SomeText to have red forground color. How to achieve this:
GtkWidget *menu_item =gtk_menu_item_new_with_labelex("SomeText");
I am using GDK 2.0
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请记住,GtkMenuItem 是包含 GtkAccelLabel 的 GtkBin。 因此,您所要做的就是将自定义 GtkAccelLabel 粘贴到 GtkBin 中,并使您的标签监视 GtkMenuItem 的加速键。
所以:
Remember that GtkMenuItem is a GtkBin that contains a GtkAccelLabel. So all you have to do is stick a custom GtkAccelLabel into the GtkBin and make your label monitor the GtkMenuItem for accelerator keys.
So: