Strange widget problem, GTK-2.10
- From: Robert Pearce <rob bdt-home demon co uk>
- To: gtk-list gnome org
- Subject: Strange widget problem, GTK-2.10
- Date: Mon, 1 Jan 2007 22:53:30 +0000
Hi,
I'm new to this list, so I hope this is vaguely the right place...
I have an application that uses a custom widget derived (fairly closely)
from the "GtkDial" example in the tutorial. It's close enough that I'm
fairly confident the problem I have applies to the original too.
This widget draws a dial, consisting of a background canvas, a needle,
and a set of tick marks. When working right, the tick marks are in the
fg[NORMAL] colour, the needle is (slightly oddly) bg[NORMAL] and the
canvas is bg[ACTIVE]. I'd guess this combination was chosen to look nice
on the defaults ;)
Anyway, on GTK-2.8.x this application works fine, including when I set
up my ~/.gtkrc-2.0 for lovely colours.
On GTK-2.10.x it doesn't. The dial background is painted in needle
colour.
So I checked out the dial_test application, which uses the widget in the
same way, and that works on GTK-2.10.x correctly.
Hmm... thought I... that's weird. So I did some digging around, looking
at the places where the two applications differ, starting around where
the dial is used and moving out. Eventually I came down to the
following:
My "proper" application has a toolbar, containing several stock icons.
If I set that toolbar to text only, the dial is coloured correctly. If I
enable the icons, the dial's background is messed up.
As far as I can tell, the background colour is set by the
gtk_style_set_background call at the end of gtk_dial_realise
What seems to be happening, on GTK-2.10.x only, is that the effects of
this line are broken when a [stock] icon is displayed [in the tool bar].
This feels like a bug to me, and not just a bug in the GtkDial example
but something wrong in GTK-2.10 itself. That said, I have worked out
some modifications to GtkDial that get around it (by colouring the
canvas in bg[NORMAL] and the needle in bg[ACTIVE] instead). But I do
feel there's likely to be other places this behaviour may bite somebody.
--
Rob Pearce http://www.bdt-home.demon.co.uk
The contents of this | Windows NT crashed.
message are purely | I am the Blue Screen of Death.
my opinion. Don't | No one hears your screams.
believe a word. |
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]