how to set background color GtkBox in Gtk+3?

二次信任 提交于 2019-12-11 05:20:02

问题


I create application in GTK+3 and I Would like to change the background color for GtkBox but can not here this code:

box.modify_bg(Gtk.StateType.NORMAL, color);

回答1:


In "Common Questions" of GTK+3 is the answer to your question.

In the basic form, you can use:

box.override_background_color(Gtk.StateType.NORMAL, Gdk.RGBA(.5,.5,.5,.5))

In this case, the color will be a soft grey, half transparent. Probably, you want to paint it during the draw signal.



来源:https://stackoverflow.com/questions/11166482/how-to-set-background-color-gtkbox-in-gtk3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!