From 71504d4af717bfbf8fe66dd4fe1fbb2948ab2462 Mon Sep 17 00:00:00 2001 From: Holger Frey Date: Thu, 14 Sep 2017 16:46:29 +0200 Subject: [PATCH] Added parameter for window icon --- arduino_timetable/gui.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/arduino_timetable/gui.py b/arduino_timetable/gui.py index 4f5399c..8af8f34 100644 --- a/arduino_timetable/gui.py +++ b/arduino_timetable/gui.py @@ -375,7 +375,11 @@ class Application(tk.Frame): self._master.destroy() -def run_application(available_commands, title='Arduino Scheduled Commands'): +def run_application( + available_commands, + title='Arduino Scheduled Commands', + icon=None + ): ''' run the gui application available_commands: @@ -383,11 +387,16 @@ def run_application(available_commands, title='Arduino Scheduled Commands'): title: window title bar text + + icon: + program icon to use ''' # create the Tkinter root and instantiate the application root = tk.Tk() root.wm_title(title) + if icon is not None: + root.iconbitmap(icon) app = Application(master=root, available_commands=available_commands) # use app.quit() as callback if the window is closed (with the 'X' button)