Re: [gtkmm] fonts in gtkmm1.2
- From: Ole Laursen <olau hardworking dk>
- To: "Koecher Rainer ETR.ETB2" <Rainer Koecher ElinEbgTraction at>
- Subject: Re: [gtkmm] fonts in gtkmm1.2
- Date: 31 Aug 2002 00:16:36 +0200
"Koecher Rainer ETR.ETB2" <Rainer Koecher ElinEbgTraction at> writes:
> 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?
There's a description of using a resource file for this purpose in the
FAQ on www.gtk.org. However, I think the problem in the above code
*might* be that you edit the shared style object. IIRC, one was
supposed to take a copy of a widget's style, modify that, and then put
the copy back into the widget.
Anyway, I still think it would be easier to switch to gtkmm 2, even if
you have to install from source packages. :-)
(Sorry for the set_text bummer.)
--
Ole Laursen
http://sunsite.dk/olau/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]