Skip to content

Commit 9177b93

Browse files
committed
Check if icon available
1 parent c4a46c2 commit 9177b93

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/com/dtmilano/android/culebron.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,14 @@ def __init__(self, vc, device, serialno, printOperation, scale=1, concertina=Fal
235235
self.scale = scale
236236
self.concertina = concertina
237237
self.window = Tkinter.Tk()
238-
icon = resource_filename(Requirement.parse("androidviewclient"),
238+
try:
239+
f = resource_filename(Requirement.parse("androidviewclient"),
239240
"share/pixmaps/culebra.png")
240-
self.window.tk.call('wm', 'iconphoto', self.window._w,
241-
ImageTk.PhotoImage(file=icon))
241+
icon = ImageTk.PhotoImage(file=f)
242+
except:
243+
icon = None
244+
if icon:
245+
self.window.tk.call('wm', 'iconphoto', self.window._w, icon)
242246
self.mainMenu = MainMenu(self)
243247
self.window.config(menu=self.mainMenu)
244248
self.mainFrame = Tkinter.Frame(self.window)

0 commit comments

Comments
 (0)