Make stock gtk icons from your own images and pixbufs


If you want to set a cell to a pixmap, ok no problem, but what about setting individual liststore values to a pixmap? You can’t do set_value directly unless you’re using a gtk.STOCK_ image. Here’s a way around that little problem.
lightbulb-125x125

Make an icon factory

And register your image files as stock icons!

Now refer to the name you gave your icon wherever you used to use stock icons such as gtk.STOCK_YES

There’s nothing stopping you from setting pixbuf properties on cells directly if you still need that ability. Just use the image the same as you did for the factory add.

I’ll open it with a size to force column uniformity using multiple files that might be different sizes.


Posted on September 19th, by admica in programming, python.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">