RE: Changing background colors on Gtk::ToolItems



Thanks for the suggestion.  It does work, some what.  When the button mode is pressed nothing appears to change in color, but when you mouse over the toolbutton, the button changes color.  As soon as the mouse moves away from the toolbutton, the color changes back to the default color.

Jim

-----Original Message-----
From: mclarke7 cox net [mailto:mclarke7 cox net]
Sent: Tuesday, May 01, 2007 9:51 AM
To: Jim Barnes
Cc: gtkmm-list gnome org
Subject: Re: Changing background colors on Gtk::ToolItems


I have'nt worked with a toolbutton before, but the docs describe the class as follows...

      A Gtk::ToolItem subclass that displays buttons.
      A ToolButton is are Gtk::ToolItem containing a button. 

So maybe you need to set the color on the button object thats inside the toolbutton. Perhaps something like this will work:

       toolbutton->get_child()->set_style(color_style);

Thats what I would try.

---- Jim Barnes <j r barnes larc nasa gov> wrote: 
> Hi,
> 
> I'm trying to create a tool bar where the ToolButtons are used to control
> Simulation Modes (Operate, Reset, Trim, etc.).  To emphasize what mode has
> been selected, I want to change the background color of the ToolButton.
> Since the ToolButton is a Gtk::Widget I set up a new Gtk::Style with the
> colors I wanted and when the mode is selected I set the style to the color
> style.
> 
> tool_button->set_style(color_style);
> 
> However, the color never gets changed on the display.  This approach does
> work for Gtk:Button though.
> 
> Is there any way to make this work that I haven't found yet?
> 
> Thanks
> Jim
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list





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