How to get Background colour for a Widget

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

 



I'm trying to get the current background colour for a widget, with odd results. I'm using the Gtk# bindings, so I'm not sure what the calls translate into in Gtk+, but if I read a DrawingArea (da) Background with:-

Gdk.Color bg = da.Style.Backgrounds[(int)StateType.Normal];

then set the colour back to this value with

da.ModifyBg(StateType.Normal, bg);

I get a different colour from the original! If I set the default BG with the same call, but with a null colour argument, the original background is indeed restored, but I seem to be unable to read this colour. The obvious property for the BG colour is da.Style.Background(StateType.Normal), but this property is write-only (though I'm not sure why). Any help in understanding what is going on would be most welcome. I've tried the Gtk# list, but it was suggested I'd do better here.

-- Hywel Thomas
_______________________________________________
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