Re: [gtk-list] gtk_rc_get_style_by_name()?



On Thu, May 22, 1997 at 06:22:40PM -0400, Michael K. Johnson wrote:
> 
> Is there any reason not to have gtk_rc_get_style_by_name()?  I've got
> an application where it could be useful.
> 
> What would be even more useful would be for gtk_widget_set_name() to
> do an implicit gtk_widget_set_style() with the new name taken into
> affect vis-a-vis the rc file.  Is there any reason not to do that?
> (for all I know, it's a feature...  :-)

As I've already told Michael, I think this is a bug. :)

gtk_widget_set_name() does go ahead and reset the style, but it's just
not doing whatever magic gtk_widget_set_style() does to make it take
effect.  Is there any reason not to change gtk_widget_set_name() to
call _set_style() rather than mucking with the pointers by hand.

Problem is, as far as I can tell, the only way to circumvent the
problem is to call gtk_widget_set_name(), then gtk_rc_get_style() to
get the style object, -again- and use gtk_widget_set_style() to set
it.  Lots 'o duplicated code, and a fairly ugly hack.

(In any case, I will have a patch (woo-hoo a  whole three lines
changed) in a few minutes here for at least Michael to play with :)

-- 
					-Otto.



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