开发者

Linux / C / GTK+ Set GtkTextView background to the default window colour

I want to set the GtkTexetView background colour to the window's default colour so t开发者_开发百科hat it looks like a GtkLabel. Take a look at these images, but please note that I want it for C and not PHP, and I use GNOME, not MS Windows.


Here is how to do it:

GdkColor color;
gtk_widget_realize(window);
gtk_style_lookup_color(gtk_widget_get_style(window), "bg_color", &color);
gtk_widget_modify_base(textview, GTK_STATE_NORMAL, &color);

It really doesn't matter whether you use Windows or Gnome, or C or PHP, the GTK toolkit works mostly the same way across platforms, and you should be able to deduce the C code from looking at the PHP code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜