Merge pull request #493 from MikeTheWatchGuy/Dev-latest
3.9.4 & 1.1.4 Release
This commit is contained in:
commit
934dca0769
207
PySimpleGUI27.py
207
PySimpleGUI27.py
|
@ -208,31 +208,31 @@ BUTTON_TYPE_COLOR_CHOOSER = 40
|
||||||
|
|
||||||
# ------------------------- Element types ------------------------- #
|
# ------------------------- Element types ------------------------- #
|
||||||
# class ElementType(Enum):
|
# class ElementType(Enum):
|
||||||
ELEM_TYPE_TEXT = 1
|
ELEM_TYPE_TEXT = 'text'
|
||||||
ELEM_TYPE_INPUT_TEXT = 20
|
ELEM_TYPE_INPUT_TEXT = 'input'
|
||||||
ELEM_TYPE_INPUT_COMBO = 21
|
ELEM_TYPE_INPUT_COMBO = 'combo'
|
||||||
ELEM_TYPE_INPUT_OPTION_MENU = 22
|
ELEM_TYPE_INPUT_OPTION_MENU = 'option menu'
|
||||||
ELEM_TYPE_INPUT_RADIO = 5
|
ELEM_TYPE_INPUT_RADIO = 'radio'
|
||||||
ELEM_TYPE_INPUT_MULTILINE = 7
|
ELEM_TYPE_INPUT_MULTILINE = 'multiline'
|
||||||
ELEM_TYPE_INPUT_CHECKBOX = 8
|
ELEM_TYPE_INPUT_CHECKBOX = 'checkbox'
|
||||||
ELEM_TYPE_INPUT_SPIN = 9
|
ELEM_TYPE_INPUT_SPIN = 'spind'
|
||||||
ELEM_TYPE_BUTTON = 3
|
ELEM_TYPE_BUTTON = 'button'
|
||||||
ELEM_TYPE_IMAGE = 30
|
ELEM_TYPE_IMAGE = 'image'
|
||||||
ELEM_TYPE_CANVAS = 40
|
ELEM_TYPE_CANVAS = 'canvas'
|
||||||
ELEM_TYPE_FRAME = 41
|
ELEM_TYPE_FRAME = 'frame'
|
||||||
ELEM_TYPE_GRAPH = 42
|
ELEM_TYPE_GRAPH = 'graph'
|
||||||
ELEM_TYPE_TAB = 50
|
ELEM_TYPE_TAB = 'tab'
|
||||||
ELEM_TYPE_TAB_GROUP = 51
|
ELEM_TYPE_TAB_GROUP = 'tabgroup'
|
||||||
ELEM_TYPE_INPUT_SLIDER = 10
|
ELEM_TYPE_INPUT_SLIDER = 'slider'
|
||||||
ELEM_TYPE_INPUT_LISTBOX = 11
|
ELEM_TYPE_INPUT_LISTBOX = 'listbox'
|
||||||
ELEM_TYPE_OUTPUT = 300
|
ELEM_TYPE_OUTPUT = 'output'
|
||||||
ELEM_TYPE_COLUMN = 555
|
ELEM_TYPE_COLUMN = 'column'
|
||||||
ELEM_TYPE_MENUBAR = 600
|
ELEM_TYPE_MENUBAR = 'menubar'
|
||||||
ELEM_TYPE_PROGRESS_BAR = 200
|
ELEM_TYPE_PROGRESS_BAR = 'progressbar'
|
||||||
ELEM_TYPE_BLANK = 100
|
ELEM_TYPE_BLANK = 'blank'
|
||||||
ELEM_TYPE_TABLE = 700
|
ELEM_TYPE_TABLE = 'table'
|
||||||
ELEM_TYPE_TREE = 800
|
ELEM_TYPE_TREE = 'tree'
|
||||||
ELEM_TYPE_ERROR = 666
|
ELEM_TYPE_ERROR = 'error'
|
||||||
|
|
||||||
# ------------------------- Popup Buttons Types ------------------------- #
|
# ------------------------- Popup Buttons Types ------------------------- #
|
||||||
POPUP_BUTTONS_YES_NO = 1
|
POPUP_BUTTONS_YES_NO = 1
|
||||||
|
@ -1252,7 +1252,7 @@ class Button(Element):
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def Update(self, value=None, text=None, button_color=(None, None), disabled=None, image_data=None, image_filename=None):
|
def Update(self, text=None, button_color=(None, None), value=None, disabled=None, image_data=None, image_filename=None):
|
||||||
try:
|
try:
|
||||||
if text is not None:
|
if text is not None:
|
||||||
self.TKButton.configure(text=text)
|
self.TKButton.configure(text=text)
|
||||||
|
@ -1489,6 +1489,16 @@ class Graph(Element):
|
||||||
return self._TKCanvas2.create_oval(converted_top_left[0], converted_top_left[1], converted_bottom_right[0], converted_bottom_right[1], fill=fill_color, outline=line_color)
|
return self._TKCanvas2.create_oval(converted_top_left[0], converted_top_left[1], converted_bottom_right[0], converted_bottom_right[1], fill=fill_color, outline=line_color)
|
||||||
|
|
||||||
|
|
||||||
|
def DrawArc(self, top_left, bottom_right, extent, start_angle, style=None, arc_color='black'):
|
||||||
|
converted_top_left = self._convert_xy_to_canvas_xy(top_left[0], top_left[1] )
|
||||||
|
converted_bottom_right = self._convert_xy_to_canvas_xy(bottom_right[0], bottom_right[1])
|
||||||
|
tkstyle = tk.PIESLICE if style is None else style
|
||||||
|
if self._TKCanvas2 is None:
|
||||||
|
print('*** WARNING - The Graph element has not been finalized and cannot be drawn upon ***')
|
||||||
|
print('Call Window.Finalize() prior to this operation')
|
||||||
|
return None
|
||||||
|
return self._TKCanvas2.create_arc(converted_top_left[0], converted_top_left[1], converted_bottom_right[0], converted_bottom_right[1], extent=extent, start=start_angle, style=tkstyle, outline=arc_color)
|
||||||
|
|
||||||
def DrawRectangle(self, top_left, bottom_right, fill_color=None, line_color=None):
|
def DrawRectangle(self, top_left, bottom_right, fill_color=None, line_color=None):
|
||||||
converted_top_left = self._convert_xy_to_canvas_xy(top_left[0], top_left[1] )
|
converted_top_left = self._convert_xy_to_canvas_xy(top_left[0], top_left[1] )
|
||||||
converted_bottom_right = self._convert_xy_to_canvas_xy(bottom_right[0], bottom_right[1])
|
converted_bottom_right = self._convert_xy_to_canvas_xy(bottom_right[0], bottom_right[1])
|
||||||
|
@ -1792,7 +1802,7 @@ class TabGroup(Element):
|
||||||
# Slider #
|
# Slider #
|
||||||
# ---------------------------------------------------------------------- #
|
# ---------------------------------------------------------------------- #
|
||||||
class Slider(Element):
|
class Slider(Element):
|
||||||
def __init__(self, range=(None,None), default_value=None, resolution=None, orientation=None, border_width=None, relief=None, change_submits=False, disabled=False, size=(None, None), font=None, background_color=None, text_color=None, key=None, pad=None, tooltip=None):
|
def __init__(self, range=(None,None), default_value=None, resolution=None, tick_interval=None, orientation=None, border_width=None, relief=None, change_submits=False, disabled=False, size=(None, None), font=None, background_color=None, text_color=None, key=None, pad=None, tooltip=None):
|
||||||
'''
|
'''
|
||||||
Slider Element
|
Slider Element
|
||||||
:param range:
|
:param range:
|
||||||
|
@ -1820,6 +1830,7 @@ class Slider(Element):
|
||||||
self.Resolution = 1 if resolution is None else resolution
|
self.Resolution = 1 if resolution is None else resolution
|
||||||
self.ChangeSubmits = change_submits
|
self.ChangeSubmits = change_submits
|
||||||
self.Disabled = disabled
|
self.Disabled = disabled
|
||||||
|
self.TickInterval = tick_interval
|
||||||
|
|
||||||
super().__init__(ELEM_TYPE_INPUT_SLIDER, size=size, font=font, background_color=background_color, text_color=text_color, key=key, pad=pad, tooltip=tooltip)
|
super().__init__(ELEM_TYPE_INPUT_SLIDER, size=size, font=font, background_color=background_color, text_color=text_color, key=key, pad=pad, tooltip=tooltip)
|
||||||
return
|
return
|
||||||
|
@ -1936,9 +1947,12 @@ class Column(Element):
|
||||||
self.DictionaryKeyCounter = 0
|
self.DictionaryKeyCounter = 0
|
||||||
self.ParentWindow = None
|
self.ParentWindow = None
|
||||||
self.Rows = []
|
self.Rows = []
|
||||||
# self.ParentForm = None
|
|
||||||
self.TKFrame = None
|
self.TKFrame = None
|
||||||
self.Scrollable = scrollable
|
self.Scrollable = scrollable
|
||||||
|
# self.ImageFilename = image_filename
|
||||||
|
# self.ImageData = image_data
|
||||||
|
# self.ImageSize = image_size
|
||||||
|
# self.ImageSubsample = image_subsample
|
||||||
bg = background_color if background_color is not None else DEFAULT_BACKGROUND_COLOR
|
bg = background_color if background_color is not None else DEFAULT_BACKGROUND_COLOR
|
||||||
|
|
||||||
self.Layout(layout)
|
self.Layout(layout)
|
||||||
|
@ -2199,7 +2213,7 @@ class TKCalendar(tkinter.ttk.Frame):
|
||||||
# Menu #
|
# Menu #
|
||||||
# ---------------------------------------------------------------------- #
|
# ---------------------------------------------------------------------- #
|
||||||
class Menu(Element):
|
class Menu(Element):
|
||||||
def __init__(self, menu_definition, background_color=None, size=(None, None), tearoff=True, pad=None, key=None):
|
def __init__(self, menu_definition, background_color=None, size=(None, None), tearoff=False, pad=None, key=None):
|
||||||
'''
|
'''
|
||||||
Menu Element
|
Menu Element
|
||||||
:param menu_definition:
|
:param menu_definition:
|
||||||
|
@ -2352,15 +2366,19 @@ class TreeData(object):
|
||||||
parent_node = self.tree_dict[parent]
|
parent_node = self.tree_dict[parent]
|
||||||
parent_node._Add(node)
|
parent_node._Add(node)
|
||||||
|
|
||||||
def Print(self):
|
# def _print_node(self, node):
|
||||||
self._print_node(self.root_node)
|
# # print(f'Node: {node.text}')
|
||||||
|
# # print(f'Children = {[c.text for c in node.children]}')
|
||||||
|
# for node in node.children:
|
||||||
|
# self._print_node(node)
|
||||||
|
|
||||||
def _print_node(self, node):
|
def __repr__(self):
|
||||||
# print(f'Node: {node.text}')
|
return self._NodeStr(self.root_node, 1)
|
||||||
# print(f'Children = {[c.text for c in node.children]}')
|
|
||||||
for node in node.children:
|
|
||||||
self._print_node(node)
|
|
||||||
|
|
||||||
|
def _NodeStr(self, node, level):
|
||||||
|
return '\n'.join(
|
||||||
|
[str(node.key) + ' : ' + str(node.text)] +
|
||||||
|
[' ' * 4 * level + self._NodeStr(child, level + 1) for child in node.children])
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------- #
|
# ---------------------------------------------------------------------- #
|
||||||
|
@ -2400,7 +2418,7 @@ class ErrorElement(Element):
|
||||||
# ------------------------------------------------------------------------- #
|
# ------------------------------------------------------------------------- #
|
||||||
class Window(object):
|
class Window(object):
|
||||||
|
|
||||||
def __init__(self, title, default_element_size=DEFAULT_ELEMENT_SIZE, default_button_element_size = (None, None), auto_size_text=None, auto_size_buttons=None, location=(None, None), button_color=None, font=None, progress_bar_color=(None, None), background_color=None, border_depth=None, auto_close=False, auto_close_duration=DEFAULT_AUTOCLOSE_TIME, icon=DEFAULT_WINDOW_ICON, force_toplevel = False, return_keyboard_events=False, use_default_focus=True, text_justification=None, no_titlebar=False, grab_anywhere=False, keep_on_top=False):
|
def __init__(self, title, default_element_size=DEFAULT_ELEMENT_SIZE, default_button_element_size = (None, None), auto_size_text=None, auto_size_buttons=None, location=(None, None), button_color=None, font=None, progress_bar_color=(None, None), background_color=None, border_depth=None, auto_close=False, auto_close_duration=DEFAULT_AUTOCLOSE_TIME, icon=DEFAULT_WINDOW_ICON, force_toplevel = False, return_keyboard_events=False, use_default_focus=True, text_justification=None, no_titlebar=False, grab_anywhere=False, keep_on_top=False, resizable=False):
|
||||||
'''
|
'''
|
||||||
Window
|
Window
|
||||||
:param title:
|
:param title:
|
||||||
|
@ -2464,6 +2482,7 @@ class Window(object):
|
||||||
self.GrabAnywhere = grab_anywhere
|
self.GrabAnywhere = grab_anywhere
|
||||||
self.KeepOnTop = keep_on_top
|
self.KeepOnTop = keep_on_top
|
||||||
self.ForceTopLevel = force_toplevel
|
self.ForceTopLevel = force_toplevel
|
||||||
|
self.Resizable = resizable
|
||||||
|
|
||||||
# ------------------------- Add ONE Row to Form ------------------------- #
|
# ------------------------- Add ONE Row to Form ------------------------- #
|
||||||
def AddRow(self, *args):
|
def AddRow(self, *args):
|
||||||
|
@ -3271,7 +3290,6 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
col_frame.pack(side=tk.LEFT, padx=element.Pad[0], pady=element.Pad[1])
|
col_frame.pack(side=tk.LEFT, padx=element.Pad[0], pady=element.Pad[1])
|
||||||
if element.BackgroundColor != COLOR_SYSTEM_DEFAULT and element.BackgroundColor is not None:
|
if element.BackgroundColor != COLOR_SYSTEM_DEFAULT and element.BackgroundColor is not None:
|
||||||
col_frame.configure(background=element.BackgroundColor, highlightbackground=element.BackgroundColor, highlightcolor=element.BackgroundColor)
|
col_frame.configure(background=element.BackgroundColor, highlightbackground=element.BackgroundColor, highlightcolor=element.BackgroundColor)
|
||||||
|
|
||||||
# ------------------------- TEXT element ------------------------- #
|
# ------------------------- TEXT element ------------------------- #
|
||||||
elif element_type == ELEM_TYPE_TEXT:
|
elif element_type == ELEM_TYPE_TEXT:
|
||||||
# auto_size_text = element.AutoSizeText
|
# auto_size_text = element.AutoSizeText
|
||||||
|
@ -3361,7 +3379,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
photo = photo.subsample(element.ImageSubsample)
|
photo = photo.subsample(element.ImageSubsample)
|
||||||
else:
|
else:
|
||||||
width, height = photo.width(), photo.height()
|
width, height = photo.width(), photo.height()
|
||||||
tkbutton.config(image=photo, width=width, height=height)
|
tkbutton.config(image=photo, compound=tk.CENTER, width=width, height=height)
|
||||||
tkbutton.image = photo
|
tkbutton.image = photo
|
||||||
if element.ImageData: # if button has an image on it
|
if element.ImageData: # if button has an image on it
|
||||||
tkbutton.config(highlightthickness=0)
|
tkbutton.config(highlightthickness=0)
|
||||||
|
@ -3372,7 +3390,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
photo = photo.subsample(element.ImageSubsample)
|
photo = photo.subsample(element.ImageSubsample)
|
||||||
else:
|
else:
|
||||||
width, height = photo.width(), photo.height()
|
width, height = photo.width(), photo.height()
|
||||||
tkbutton.config(image=photo, width=width, height=height)
|
tkbutton.config(image=photo, compound=tk.CENTER, width=width, height=height)
|
||||||
tkbutton.image = photo
|
tkbutton.image = photo
|
||||||
if width != 0:
|
if width != 0:
|
||||||
tkbutton.configure(wraplength=wraplen+10) # set wrap to width of widget
|
tkbutton.configure(wraplength=wraplen+10) # set wrap to width of widget
|
||||||
|
@ -3511,8 +3529,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
vsb.pack(side=tk.LEFT, fill='y')
|
vsb.pack(side=tk.LEFT, fill='y')
|
||||||
listbox_frame.pack(side=tk.LEFT,padx=element.Pad[0], pady=element.Pad[1])
|
listbox_frame.pack(side=tk.LEFT,padx=element.Pad[0], pady=element.Pad[1])
|
||||||
if element.BindReturnKey:
|
if element.BindReturnKey:
|
||||||
element.TKListbox.bind('<Return>', element.ReturnKeyHandler)
|
element.TKListbox.bind('<Return>', element.ListboxSelectHandler)
|
||||||
element.TKListbox.bind('<Double-Button-1>', element.ReturnKeyHandler)
|
element.TKListbox.bind('<Double-Button-1>', element.ListboxSelectHandler)
|
||||||
if element.Disabled == True:
|
if element.Disabled == True:
|
||||||
element.TKListbox['state'] = 'disabled'
|
element.TKListbox['state'] = 'disabled'
|
||||||
if element.Tooltip is not None:
|
if element.Tooltip is not None:
|
||||||
|
@ -3650,7 +3668,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
else:
|
else:
|
||||||
element.tktext_label = tk.Label(tk_row_frame, width=width, height=height, bd=border_depth)
|
element.tktext_label = tk.Label(tk_row_frame, width=width, height=height, bd=border_depth)
|
||||||
if element.BackgroundColor is not None:
|
if element.BackgroundColor is not None:
|
||||||
element.tktext_label.config(background=element.BackgroundColor)
|
element.tktext_label.config(background=element.BackgroundColor);
|
||||||
|
|
||||||
element.tktext_label.image = photo
|
element.tktext_label.image = photo
|
||||||
# tktext_label.configure(anchor=tk.NW, image=photo)
|
# tktext_label.configure(anchor=tk.NW, image=photo)
|
||||||
|
@ -3743,7 +3761,6 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
# foreground=[("selected", 'green')])
|
# foreground=[("selected", 'green')])
|
||||||
# ttk.Style().configure("TNotebook.Tab", background='blue', foreground='yellow')
|
# ttk.Style().configure("TNotebook.Tab", background='blue', foreground='yellow')
|
||||||
|
|
||||||
|
|
||||||
if element.BorderWidth is not None:
|
if element.BorderWidth is not None:
|
||||||
element.TKFrame.configure(borderwidth=element.BorderWidth)
|
element.TKFrame.configure(borderwidth=element.BorderWidth)
|
||||||
if element.Tooltip is not None:
|
if element.Tooltip is not None:
|
||||||
|
@ -3807,9 +3824,10 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
range_from = element.Range[0]
|
range_from = element.Range[0]
|
||||||
range_to = element.Range[1]
|
range_to = element.Range[1]
|
||||||
if element.ChangeSubmits:
|
if element.ChangeSubmits:
|
||||||
tkscale = tk.Scale(tk_row_frame, orient=element.Orientation, variable=element.TKIntVar, from_=range_from, to_=range_to, resolution = element.Resolution, length=slider_length, width=slider_width , bd=element.BorderWidth, relief=element.Relief, font=font, command=element.SliderChangedHandler)
|
tkscale = tk.Scale(tk_row_frame, orient=element.Orientation, variable=element.TKIntVar, from_=range_from, to_=range_to, resolution = element.Resolution, length=slider_length, width=slider_width , bd=element.BorderWidth, relief=element.Relief, font=font, tickinterval=element.TickInterval, command=element.SliderChangedHandler)
|
||||||
else:
|
else:
|
||||||
tkscale = tk.Scale(tk_row_frame, orient=element.Orientation, variable=element.TKIntVar, from_=range_from, to_=range_to, resolution = element.Resolution, length=slider_length, width=slider_width , bd=element.BorderWidth, relief=element.Relief, font=font)
|
tkscale = tk.Scale(tk_row_frame, orient=element.Orientation, variable=element.TKIntVar, from_=range_from, to_=range_to, resolution = element.Resolution, length=slider_length, width=slider_width , bd=element.BorderWidth, relief=element.Relief, font=font
|
||||||
|
, tickinterval=element.TickInterval)
|
||||||
tkscale.config(highlightthickness=0)
|
tkscale.config(highlightthickness=0)
|
||||||
if element.BackgroundColor is not None and element.BackgroundColor != COLOR_SYSTEM_DEFAULT:
|
if element.BackgroundColor is not None and element.BackgroundColor != COLOR_SYSTEM_DEFAULT:
|
||||||
tkscale.configure(background=element.BackgroundColor)
|
tkscale.configure(background=element.BackgroundColor)
|
||||||
|
@ -4010,6 +4028,9 @@ def StartupTK(my_flex_form):
|
||||||
root.bind("<ButtonRelease-1>", my_flex_form.StopMove)
|
root.bind("<ButtonRelease-1>", my_flex_form.StopMove)
|
||||||
root.bind("<B1-Motion>", my_flex_form.OnMotion)
|
root.bind("<B1-Motion>", my_flex_form.OnMotion)
|
||||||
|
|
||||||
|
if not my_flex_form.Resizable:
|
||||||
|
root.resizable(False,False)
|
||||||
|
|
||||||
if my_flex_form.KeepOnTop:
|
if my_flex_form.KeepOnTop:
|
||||||
root.wm_attributes("-topmost", 1)
|
root.wm_attributes("-topmost", 1)
|
||||||
|
|
||||||
|
@ -4469,7 +4490,7 @@ def EasyPrintClose():
|
||||||
|
|
||||||
# ======================== Scrolled Text Box =====#
|
# ======================== Scrolled Text Box =====#
|
||||||
# ===================================================#
|
# ===================================================#
|
||||||
def ScrolledTextBox(*args, **_3to2kwargs):
|
def PopupScrolled(*args, **_3to2kwargs):
|
||||||
if 'size' in _3to2kwargs: size = _3to2kwargs['size']; del _3to2kwargs['size']
|
if 'size' in _3to2kwargs: size = _3to2kwargs['size']; del _3to2kwargs['size']
|
||||||
else: size = (None, None)
|
else: size = (None, None)
|
||||||
if 'auto_close_duration' in _3to2kwargs: auto_close_duration = _3to2kwargs['auto_close_duration']; del _3to2kwargs['auto_close_duration']
|
if 'auto_close_duration' in _3to2kwargs: auto_close_duration = _3to2kwargs['auto_close_duration']; del _3to2kwargs['auto_close_duration']
|
||||||
|
@ -4514,7 +4535,7 @@ def ScrolledTextBox(*args, **_3to2kwargs):
|
||||||
return button
|
return button
|
||||||
|
|
||||||
|
|
||||||
PopupScrolled = ScrolledTextBox
|
ScrolledTextBox = PopupScrolled
|
||||||
|
|
||||||
# ---------------------------------------------------------------------- #
|
# ---------------------------------------------------------------------- #
|
||||||
# GetPathBox #
|
# GetPathBox #
|
||||||
|
@ -4544,7 +4565,7 @@ def PopupGetFolder(message, default_path='', no_window=False, size=(None,None),
|
||||||
:param grab_anywhere:
|
:param grab_anywhere:
|
||||||
:param keep_on_top:
|
:param keep_on_top:
|
||||||
:param location:
|
:param location:
|
||||||
:return: Contents of text field. None if closed using X
|
:return: Contents of text field. None if closed using X or cancelled
|
||||||
"""
|
"""
|
||||||
if no_window:
|
if no_window:
|
||||||
root = tk.Tk()
|
root = tk.Tk()
|
||||||
|
@ -4576,10 +4597,10 @@ def PopupGetFolder(message, default_path='', no_window=False, size=(None,None),
|
||||||
#####################################
|
#####################################
|
||||||
def PopupGetFile(message, default_path='', default_extension='', save_as=False, file_types=(("ALL Files", "*.*"),), no_window=False, size=(None,None), button_color=None, background_color=None, text_color=None, icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False, grab_anywhere=False, keep_on_top=False, location=(None,None)):
|
def PopupGetFile(message, default_path='', default_extension='', save_as=False, file_types=(("ALL Files", "*.*"),), no_window=False, size=(None,None), button_color=None, background_color=None, text_color=None, icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False, grab_anywhere=False, keep_on_top=False, location=(None,None)):
|
||||||
"""
|
"""
|
||||||
Display popup with text entry field and browse button. Browse for file
|
Display popup with text entry field and browse button. Browse for file
|
||||||
|
|
||||||
:param message:
|
:param message:
|
||||||
:param default_path:
|
:param default_path:
|
||||||
|
:param default_extension:
|
||||||
:param save_as:
|
:param save_as:
|
||||||
:param file_types:
|
:param file_types:
|
||||||
:param no_window:
|
:param no_window:
|
||||||
|
@ -4593,7 +4614,7 @@ def PopupGetFile(message, default_path='', default_extension='', save_as=False,
|
||||||
:param grab_anywhere:
|
:param grab_anywhere:
|
||||||
:param keep_on_top:
|
:param keep_on_top:
|
||||||
:param location:
|
:param location:
|
||||||
:return:
|
:return: string representing the path chosen, None if cancelled or window closed with X
|
||||||
"""
|
"""
|
||||||
if no_window:
|
if no_window:
|
||||||
root = tk.Tk()
|
root = tk.Tk()
|
||||||
|
@ -4831,17 +4852,74 @@ def SetOptions(icon=None, button_color=None, element_size=(None,None), button_el
|
||||||
# Predefined settings that will change the colors and styles #
|
# Predefined settings that will change the colors and styles #
|
||||||
# of the elements. #
|
# of the elements. #
|
||||||
##############################################################
|
##############################################################
|
||||||
LOOK_AND_FEEL_TABLE = {'SystemDefault': {'BACKGROUND' : COLOR_SYSTEM_DEFAULT, 'TEXT': COLOR_SYSTEM_DEFAULT, 'INPUT': COLOR_SYSTEM_DEFAULT,'TEXT_INPUT' : COLOR_SYSTEM_DEFAULT, 'SCROLL': COLOR_SYSTEM_DEFAULT, 'BUTTON': OFFICIAL_PYSIMPLEGUI_BUTTON_COLOR, 'PROGRESS': COLOR_SYSTEM_DEFAULT, 'BORDER': 1,'SLIDER_DEPTH':1, 'PROGRESS_DEPTH':0},
|
LOOK_AND_FEEL_TABLE = {'SystemDefault':
|
||||||
'Topanga': {'BACKGROUND': '#282923', 'TEXT': '#E7DB74', 'INPUT': '#393a32',
|
{'BACKGROUND' : COLOR_SYSTEM_DEFAULT,
|
||||||
'TEXT_INPUT': '#E7C855','SCROLL': '#E7C855', 'BUTTON': ('#E7C855', '#284B5A'),
|
'TEXT': COLOR_SYSTEM_DEFAULT,
|
||||||
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1,'SLIDER_DEPTH':0, 'PROGRESS_DEPTH':0},
|
'INPUT': COLOR_SYSTEM_DEFAULT,'TEXT_INPUT' : COLOR_SYSTEM_DEFAULT,
|
||||||
|
'SCROLL': COLOR_SYSTEM_DEFAULT,
|
||||||
|
'BUTTON': OFFICIAL_PYSIMPLEGUI_BUTTON_COLOR,
|
||||||
|
'PROGRESS': COLOR_SYSTEM_DEFAULT,
|
||||||
|
'BORDER': 1,'SLIDER_DEPTH':1,
|
||||||
|
'PROGRESS_DEPTH':0},
|
||||||
|
|
||||||
'GreenTan': {'BACKGROUND' : '#9FB8AD', 'TEXT': COLOR_SYSTEM_DEFAULT, 'INPUT':'#F7F3EC','TEXT_INPUT' : 'black','SCROLL': '#F7F3EC', 'BUTTON': ('white', '#475841'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1,'SLIDER_DEPTH':0, 'PROGRESS_DEPTH':0},
|
'Reddit': {'BACKGROUND': '#ffffff',
|
||||||
|
'TEXT': '#1a1a1b',
|
||||||
|
'INPUT': '#dae0e6',
|
||||||
|
'TEXT_INPUT': '#222222',
|
||||||
|
'SCROLL': '#a5a4a4',
|
||||||
|
'BUTTON': ('white', '#0079d3'),
|
||||||
|
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
|
||||||
|
'BORDER': 1,
|
||||||
|
'SLIDER_DEPTH': 0,
|
||||||
|
'PROGRESS_DEPTH': 0,
|
||||||
|
'ACCENT1' : '#ff5414',
|
||||||
|
'ACCENT2' : '#33a8ff',
|
||||||
|
'ACCENT3' : '#dbf0ff'},
|
||||||
|
|
||||||
|
'Topanga': {'BACKGROUND': '#282923',
|
||||||
|
'TEXT': '#E7DB74',
|
||||||
|
'INPUT': '#393a32',
|
||||||
|
'TEXT_INPUT': '#E7C855',
|
||||||
|
'SCROLL': '#E7C855',
|
||||||
|
'BUTTON': ('#E7C855', '#284B5A'),
|
||||||
|
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
|
||||||
|
'BORDER': 1,'SLIDER_DEPTH':0,
|
||||||
|
'PROGRESS_DEPTH':0},
|
||||||
|
|
||||||
|
'GreenTan': {'BACKGROUND' : '#9FB8AD',
|
||||||
|
'TEXT': COLOR_SYSTEM_DEFAULT,
|
||||||
|
'INPUT':'#F7F3EC','TEXT_INPUT' : 'black',
|
||||||
|
'SCROLL': '#F7F3EC',
|
||||||
|
'BUTTON': ('white', '#475841'),
|
||||||
|
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
|
||||||
|
'BORDER': 1,'SLIDER_DEPTH':0,
|
||||||
|
'PROGRESS_DEPTH':0},
|
||||||
|
|
||||||
|
'Dark': {'BACKGROUND': 'gray25',
|
||||||
|
'TEXT': 'white',
|
||||||
|
'INPUT': 'gray30',
|
||||||
|
'TEXT_INPUT': 'white',
|
||||||
|
'SCROLL': 'gray44',
|
||||||
|
'BUTTON': ('white', '#004F00'),
|
||||||
|
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
|
||||||
|
'BORDER': 1,
|
||||||
|
'SLIDER_DEPTH': 0,
|
||||||
|
'PROGRESS_DEPTH': 0},
|
||||||
|
|
||||||
|
'LightGreen': {'BACKGROUND': '#B7CECE',
|
||||||
|
'TEXT': 'black',
|
||||||
|
'INPUT': '#FDFFF7',
|
||||||
|
'TEXT_INPUT': 'black',
|
||||||
|
'SCROLL': '#FDFFF7',
|
||||||
|
'BUTTON': ('white', '#658268'),
|
||||||
|
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
|
||||||
|
'BORDER': 1,
|
||||||
|
'SLIDER_DEPTH': 0,
|
||||||
|
'ACCENT1': '#76506d',
|
||||||
|
'ACCENT2': '#5148f1',
|
||||||
|
'ACCENT3': '#0a1c84',
|
||||||
|
'PROGRESS_DEPTH': 0},
|
||||||
|
|
||||||
'Dark': {'BACKGROUND': 'gray25', 'TEXT': 'white', 'INPUT': 'gray30',
|
|
||||||
'TEXT_INPUT': 'white', 'SCROLL': 'gray44', 'BUTTON': ('white', '#004F00'),
|
|
||||||
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
|
|
||||||
'PROGRESS_DEPTH': 0},
|
|
||||||
|
|
||||||
'Dark2': {'BACKGROUND': 'gray25', 'TEXT': 'white', 'INPUT': 'white',
|
'Dark2': {'BACKGROUND': 'gray25', 'TEXT': 'white', 'INPUT': 'white',
|
||||||
'TEXT_INPUT': 'black', 'SCROLL': 'gray44', 'BUTTON': ('white', '#004F00'),
|
'TEXT_INPUT': 'black', 'SCROLL': 'gray44', 'BUTTON': ('white', '#004F00'),
|
||||||
|
@ -4888,8 +4966,6 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault': {'BACKGROUND' : COLOR_SYSTEM_DEFAULT, 'T
|
||||||
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
|
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
|
||||||
'PROGRESS_DEPTH': 0},
|
'PROGRESS_DEPTH': 0},
|
||||||
|
|
||||||
'LightGreen' :{'BACKGROUND' : '#B7CECE', 'TEXT': 'black', 'INPUT':'#FDFFF7','TEXT_INPUT' : 'black', 'SCROLL': '#FDFFF7','BUTTON': ('white', '#658268'), 'PROGRESS':DEFAULT_PROGRESS_BAR_COLOR, 'BORDER':1,'SLIDER_DEPTH':0, 'PROGRESS_DEPTH':0},
|
|
||||||
|
|
||||||
'BluePurple': {'BACKGROUND' : '#A5CADD', 'TEXT': '#6E266E', 'INPUT':'#E0F5FF','TEXT_INPUT' : 'black', 'SCROLL': '#E0F5FF','BUTTON': ('white', '#303952'),'PROGRESS':DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1,'SLIDER_DEPTH':0, 'PROGRESS_DEPTH':0},
|
'BluePurple': {'BACKGROUND' : '#A5CADD', 'TEXT': '#6E266E', 'INPUT':'#E0F5FF','TEXT_INPUT' : 'black', 'SCROLL': '#E0F5FF','BUTTON': ('white', '#303952'),'PROGRESS':DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1,'SLIDER_DEPTH':0, 'PROGRESS_DEPTH':0},
|
||||||
|
|
||||||
'Purple': {'BACKGROUND': '#B0AAC2', 'TEXT': 'black', 'INPUT': '#F2EFE8','SCROLL': '#F2EFE8','TEXT_INPUT' : 'black',
|
'Purple': {'BACKGROUND': '#B0AAC2', 'TEXT': 'black', 'INPUT': '#F2EFE8','SCROLL': '#F2EFE8','TEXT_INPUT' : 'black',
|
||||||
|
@ -4920,8 +4996,11 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault': {'BACKGROUND' : COLOR_SYSTEM_DEFAULT, 'T
|
||||||
'TealMono': {'BACKGROUND': '#a8cfdd', 'TEXT': 'black', 'INPUT': '#dfedf2','SCROLL': '#dfedf2', 'TEXT_INPUT' : 'black', 'BUTTON': ('white', '#183440'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1,'SLIDER_DEPTH':0, 'PROGRESS_DEPTH':0}
|
'TealMono': {'BACKGROUND': '#a8cfdd', 'TEXT': 'black', 'INPUT': '#dfedf2','SCROLL': '#dfedf2', 'TEXT_INPUT' : 'black', 'BUTTON': ('white', '#183440'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1,'SLIDER_DEPTH':0, 'PROGRESS_DEPTH':0}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def ListOfLookAndFeelValues():
|
||||||
|
return list(LOOK_AND_FEEL_TABLE.keys())
|
||||||
|
|
||||||
def ChangeLookAndFeel(index):
|
def ChangeLookAndFeel(index):
|
||||||
global LOOK_AND_FEEL_TABLE
|
# global LOOK_AND_FEEL_TABLE
|
||||||
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
print('*** Changing look and feel is not supported on Mac platform ***')
|
print('*** Changing look and feel is not supported on Mac platform ***')
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
|
|
||||||
## Now supports both Python 2.7 & 3
|
## Now supports both Python 2.7 & 3
|
||||||
|
|
||||||
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-3.9.3-red.svg?longCache=true&style=for-the-badge)
|
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-3.9.4-red.svg?longCache=true&style=for-the-badge)
|
||||||
|
|
||||||
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_2.7_Version-1.1.3-blue.svg?longCache=true&style=for-the-badge)
|
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_2.7_Version-1.1.4-blue.svg?longCache=true&style=for-the-badge)
|
||||||
|
|
||||||
[Announcements of Latest Developments](https://github.com/MikeTheWatchGuy/PySimpleGUI/issues/142)
|
[Announcements of Latest Developments](https://github.com/MikeTheWatchGuy/PySimpleGUI/issues/142)
|
||||||
|
|
||||||
|
@ -3355,6 +3355,7 @@ A MikeTheWatchGuy production... entirely responsible for this code.... unless it
|
||||||
| 2.7 01.01.02 | Oct 8, 2018
|
| 2.7 01.01.02 | Oct 8, 2018
|
||||||
| 03.09.01 | Oct 8, 2018
|
| 03.09.01 | Oct 8, 2018
|
||||||
| 3.9.3 & 1.1.3 | Oct 11, 2018
|
| 3.9.3 & 1.1.3 | Oct 11, 2018
|
||||||
|
| 3.9.4 & 1.1.4 | Oct 16, 2018
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -3524,6 +3525,19 @@ It's official. There is a 2.7 version of PySimpleGUI!
|
||||||
* Popup buttons resized to same size
|
* Popup buttons resized to same size
|
||||||
* Exposed look and feel table
|
* Exposed look and feel table
|
||||||
|
|
||||||
|
### 3.9.4 & 1.1.4
|
||||||
|
|
||||||
|
* Parameter order change for Button.Update so that new button ext is at front
|
||||||
|
* New Graph.DrawArc method
|
||||||
|
* Slider tick interval parameter for labeling sliders
|
||||||
|
* Menu tearoff now disabled by default
|
||||||
|
* Tree Data printing simplified and made prettier
|
||||||
|
* Window resizable parameter. Defaults to not resizable
|
||||||
|
* Button images can have text over them now
|
||||||
|
* BUG fix in listbox double-click. First bug fix in months
|
||||||
|
* New Look And Feel capability. List predefined settings using ListOfLookAndFeelValues
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Upcoming
|
### Upcoming
|
||||||
Make suggestions people! Future release features
|
Make suggestions people! Future release features
|
||||||
|
|
18
readme.md
18
readme.md
|
@ -23,9 +23,9 @@
|
||||||
|
|
||||||
## Now supports both Python 2.7 & 3
|
## Now supports both Python 2.7 & 3
|
||||||
|
|
||||||
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-3.9.3-red.svg?longCache=true&style=for-the-badge)
|
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-3.9.4-red.svg?longCache=true&style=for-the-badge)
|
||||||
|
|
||||||
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_2.7_Version-1.1.3-blue.svg?longCache=true&style=for-the-badge)
|
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_2.7_Version-1.1.4-blue.svg?longCache=true&style=for-the-badge)
|
||||||
|
|
||||||
[Announcements of Latest Developments](https://github.com/MikeTheWatchGuy/PySimpleGUI/issues/142)
|
[Announcements of Latest Developments](https://github.com/MikeTheWatchGuy/PySimpleGUI/issues/142)
|
||||||
|
|
||||||
|
@ -3355,6 +3355,7 @@ A MikeTheWatchGuy production... entirely responsible for this code.... unless it
|
||||||
| 2.7 01.01.02 | Oct 8, 2018
|
| 2.7 01.01.02 | Oct 8, 2018
|
||||||
| 03.09.01 | Oct 8, 2018
|
| 03.09.01 | Oct 8, 2018
|
||||||
| 3.9.3 & 1.1.3 | Oct 11, 2018
|
| 3.9.3 & 1.1.3 | Oct 11, 2018
|
||||||
|
| 3.9.4 & 1.1.4 | Oct 16, 2018
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -3524,6 +3525,19 @@ It's official. There is a 2.7 version of PySimpleGUI!
|
||||||
* Popup buttons resized to same size
|
* Popup buttons resized to same size
|
||||||
* Exposed look and feel table
|
* Exposed look and feel table
|
||||||
|
|
||||||
|
### 3.9.4 & 1.1.4
|
||||||
|
|
||||||
|
* Parameter order change for Button.Update so that new button ext is at front
|
||||||
|
* New Graph.DrawArc method
|
||||||
|
* Slider tick interval parameter for labeling sliders
|
||||||
|
* Menu tearoff now disabled by default
|
||||||
|
* Tree Data printing simplified and made prettier
|
||||||
|
* Window resizable parameter. Defaults to not resizable
|
||||||
|
* Button images can have text over them now
|
||||||
|
* BUG fix in listbox double-click. First bug fix in months
|
||||||
|
* New Look And Feel capability. List predefined settings using ListOfLookAndFeelValues
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Upcoming
|
### Upcoming
|
||||||
Make suggestions people! Future release features
|
Make suggestions people! Future release features
|
||||||
|
|
Loading…
Reference in New Issue