Re: [gtkmm] fonts in gtkmm1.2
- From: Chris Vine <chris cvine freeserve co uk>
- To: "Koecher Rainer ETR.ETB2" <Rainer Koecher ElinEbgTraction at>, <gtkmm-list gnome org>
- Subject: Re: [gtkmm] fonts in gtkmm1.2
- Date: Tue, 3 Sep 2002 19:07:25 +0100
On Friday 30 August 2002 1:30 pm, Koecher Rainer ETR.ETB2 wrote:
> I found a sloution for changing the font in Gtkmm 1.2 Widgets:
>
> Gtk::Style *s = label.get_style();
> Gdk_Font f = gdk_font_load("-*-helvetica-bold- .....")
> s.set_font(f);
>
> the only disatwantage of this code ist that it changes the font for all
> Widgets in the window. Does anybody know a solution which changes the
> font only in that widget which should be changed?
You need to take a copy of the style, since it is a shared resource. Thus:
Gtk::Style* s = label.get_style()->copy();
...
Chris.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]