InterviewSolution
| 1. |
How Do I Use The Style Object? |
|
Answer» Each widget has an associates style object that can be manipulted. The basic method is get_style(), which RETURNS a GtkStyle object, and the associated set_style(style_object). The style is shared between WIDGETS of the same type (XXX: is this true?). To change the style of only one widget in your application, the style object offers a copy() method, which returns a new copy of the GdkStyle, which can me changed and set_style() back to the desired widget. All attributes of a style can be GET and set independently by direct access. The most IMPORTANT attributes of style are the colours (see FAQ 4.6):
And the font and bg_pixmap attributes. Each widget has an associates style object that can be manipulted. The basic method is get_style(), which returns a GtkStyle object, and the associated set_style(style_object). The style is shared between widgets of the same type (XXX: is this true?). To change the style of only one widget in your application, the style object offers a copy() method, which returns a new copy of the GdkStyle, which can me changed and set_style() back to the desired widget. All attributes of a style can be get and set independently by direct access. The most important attributes of style are the colours (see faq 4.6): And the font and bg_pixmap attributes. |
|