Skip to content
Permalink
Browse files

Revert "Allow custom icon to work via SetOptions"

  • Loading branch information...
MikeTheWatchGuy committed Mar 5, 2019
1 parent 6a9d3f9 commit 305bcb367135eb9dad029a005d1a4ee383d033c7

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -1,5 +1,6 @@
#!/usr/bin/env python
import sys
import sys
if sys.version_info[0] >= 3:
import PySimpleGUI as sg
else:

This file was deleted.

Oops, something went wrong.
@@ -1548,8 +1548,6 @@ def ButtonCallBack(self):
folder_name = tk.filedialog.askdirectory(initialdir=self.InitialFolder) # show the 'get folder' dialog box
if folder_name != '':
try:
if sys.platform == 'win32':
folder_name = folder_name.replace("/", "\\")
strvar.set(folder_name)
self.TKStringVar.set(folder_name)
except:
@@ -1560,8 +1558,6 @@ def ButtonCallBack(self):
else:
file_name = tk.filedialog.askopenfilename(filetypes=filetypes, initialdir=self.InitialFolder) # show the 'get file' dialog box
if file_name != '':
if sys.platform == 'win32':
file_name = file_name.replace("/", "\\")
strvar.set(file_name)
self.TKStringVar.set(file_name)
elif self.BType == BUTTON_TYPE_COLOR_CHOOSER:
@@ -1576,8 +1572,6 @@ def ButtonCallBack(self):
file_name = tk.filedialog.askopenfilenames(filetypes=filetypes, initialdir=self.InitialFolder)
if file_name != '':
file_name = ';'.join(file_name)
if sys.platform == 'win32':
file_name = file_name.replace("/", "\\")
strvar.set(file_name)
self.TKStringVar.set(file_name)
elif self.BType == BUTTON_TYPE_SAVEAS_FILE:
@@ -1587,8 +1581,6 @@ def ButtonCallBack(self):
file_name = tk.filedialog.asksaveasfilename(filetypes=filetypes,
initialdir=self.InitialFolder) # show the 'get file' dialog box
if file_name != '':
if sys.platform == 'win32':
file_name = file_name.replace("/", "\\")
strvar.set(file_name)
self.TKStringVar.set(file_name)
elif self.BType == BUTTON_TYPE_CLOSES_WIN: # this is a return type button so GET RESULTS and destroy window
@@ -2985,7 +2985,7 @@ def __init__(self, title, default_element_size=DEFAULT_ELEMENT_SIZE, default_but
self.Font = font if font else DEFAULT_FONT
self.RadioDict = {}
self.BorderDepth = border_depth
self.WindowIcon = Window.user_defined_icon if Window.user_defined_icon is not None else icon if icon is not None else DEFAULT_WINDOW_ICON
self.WindowIcon = icon if icon is not None else Window.user_defined_icon
self.AutoClose = auto_close
self.NonBlocking = False
self.TKroot = None
@@ -5803,8 +5803,15 @@ def SetOptions(icon=None, button_color=None, element_size=(None, None), button_e
global DEFAULT_ELEMENT_TEXT_COLOR
global DEFAULT_INPUT_TEXT_COLOR
global DEFAULT_TOOLTIP_TIME
global _my_windows

Window.user_defined_icon = icon
if icon:
try:
with open(icon, 'r') as icon_file:
pass
except:
raise FileNotFoundError
_my_windows.user_defined_icon = icon

if button_color != None:
DEFAULT_BUTTON_COLOR = button_color
@@ -1,4 +1,4 @@
# PySimpleGUI-exemaker
# PySimpleGUI-HowDoI

## Introduction
This package contains a GUI front-end to PyInstaller. Use this tool to create EXE files from your python programs

0 comments on commit 305bcb3

Please sign in to comment.
You can’t perform that action at this time.