|
Hello, There are many good tutos here for css style on gtk...but nothing about constraints. I want to know if it is possible to style a widget which does not have a gdkwindow ( gtk_widget_set_has_window(wid, FALSE) ). what is the effect of styling a widget when it is not yet realized like:
// very very simple example
int main( int argc, char *argv[] ) { gtk_init( &argc, &argv ); GtkWigdet *window = gtk_window_new(TOPLEVEL_WINDOW); GtWidget *label = gtk_label_new( "My question" ); gtk_container_add( GTK_CONTAINER(window), label); GtkStyleContext *style_context = gtk_widget_get_style_context(label); GtkCssProvider *css_provider = gtk_css_provider_new();
// style applied to label which is not yet realized
gtk_css_provider_load_from_data(css_provider, " GtkLabel {background-color: red} ", -1, NULL ); gtk_style_context_add_provider( style_context, css_provider ); // widget will be realize after showing the toplevel window
gtk_widget_show_all(window); return 0; }
Another question is about the GtkWidgetPath element which is not very clear for me
Thanks for the time to give some answers to my questions...
NB: I'm french I try myself so be indulgent with me :-)
|