Widget::modify_xxx vs. Widget::get_style()->set_xxx



I've been struggling for a few days with a problem which I finally figured out, but would like to understand.

Given, say, a TreeView, where you want to change the background color:

Gtk::TreeView tree;
tree.modify_fg(Gtk::STATE_NORMAL, Gdk::Color("white")); // works
tree.get_style()->set_fg(Gtk::STATE_NORMAL, Gdk::Color("pink")); // has no effect

Disregarding, for the moment, the conversation about "Style values should be set by the user", can someone explain to me which widgets respect the Style objects returned by get_style(), if any, and which don't? More generally, is there a guideline to knowing the difference?

Or, do I fundamentally misunderstand the reason for and use of the (apparently) contained Style object in Widgets?

A pointer to documentation would be great, too. Thanks.


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