After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 351336 - gtk_style_attach wrapping is missed
gtk_style_attach wrapping is missed
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
2.4.x
Other All
: Normal enhancement
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2006-08-14 18:25 UTC by Paul Pogonyshev
Modified: 2007-05-01 20:26 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Wrap gtk_style_attach/detach (1.42 KB, patch)
2006-09-02 08:42 UTC, Johannes Schmid
none Details | Review

Description Paul Pogonyshev 2006-08-14 18:25:32 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.
Comment 1 Murray Cumming 2006-08-16 10:15:09 UTC
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.
Comment 2 Paul Pogonyshev 2006-08-16 17:35:01 UTC
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.
Comment 3 Johannes Schmid 2006-09-02 08:42:55 UTC
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.
Comment 4 Murray Cumming 2006-09-09 19:13:01 UTC
OK. Let's apply this when we branch.
Comment 5 Murray Cumming 2007-05-01 20:26:30 UTC
Committed, after branching for gtkmm-2-10.