Re: Bug in gtk_widget_reset_rc_styles



Jiri Danes <datafox iol cz> writes:

> Hi all,
> 
> I'm playing with RC Styles and writing an example how to use RC styles.
> For to refresh new settings I'm using following algorithm:
> 
> 1) write new rc file where are the new settings for widget class GtkList
> 2) gtk_rc_reparse_all();
> 3) gtk_widget_reset_rc_styles (mainwindow);
> 4) gtk_widget_hide(mainwindow);
> 5) gtk_widget_show(mainwindow);
> 
> All GtkLists in mainwindow change the colors, but the GktList which is
> the member of GtkCombo doesn't change colors. For to change this list I
> need to get the pointer to combo and call
> 
> gtk_widget_reset_rc_styles (GTK_COMBO(combo)->list);
> 
> After this call the style settings for combo->list change.
> 
> The entry member of combo changes styles settings well.
> 
> I think the gtk_widget_reset_rc_styles (mainwindow) function should
> reset ALL styles for ALL children in mainwindow. Am I right?

gtk_widget_reset_rc_styles() is for all practical purposes
an internal function, so it doesn't need to behave in easy-to-use
ways. And the popup for the combo is a separate toplevel so it
should and doesn't get affected by gtk_widget_reset_rc_styles().

Reloading only the styles of some widgets in your app isn't
supported. To reload RC files for all windows in your app,
look at the code in testgtk.c ... its a bit ugly code, but
its not (IMO) a common operation, so I'm not that concerned
by it.

Regards,
                                        Owen




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