On Jun 12, 2011, at 3:32 PM, Krzysztof KosiĆski wrote:
2011/6/13 Jon Cruz <jon@...18...>:
Among other things you end up with a single-sized bitmap that is used regardless of situation and user preferences.
When you use gtk_image_set_from_icon_name the optimal size present in the theme is picked, so this functionality is not unique to stock items (also see below).
It is much more flexible to use a custom stock icon.
GtkImage can display stock items. Are you arguing against using gtk_image_set_from_pixbuf (which I agree is not the best idea, but we can use it temporarily) or against exposing GtkImage as a property?
First and foremost I was pointing out that existing code already allows one to achieve the needed goal without adding any changes to the library. Pushing out changes to app code that require end users to wait for their distros to pick up new versions of libs (or, more often, to wait and then upgrade to a newer distro to get newer libs) is often a poor choice.
The main objection I would have is to using gtk_image_set_from_pixbuf. That is really a non-solution in light of all the problems it gives, and the missing functionality when using it. Then exposing GtkImage also might be sub-optimal. When going that route, things start to be similar to "gee, I'm not sure what to do so I'll just import random assembly code from the user and run that".
There are dynamic subtleties that GtkImage itself does not provide, but require additional custom code to gain. Named icons (as opposed to certain other GtkImage types) have a lot of that missing behavior, but stock icons give even more. One *could* replace their use with GtkImage, but then might not be aware of what is missed, or could be missed. If an API allows users to pass in random things, but only behaves correctly when users pass in only *certain* things, then that is a poor API. On the other hand, an API that only allows one to pass in items that will result in good behavior (stock or named icon names as opposed to arbitrary GtkImage instances, for example) is usually a better one.