Re: Changing the background color of a Label
- From: Paul Davis <pbd Op Net>
- To: "Jean-Christophe Berthon" <jean-christophe berthon cgey com>
- Cc: "Gtk List" <gtk-list gnome org>, gtk-devel-list gnome org
- Subject: Re: Changing the background color of a Label
- Date: Tue, 27 Nov 2001 09:15:37 -0500
>I'm imagining simply a label with a background color (usually Grey) and a
>foreground color (the color of the writing usually black). But I want to
>change this! I've managed to change the foreground color to white but didn't
>manage to change the background to green using GtkStyle under Gtk-1.2.
>Any help would be greatly appreciate :-)
labels don't have a background color. they are just pieces of text
that are drawn over something else.
if you want to control the bg color, you need to add the label to a
container widget that has a window. a GtkEventBox is the typical
choice. you can then control its bg and fg color and the label will
follow.
also, please don't set colors in source code. use an RC file so that
users can change them as they wish using a standard mechanism. there
is information on how to do this in the GTK+ FAQ.
--p
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]