Re: problem using pango ...

Umm, an ever weirder problem now.  I tried the suggestions posted earlier, I Inside my setFont( ... ) function where I receive the according properties:

Gtk::Widget* w = 0;
  w = this->button->get_child();
  assert( w );

The assert fails with the error:
factory: /home/teratux/Workspace/apps/factory/src/gtk/gtk_button.cpp:39: virtual void GTKButton::setFont(FontType, FontSize, FontSeries, FontShape): Assertion `w' failed.

Meaning the button has no child widgets.  I'm using gtkmm2, if I didn't mention it earlier.

On 10/01/2013 03:03 PM, raespi wrote:
On how many widgets does this happen ?? Only on Gtk::Bin widgets ??

If that's the case, I'll somehow have to typecast to resolve the button's issue

On 10/01/2013 02:35 PM, Kjell Ahlstedt wrote:
You can change the style of most widgets. My point is - and that's also what Murray's links describe - that it has no effect to change the font of a Gtk::Button, because the Button does not write the text in it. The text is written by a Label, which is the child of the Button. You must change the Label's font.

2013-10-01 20:17, Murray Cumming skrev:
On Tue, 2013-10-01 at 12:45 -0400, raespi wrote:
Actually this->object is a Gtk::Widget.  I'm implementing a class
hierarchy using the abstract factory pattern, which means that all
widgets should be treated equal in this point where I request to
change the widget's text style.  Can I only change widgets that
inherit from Gtk::Bin ??
Plenty of people get confused by this. I don't like this part of the GTK
+ API either. For instance:

In Glom, I have hidden the ugly dynamic casting, and some other
weirdness, in a utility method:

gtkmm-list mailing list
gtkmm-list gnome org

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