GNOME Bugzilla – Bug 351336
gtk_style_attach wrapping is missed
Last modified: 2007-05-01 20:26:30 UTC
Currently gtk_style_attach() is ignored with this comment: "These are worthless to the users - they should use set_style instead." However, set_style() has this comment: "Sets the Gtk::Style for a widget ( @a widget ->style). You probably don't want to use this function; it interacts badly with themes..." Please make binding for gtk_style_attach() available. AFAIK, it is required for properly styled widgets. Current workaround: use low-level C function.
Well, the documentation for Gtk::Widget::set_style() does go onto say that you should therefore use modify_style(). However, that code comment in style.hg should explain why someone thinks gtk_attach_style() is useless. And in the absence of any reason, we should indeed wrap it. A patch would be welcome, ideally tested.
As far as I understand, there has to be some style so that you can modify it. And you cannot set theme-awared style currently. Sorry, I cannot produce a patch since I use old Gtkmm 2.4.10 as comes with Debian Sarge. I think it must be as trivial as commenting out `IGNORE...' and uncommenting `WRAP...' but you know better.
Created attachment 72067 [details] [review] Wrap gtk_style_attach/detach GtkStyle is more than just about theming, it also provides some low-level X stuff. Anyway, this method is only useful when creating widgets from scratch by deriving directly from Gtk::Widget. In this case you need to call this in your realise() handler to make the widget work properly. I have attached a very trivial patch which adds the two methods to Gtk::Style.
OK. Let's apply this when we branch.
Committed, after branching for gtkmm-2-10.