[Gtk-sharp-list] Get the Background Color of a Widget

Matias Wald waldmatias at hotmail.com
Wed Apr 13 16:26:03 EDT 2011


Check the Style property for the widget. Remember that Gtk appearance is controlled by the theme (which depends on underlying OS), so setting colors using Modify...() in code isnt really the standard way of doing this in Gtk (as opposed to Windows Forms)

Hope this helps!

Enviado desde mi BlackBerry Bold2

-----Original Message-----
From: Frank Gutierrez Domínguez <f.gutierrez at lab.matcom.uh.cu>
Date: Wed, 13 Apr 2011 20:12:36 
To: <gtk-sharp-list at lists.ximian.com>
Subject: [Gtk-sharp-list] Get the Background Color of a Widget

I'm developing a Gtk# version of a Windows.Forms originally made custom Control, so I have to substitute all references to Control members for something equivalent in Gtk. Instead of inheriting my control from System.Windows.Forms as the original, I'm inheriting from Gtk.DrawingArea, thus having access to Gtk.Widget members. The thing is in the original Winforms implementation there are many references to Control.BackgroundColor, like in:
if (this.BackColor == Color.Black)
{ ... }
And I can't find the way to ask for the current BG color of a Widget. Every previous reference to that that appears in Google is for modifying it, with Widget.ModifyBg(), but I don't wanna changed it, just ask for it.
Can anyone help?
Please, I need this ASAP, 'cause it's for my grade thesis.

More information about the Gtk-sharp-list mailing list