Strange widget problem, GTK-2.10

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

 



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.      |
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux