[maemo-developers] How can I change the background color of a GtkButton when it is activated

From: Yao Wang yaowang.bupt at gmail.com
Date: Wed Nov 26 03:20:56 EET 2008
Hi, Dave,

Thanks for your advice.

However, my objective is to set two different colors for two different
buttons. That is to say, for button A, when it is pressed, the color should
be red; while for button B, in this case, the color should be green.

Thus I do not think the GTK+ theme can solve this problem.
Is there any other possible solutions?

Thanks in advance.

On Tue, Nov 25, 2008 at 10:23 AM, Dave Neary <dneary at maemo.org> wrote:

> Hi Yao,
>
> Yao Wang wrote:
> >         The default color when I pressed down the button is blue. I want
> > to change the background color of button when it is pressed and recover
> > its origin background color when it is released.
>
> The default colour for when the button is pressed is set by the GTK+
> theme. I'd suggest changing the theme so that all buttons, when pressed,
> will be red. It's in general not a good idea to hack applications with
> hard-coded widget colours, and it's generally encouraged to write
> applications which are consistent with the rest of the environment.
>
> Hope this helps!
> Dave.
>
> --
> maemo.org docsmaster
> Email: dneary at maemo.org
> Jabber: bolsh at jabber.org
>
>


-- 
         Sincerely yours,

Yao Wang

Mobile Life Lab
Beijing University of Posts & Telecommunications
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maemo.org/pipermail/maemo-developers/attachments/20081125/5da2c003/attachment.htm 
More information about the maemo-developers mailing list