Python tkinter multiplatform icon formats

Viewed 313

I'm starting with tkinter with Python3 and I found some issues in Ubuntu practising with the exercises when coming to icons.

I'm reading Mark Lutz's "Programming Python" and he uses a ".ico" file, but it does not work in Ubuntu. I got curious and started to search on the web, and it seems that few icon formats work (.xbm) in Ubuntu, less in color mode.

I was googling and also found that using PIL or pillow is useful for managing and using color icons in tkinter applications and GUIs, but I didn't found yet any piece of code or detailed explanation on how to use an ".ico" file for an icon in a tkinter GUI in a portable way.

I find pretty weird as well not finding some reusable piece of code or library/module which takes a graphics file and returns some kind of usable icon object ready for being used.

Any reccomendation? Am I searching badly? I suppose a good alternative is having some software to convert formats, but I would prefer the best code-oriented solution with multiplatform applications in mind and as many supported formats as possible.

Edit: For making this clear, when I talk about icons, I'm referring to icons, those little images in the top-left corner of our windows or in the OS bar when minimized. This isn't about any other kind of image in labels, buttons or other widgets (I don't even think that should be called an icon)

Thanks in advance

0 Answers
Related