I tried it over two methods
first - change color on a toggled button signal:
Gdk::Color color_init;                         // initialization in header
file

void histtools::on_active1_toggled()    // histtools is a subwindow of
Gtk::Window
{                                                    // active1 is a pointer
to a toggle button
  if (active1->get_active())
  {...
     color_init.set_rgb(255,0,0);
     colorbutton1 -> set_color(color_init); // colorbutton is pointer to a
color button
  }...
}

second - in the initialization:
Gdk::Color color_init;                          // initialization in header
file
Gtk::ColorButton *colorbutton1;

histtools_glade::histtools_glade() : Gtk::Window(Gtk::WINDOW_TOPLEVEL)
{
....
color_init.set_rgb(255,0,0);
colorbutton1 = Gtk::manage(new class Gtk::ColorButton(color_init));
....
}
I have only taken out related code, since my application is to big to put
all in if it not helps I could create an example case. 

-- 
View this message in context: 
http://www.nabble.com/unable-to-change-ColorButtons-default-color-tf2561010.html#a7152926
Sent from the Gtkmm mailing list archive at Nabble.com.

_______________________________________________
gtkmm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to