widgets' style



Hi,
I've made a widget of my own based on GtkWidget and is called GtkPeriod.
Of course it doesn't have a style of his own defined in common gtkrc files. That's why I'd like it to set a style defined in a gtkrc for another common widget so that it can used with any them without any modification. Indeed I cannot ask the user who 's going to use my widget (included in another application) to modify his gtkrc file, I have to do this in my program. So, what I'd like to, is, while initializing my widget, set it to an existing style for a common widget defined in most, if not all, gtkrc files (in particular the style defined for GtkProgressBar), so that my widget could use the pixmaps of the theme chosen by the user.

Yet, I haven't been able able to find out how to do this so far and I think the solution might have something to do with gtk_rc_get_style_by_paths.
at the end of the realize function I use it in the following way:

new_style = gtk_rc_get_style_by_paths(gtk_widget_get_settings(widget), NULL, "GtkProgressBar", G_TYPE_NONE);
	if(new_style)
		gtk_widget_set_style(widget, new_style);
	widget->style = gtk_style_attach(widget->style, widget->window);


It doesn't work at all and sends Error messages.

Is there anyone who could help me, please !!



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]