[gtkmm] Modifying background for a table



Hi,

I have a Gtk::Table with some labels. I want to change the background
color of the table, but when I do

  Gtk::Table *table = ...;
  unsigned int color = ...;

  Gdk::Color c;
  c.set_rgb(((color >> 24) & 0xff) * 256,
            ((color >> 16) & 0xff) * 256,
            ((color >>  8) & 0xff) * 256);

  table->modify_bg(Gtk::STATE_NORMAL, c);
  table->modify_bg(Gtk::STATE_ACTIVE, c);
  table->modify_bg(Gtk::STATE_PRELIGHT, c);
  table->modify_bg(Gtk::STATE_SELECTED, c);
  table->modify_bg(Gtk::STATE_INSENSITIVE, c);

it doesn't work. The same code works fine for a Gnome canvas. Anyone
happen to know why there would be a difference?

-- 
Ole Laursen
http://www.cs.auc.dk/~olau/



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