5
5
from tkinter import messagebox
6
6
import tkinter .ttk as ttk
7
7
from utils import InputValidator , Database , load_icon , callback
8
+ import sys
8
9
9
10
__version__ = '1.0.0'
10
11
@@ -112,7 +113,8 @@ class Gui(tk.Frame):
112
113
"""Main program graphical user interface"""
113
114
def __init__ (self , master = None , * args , ** kwargs ):
114
115
super ().__init__ (master , * args , ** kwargs )
115
- self .icon = load_icon ()
116
+ if sys .platform == "win32" :
117
+ self .icon = load_icon ()
116
118
self .multi_select = tk .BooleanVar ()
117
119
self .build_menu ()
118
120
self .build_interface ()
@@ -296,10 +298,14 @@ def view_credits(self):
296
298
"""Opens a new window providing credits information"""
297
299
# launch window and configure window settings
298
300
self .win_credits = CreditsTool ()
299
- self .win_credits .title ('' )
301
+ if sys .platform == "win32" :
302
+ self .win_credits .title ('' )
303
+ else :
304
+ self .win_credits .title ('Credits' )
300
305
self .win_credits .geometry ('+%d+%d' % (root .winfo_x () +
301
306
20 , root .winfo_y () + 20 ))
302
- self .win_credits .iconbitmap (self .icon )
307
+ if sys .platform == "win32" :
308
+ self .win_credits .iconbitmap (self .icon )
303
309
self .win_credits .resizable (width = False , height = False )
304
310
# set focus on window
305
311
self .win_credits .grab_set ()
@@ -312,10 +318,11 @@ def manage_apis(self):
312
318
"""Opens a new window allowing user to manage api keys"""
313
319
# launch window and configure window settings
314
320
self .api_tool = ApiTool ()
315
- self .api_tool .title ('' )
321
+ self .api_tool .title ('Manage APIs ' )
316
322
self .api_tool .geometry ('+%d+%d' % (root .winfo_x () +
317
323
20 , root .winfo_y () + 20 ))
318
- self .api_tool .iconbitmap (self .icon )
324
+ if sys .platform == "win32" :
325
+ self .api_tool .iconbitmap (self .icon )
319
326
self .api_tool .resizable (width = False , height = False )
320
327
self .api_tool .protocol ('WM_DELETE_WINDOW' , self .api_tool .close_window )
321
328
# set focus on window
@@ -336,6 +343,7 @@ def quit_program():
336
343
pockint = Gui (root )
337
344
root .config (menu = pockint .top )
338
345
pockint .pack (expand = False )
339
- root .iconbitmap (pockint .icon )
346
+ if sys .platform == "win32" :
347
+ root .iconbitmap (pockint .icon )
340
348
root .protocol ('WM_DELETE_WINDOW' , pockint .quit_program )
341
349
root .mainloop ()
0 commit comments