Re: problem using pango ...



Where's the Gtk::Button in your code? Is this->object a Gtk::Button pointer?
A Gtk::Button is a container, a Gtk::Bin. If it shows a text, its child widget is probably a Gtk::Label. You should try to change the style of the Button's child instead of the style of the Button itself.

Kjell

2013-09-30 17:30, raespi skrev:
Hi ... I'm currently trying to set the font style of a widget from gtkmm. The code is a bit like this:

Glib::RefPtr< Gtk::Style > s = this->object->get_style();
Pango::FontDescription f = s->get_font();

In a later moment I manage to set the according properties of the Pango::FontDescription object. And end the function's code with:

s->set_font ( f );
this->object->set_style ( s );

At first I thought the code I used to change the properties was incorrect, but I printed the Pango::FontDescription object attributes before setting them and after:

BEFORE: Droid Sans 10
AFTER: Arial Bold Italic 0.029296875

And it seems up to here everything is fine. Still the Gtk::Button doesn't change it's font style ... Any ideas where I could be wrong ??

Thanks ...




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