Skip to content

Commit

Permalink
support PNG images, too
Browse files Browse the repository at this point in the history
newer raspbian releases (and the tkinter available) seem to work with
PNG images just fine. Looks better too.
  • Loading branch information
splitbrain committed Aug 25, 2017
1 parent b808a74 commit 9ad04c4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pimenu.py
Expand Up @@ -164,9 +164,11 @@ def get_icon(self, name):
if name in self.icons:
return self.icons[name]

ico = self.path + '/ico/' + name + '.gif'
ico = self.path + '/ico/' + name + '.png'
if not os.path.isfile(ico):
ico = self.path + '/ico/cancel.gif'
ico = self.path + '/ico/' + name + '.gif'
if not os.path.isfile(ico):
ico = self.path + '/ico/cancel.gif'

self.icons[name] = PhotoImage(file=ico)
return self.icons[name]
Expand Down

0 comments on commit 9ad04c4

Please sign in to comment.