Re: [gtk-list] [Q] gtk_widget_set_style
- From: Tero Pulkkinen <terop students cc tut fi>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] [Q] gtk_widget_set_style
- Date: 28 Jan 1998 11:54:03 +0200
Didier Verna <verna@inf.enst.fr> writes:
> I'd like some help on the following:
>
> I have a label which is child of a table, and I want to change the label font
> dynamicaly. What I do is:
>
> > style = gtk_widget_get_style (label);
> > font = gdk_font_load (pattern);
> > style->font = font;
> > gtk_widget_set_style (label, style);
>
> Well, this works, but the new font is now used in all widgets of my app, not
> only the label.
I'm not sure exactly how the style stuffs work, but by default I'd guess the
get_style() function returns a ptr to a statically allocated "default"
style and changing that will cause every widget in your app have that change.
Thus, you should make a new style with gtk_style_new() and copy the default
style to that and then set the new style to the widget.
Just a guess :)
--
-- Tero Pulkkinen -- terop@modeemi.cs.tut.fi --
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]