[235] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: gtk_rc_get_style_by_name()?

daemon@ATHENA.MIT.EDU (Otto Hammersmith)
Thu May 22 18:37:13 1997

Date: Thu, 22 May 1997 18:37:01 -0400
From: Otto Hammersmith <otto@redhat.com>
To: gtk-list@redhat.com
In-Reply-To: <199705222222.SAA22446@tristan.redhat.com>; from Michael K. Johnson on Thu, May 22, 1997 at 06:22:40PM -0400
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

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.

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post