改变字体颜色
/*GtkLabel是少数的几个不创建自己的窗口的GTK+控件之一.相反,它直接的将自己画在父控件上.这就是说:如果你想为GtkLabel控件设置背景,你需要改变它的父控件的的背景. *这是GTK+ FAQ 中"6.10. 如何给GtkLabel控件设置背景颜色?"给出的解释。一般情况下设置某个GtkWidget的背景都用一般情况下用函数 *gtk_widget_modify_bg()。注意在gtk_widget_modify_bg()函数的说明里有一段话: *Note that "no window" widgets (which have the GTK_NO_WINDOW flag set) draw on their parent container's window and thus may not draw any background themselves. This is the *case for e.g. GtkLabel. To modify the background of such widgets, you have to set the background color on the ir parent; if you want to set the background of a rectangular area *around a label, try placing the label in a GtkEventBox widget and setting the background color on that. *其实这已经告诉了我们如何设置“无窗口”widgets背景颜色的方法:将GtkLabel包含在GtkEventBox里,然后用函数gtk_widget_modify_bg()设置GtkEven
用户评论