can't set background color for Gtk::Entry
- From: Akos Maroy <darkeye tyrell hu>
- To: gtkmm-list <gtkmm-list gnome org>
- Subject: can't set background color for Gtk::Entry
- Date: Tue, 15 Feb 2005 13:04:14 +0100
I'm trying to change the background color for a Gtk::Entry widget. I
tried all sorts of thins, like:
// assume entry is a pointer to a Gtk::Entry
// and getBgColor() returnd a Gtk::Color object
entry->modify_bg(Gtk::STATE_NORMAL, getBgColor());
entry->modify_bg(Gtk::STATE_ACTIVE, getBgColor());
entry->modify_bg(Gtk::STATE_PRELIGHT, getBgColor());
entry->modify_bg(Gtk::STATE_SELECTED, getBgColor());
entry->modify_bg(Gtk::STATE_INSENSITIVE, getBgColor());
Glib::RefPtr<Gtk::Style> style = entry->get_style();
style->set_bg(Gtk::STATE_NORMAL, getBgColor());
style->set_bg(Gtk::STATE_ACTIVE, getBgColor());
style->set_bg(Gtk::STATE_PRELIGHT, getBgColor());
style->set_bg(Gtk::STATE_SELECTED, getBgColor());
style->set_bg(Gtk::STATE_INSENSITIVE, getBgColor());
entry->set_style(style);
unfortunately, none of the above works - the background color for the
Gtk::Entry does not change :(
what am I doing wrong? (using Gtk-- 2.5.5)
Akos
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]