After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 396198 - custom widget example ignores fg color
custom widget example ignores fg color
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: documentation
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
Depends on: 343012
Blocks:
 
 
Reported: 2007-01-13 18:29 UTC by Bruce Horn
Modified: 2008-02-19 02:37 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16



Description Bruce Horn 2007-01-13 18:29:48 UTC
in examples/book/custom/custom_widget/mywidget.cc,
MyWidget::on_realize() sets foreground color to blue, but the triangle is drawn in black.
Comment 1 Murray Cumming 2007-05-05 16:15:06 UTC
Even worse, I'm currently seeing nothing but a red square when I run that example.
Comment 2 Jonathon Jongsma 2007-05-06 15:19:42 UTC
I think that's because the triangle is drawn using the value of m_scale read from the custom_gtkrc file as a multiplier.  But I see this on the output when I run the example:
m_scale (example_scale from the theme/rc-file) is: 0

Which implies that that parameter is not being parsed correctly for some reason.  Does this have anything to do with the fact that the custom_gtkrc file uses the identifier "Gtkmm__CustomObject_mywidget" (capital G) whereas the output of the program indicates that the GType is "gtkmm__CustomObject_mywidget" (lowercase g)?  I tried changing the custom_gtkrc file to use the lowercase version, but I got the following error:
custom_gtkrc:3: error: invalid identifier `gtkmm__CustomObject_mywidget', expected valid identifier
Comment 3 Murray Cumming 2007-05-07 06:01:58 UTC
Yes, the style stuff won't work until this GTK+ patch is applied:
http://bugzilla.gnome.org/show_bug.cgi?id=343012

I guess I need to fix the code to make it more forgiving of that.
Comment 4 Jonathon Jongsma 2007-05-07 15:16:31 UTC
By the way, while I was looking at this issue, I thought I'd update this example to use cairo drawing instead of GDK drawing.  Would you like me to commit those changes?
Comment 5 Murray Cumming 2007-05-07 15:24:11 UTC
Sure. The GtkDrawingArea example used in the book already does this, but we need it here too.
Comment 6 Jonathon Jongsma 2007-05-08 01:10:23 UTC
OK, I've committed an update to the example so it uses cairo for drawing now.  I didn't make any other changes yet, since I wasn't sure how you wanted to resolve this bug, so it still doesn't actually draw anything.
Comment 7 Jonathon Jongsma 2008-02-19 02:30:20 UTC
adding bug #343012 as a dependency
Comment 8 Jonathon Jongsma 2008-02-19 02:37:55 UTC
So after adding that as a dependency, I noticed that it's actually fixed, so I've committed the minor change to the gtkrc file and this example now works again.