Release 4.47.0
This commit is contained in:
parent
b13eec9263
commit
9caa0cea92
|
@ -1,60 +1,11 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
version = __version__ = "4.46.0.20 Unreleased"
|
version = __version__ = "4.47.0 Released 30-Aug-2021"
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Changelog since 4.46.0 release to PyPI on 10 Aug 2021
|
Changelog since 4.47.0 release to PyPI on 30 Aug 2021
|
||||||
|
|
||||||
4.46.0.1
|
|
||||||
Added rstrip parm to Multiline element
|
|
||||||
4.46.0.2
|
|
||||||
Combo.update - fixed bug added in 4.45.0 with disabled not working correctly when calling update
|
|
||||||
4.46.0.3
|
|
||||||
Changed font type in all docstrings to be (str or (str, int[, str]) or None) (thank you Jason!!)
|
|
||||||
4.46.0.4
|
|
||||||
Added code from Jason (slightly modified) for _fixed_map
|
|
||||||
4.46.0.5
|
|
||||||
Fix for default element size - was incorrectly using as the default for parm in Window.
|
|
||||||
Needed to set it in the init code rather than using the parm to set it.
|
|
||||||
4.46.0.6
|
|
||||||
Window.location gets a new parm - more_accurate (defaults to False). If True, uses window's geometry
|
|
||||||
4.46.0.7
|
|
||||||
Added Window.keep_on_top_set and Window.keep_on_top_clear. Makes window behave like was set when creating Window
|
|
||||||
4.46.0.8
|
|
||||||
Added new constant BLANK_BASE64 that essentially erases an Image element if assigned to it. It's 1x1 pixel and Alpha=0
|
|
||||||
4.46.0.9
|
|
||||||
Image element - New source parameter as the first parm. Can be a string or a bytestring. Backwards compatible because first was filename.
|
|
||||||
Works for both the init and the update. No need to specify any name at all... just pass in the thing you want to change to.
|
|
||||||
4.46.0.10
|
|
||||||
Element sizes, when being created, can be an int. If size=int, then it represents a size of (int, 1). GREATLY shortens layouts.
|
|
||||||
Sometimes this these things only become apparent later even though it seems obvious
|
|
||||||
4.46.0.11
|
|
||||||
Another tuple / int convenience change. Tired of typing pad=(0,0)? Yea, me too. Now we can type pad=0.
|
|
||||||
If an int is specified instead of a typle, then a tuple will be created to be same as the int ---> (int, int)
|
|
||||||
4.46.0.12
|
|
||||||
Add NEW upgrade from GitHub code. Thank you @israel-dryer!
|
|
||||||
Fix for Image.update docstring
|
|
||||||
4.46.0.13
|
|
||||||
Change in ttk style naming to ensure more unique style names are used
|
|
||||||
4.46.0.14
|
|
||||||
Cast key to string when making a ttk style
|
|
||||||
4.46.0.15
|
|
||||||
Added '___' between unique counter and user's key when making a unique style string for ttk widgets
|
|
||||||
When upgrading, use the interpreter from the global settings for the upgrade! This could get tricky, but trying to make it logical
|
|
||||||
4.46.0.16
|
|
||||||
Made the window larger for when pip install runs when upgrading to GitHub version.
|
|
||||||
4.46.0.17
|
|
||||||
Added printing of the value of sys.executable to the upgrade information
|
|
||||||
Added --upgrade and --no-cache-dir to the pip install
|
|
||||||
4.46.0.18
|
|
||||||
Redefinition of the Stretch element. No longer returns an Error Element. It now returns a Text element that does
|
|
||||||
the same kind of operation as the PySimpleGUIQt's Stretch element! Very nice!
|
|
||||||
Changed the repr method of the user settings object to use the pretty printer to format the information into a nicer string
|
|
||||||
4.46.0.19
|
|
||||||
Added a vert parm to the Stretch element so that it's used in a vertical manner. MUCH easier to center things in windows now
|
|
||||||
4.46.0.20
|
|
||||||
Added VStretch element that does the same as the Strech except in the vertical direction. Removed the vert parm from Stretch
|
|
||||||
Added fix for the upgrade from GitHub that now creates __init__.py file
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = version.split()[0] # For PEP 396 and PEP 345
|
__version__ = version.split()[0] # For PEP 396 and PEP 345
|
||||||
|
@ -857,7 +808,7 @@ class Element():
|
||||||
|
|
||||||
:param type: The type of element. These constants all start with "ELEM_TYPE_"
|
:param type: The type of element. These constants all start with "ELEM_TYPE_"
|
||||||
:type type: (int) (could be enum)
|
:type type: (int) (could be enum)
|
||||||
:param size: w=characters-wide, h=rows-high. It an int instead of a tuple is supplied, then height is auto-set to 1
|
:param size: w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1
|
||||||
:type size: (int, int) | (None, None) | int
|
:type size: (int, int) | (None, None) | int
|
||||||
:param auto_size_text: True if the Widget should be shrunk to exactly fit the number of chars to show
|
:param auto_size_text: True if the Widget should be shrunk to exactly fit the number of chars to show
|
||||||
:type auto_size_text: bool
|
:type auto_size_text: bool
|
||||||
|
@ -1513,7 +1464,7 @@ class Input(Element):
|
||||||
"""
|
"""
|
||||||
:param default_text: Text initially shown in the input box as a default value(Default value = ''). Will automatically be converted to string
|
:param default_text: Text initially shown in the input box as a default value(Default value = ''). Will automatically be converted to string
|
||||||
:type default_text: (Any)
|
:type default_text: (Any)
|
||||||
:param size: w=characters-wide, h=rows-high. If an int is sppplied rather than a tuple, then a tuple is created width=int supplied and heigh=1
|
:param size: w=characters-wide, h=rows-high. If an int is supplied rather than a tuple, then a tuple is created width=int supplied and heigh=1
|
||||||
:type size: (int, int) | (int, None) | int
|
:type size: (int, int) | (int, None) | int
|
||||||
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
||||||
:type s: (int, int) | (None, None) | int
|
:type s: (int, int) | (None, None) | int
|
||||||
|
@ -2006,7 +1957,7 @@ class Listbox(Element):
|
||||||
:type enable_events: (bool)
|
:type enable_events: (bool)
|
||||||
:param bind_return_key: If True, then the return key will cause a the Listbox to generate an event
|
:param bind_return_key: If True, then the return key will cause a the Listbox to generate an event
|
||||||
:type bind_return_key: (bool)
|
:type bind_return_key: (bool)
|
||||||
:param size: width = characters-wide, height = rows-high
|
:param size: w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1
|
||||||
:type size: (int, int) | (int, None) | int
|
:type size: (int, int) | (int, None) | int
|
||||||
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
||||||
:type s: (int, int) | (None, None) | int
|
:type s: (int, int) | (None, None) | int
|
||||||
|
@ -2223,7 +2174,7 @@ class Radio(Element):
|
||||||
:type default: (bool)
|
:type default: (bool)
|
||||||
:param disabled: set disable state
|
:param disabled: set disable state
|
||||||
:type disabled: (bool)
|
:type disabled: (bool)
|
||||||
:param size: (width, height) width = characters-wide, height = rows-high
|
:param size: (w, h) w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1
|
||||||
:type size: (int, int) | (None, None) | int
|
:type size: (int, int) | (None, None) | int
|
||||||
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
||||||
:type s: (int, int) | (None, None) | int
|
:type s: (int, int) | (None, None) | int
|
||||||
|
@ -2408,7 +2359,7 @@ class Checkbox(Element):
|
||||||
:type text: (str)
|
:type text: (str)
|
||||||
:param default: Set to True if you want this checkbox initially checked
|
:param default: Set to True if you want this checkbox initially checked
|
||||||
:type default: (bool)
|
:type default: (bool)
|
||||||
:param size: (width, height) width = characters-wide, height = rows-high
|
:param size: (w, h) w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1
|
||||||
:type size: (int, int) | (None, None) | int
|
:type size: (int, int) | (None, None) | int
|
||||||
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
||||||
:type s: (int, int) | (None, None) | int
|
:type s: (int, int) | (None, None) | int
|
||||||
|
@ -2593,7 +2544,7 @@ class Spin(Element):
|
||||||
:type enable_events: (bool)
|
:type enable_events: (bool)
|
||||||
:param readonly: Turns on the element specific events. Spin events happen when an item changes
|
:param readonly: Turns on the element specific events. Spin events happen when an item changes
|
||||||
:type readonly: (bool)
|
:type readonly: (bool)
|
||||||
:param size: (width, height) width = characters-wide, height = rows-high
|
:param size: (w, h) w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1
|
||||||
:type size: (int, int) | (None, None) | int
|
:type size: (int, int) | (None, None) | int
|
||||||
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
||||||
:type s: (int, int) | (None, None) | int
|
:type s: (int, int) | (None, None) | int
|
||||||
|
@ -2765,7 +2716,7 @@ class Multiline(Element):
|
||||||
:type autoscroll: (bool)
|
:type autoscroll: (bool)
|
||||||
:param border_width: width of border around element in pixels
|
:param border_width: width of border around element in pixels
|
||||||
:type border_width: (int)
|
:type border_width: (int)
|
||||||
:param size: (width, height) width = characters-wide, height = rows-high
|
:param size: (w, h) w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1
|
||||||
:type size: (int, int) | (None, None) | int
|
:type size: (int, int) | (None, None) | int
|
||||||
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
||||||
:type s: (int, int) | (None, None) | int
|
:type s: (int, int) | (None, None) | int
|
||||||
|
@ -3136,7 +3087,7 @@ class Text(Element):
|
||||||
"""
|
"""
|
||||||
:param text: The text to display. Can include /n to achieve multiple lines. Will convert (optional) parameter into a string
|
:param text: The text to display. Can include /n to achieve multiple lines. Will convert (optional) parameter into a string
|
||||||
:type text: Any
|
:type text: Any
|
||||||
:param size: (width, height) width = characters-wide, height = rows-high
|
:param size: (w, h) w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1
|
||||||
:type size: (int, int) | (int, None) | (None, None) | (int, ) | int
|
:type size: (int, int) | (int, None) | (None, None) | (int, ) | int
|
||||||
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
||||||
:type s: (int, int) | (int, None) | (None, None) | (int, ) | int
|
:type s: (int, int) | (int, None) | (None, None) | (int, ) | int
|
||||||
|
@ -3331,7 +3282,7 @@ class StatusBar(Element):
|
||||||
"""
|
"""
|
||||||
:param text: Text that is to be displayed in the widget
|
:param text: Text that is to be displayed in the widget
|
||||||
:type text: (str)
|
:type text: (str)
|
||||||
:param size: (w,h) w=characters-wide, h=rows-high
|
:param size: (w, h) w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1
|
||||||
:type size: (int, int) | (int, None) | int
|
:type size: (int, int) | (int, None) | int
|
||||||
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
||||||
:type s: (int, int) | (None, None) | int
|
:type s: (int, int) | (None, None) | int
|
||||||
|
@ -3652,7 +3603,7 @@ class Output(Element):
|
||||||
def __init__(self, size=(None, None), s=(None, None), background_color=None, text_color=None, pad=None, echo_stdout_stderr=False, font=None, tooltip=None,
|
def __init__(self, size=(None, None), s=(None, None), background_color=None, text_color=None, pad=None, echo_stdout_stderr=False, font=None, tooltip=None,
|
||||||
key=None, k=None, right_click_menu=None, expand_x=False, expand_y=False, visible=True, metadata=None):
|
key=None, k=None, right_click_menu=None, expand_x=False, expand_y=False, visible=True, metadata=None):
|
||||||
"""
|
"""
|
||||||
:param size: (width, height) w=characters-wide, h=rows-high
|
:param size: (w, h) w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1
|
||||||
:type size: (int, int) | (None, None) | int
|
:type size: (int, int) | (None, None) | int
|
||||||
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
||||||
:type s: (int, int) | (None, None) | int
|
:type s: (int, int) | (None, None) | int
|
||||||
|
@ -3821,7 +3772,7 @@ class Button(Element):
|
||||||
:type image_subsample: (int)
|
:type image_subsample: (int)
|
||||||
:param border_width: width of border around button in pixels
|
:param border_width: width of border around button in pixels
|
||||||
:type border_width: (int)
|
:type border_width: (int)
|
||||||
:param size: (width, height) of the button in characters wide, rows high
|
:param size: (w, h) w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1
|
||||||
:type size: (int, int) | (None, None) | int
|
:type size: (int, int) | (None, None) | int
|
||||||
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
||||||
:type s: (int, int) | (None, None) | int
|
:type s: (int, int) | (None, None) | int
|
||||||
|
@ -4322,7 +4273,7 @@ class ButtonMenu(Element):
|
||||||
:type image_subsample: (int)
|
:type image_subsample: (int)
|
||||||
:param border_width: width of border around button in pixels
|
:param border_width: width of border around button in pixels
|
||||||
:type border_width: (int)
|
:type border_width: (int)
|
||||||
:param size: (width, height) of the button in characters wide, rows high
|
:param size: (w, h) w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1
|
||||||
:type size: (int, int) | (None, None) | int
|
:type size: (int, int) | (None, None) | int
|
||||||
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
:param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
|
||||||
:type s: (int, int) | (None, None) | int
|
:type s: (int, int) | (None, None) | int
|
||||||
|
@ -8341,7 +8292,7 @@ class Window:
|
||||||
self._grab_anywhere_ignore_these_list = []
|
self._grab_anywhere_ignore_these_list = []
|
||||||
self._grab_anywhere_include_these_list = []
|
self._grab_anywhere_include_these_list = []
|
||||||
self._has_custom_titlebar = use_custom_titlebar
|
self._has_custom_titlebar = use_custom_titlebar
|
||||||
|
self._mousex = self._mousey = 0
|
||||||
if self.use_custom_titlebar:
|
if self.use_custom_titlebar:
|
||||||
self.Margins = (0, 0)
|
self.Margins = (0, 0)
|
||||||
self.NoTitleBar = True
|
self.NoTitleBar = True
|
||||||
|
@ -21634,7 +21585,7 @@ def _create_main_window():
|
||||||
|
|
||||||
global_settings_tab_layout = [[T('Global Settings:', font='_ 15')],
|
global_settings_tab_layout = [[T('Global Settings:', font='_ 15')],
|
||||||
[T('Settings Filename:'), T(pysimplegui_user_settings.full_filename, s=(50,2))],
|
[T('Settings Filename:'), T(pysimplegui_user_settings.full_filename, s=(50,2))],
|
||||||
[T('Settings Dictionary:'), T(pysimplegui_user_settings.get_dict(), size=(50,10))],
|
[T('Settings Dictionary:'), MLine(pysimplegui_user_settings, size=(50,10))],
|
||||||
]
|
]
|
||||||
|
|
||||||
themes_tab_layout = [[T('You can see a preview of the themes, the color swatches, or switch themes for this window')],
|
themes_tab_layout = [[T('You can see a preview of the themes, the color swatches, or switch themes for this window')],
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -496,7 +496,7 @@ Be aware that Macs default to using ttk buttons. You can override this setting
|
||||||
|
|
||||||
## Don't Suffer Silently
|
## Don't Suffer Silently
|
||||||
|
|
||||||
The GitHub Issues are checked *often*. Very often. **Please** post your questions and problems there and there only. Please don't post on Reddit, Stackoverflow, on forums, until you've tried posting on the GitHub.
|
The GitHub Issues are checked *often*. Very often. **Please** post your questions and problems there and there only. Please don't post on Reddit, StackOverflow, on forums, until you've tried posting on the GitHub.
|
||||||
|
|
||||||
Why? *It will get you the best support possible.* Second, you'll be helping the project as what you're experiencing might very well be a bug, or even a *known* bug. Why spend hours thrashing, fighting against a known bug?
|
Why? *It will get you the best support possible.* Second, you'll be helping the project as what you're experiencing might very well be a bug, or even a *known* bug. Why spend hours thrashing, fighting against a known bug?
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ Is file I/O in Python limited to only certain people? Is starting a thread, bui
|
||||||
|
|
||||||
Why can't it be 2 lines of code to show a GUI window? What's SO special about the Python GUI libraries that they require you to follow a specific Object Oriented model of development? Other parts and packages of Python don't tend to do that.
|
Why can't it be 2 lines of code to show a GUI window? What's SO special about the Python GUI libraries that they require you to follow a specific Object Oriented model of development? Other parts and packages of Python don't tend to do that.
|
||||||
|
|
||||||
The reason is because they didn't originate in Python. They are strangers in a strange land and they had to be "adapted". They started as C++ programs / SDKs, and remain that way too. There's a vaneer of Python slapped onto the top of them, but that sure didn't make them fit the language as well as they could have.
|
The reason is because they didn't originate in Python. They are strangers in a strange land and they had to be "adapted". They started as C++ programs / SDKs, and remain that way too. There's a veneer of Python slapped onto the top of them, but that sure didn't make them fit the language as well as they could have.
|
||||||
|
|
||||||
PySimpleGUI is designed with both the beginner and the experienced developer in mind. Why? Because both tend to like compact code. Most like people, we just want to get sh\*t done, right? And, why not do it in a way that's like how most of Python works?
|
PySimpleGUI is designed with both the beginner and the experienced developer in mind. Why? Because both tend to like compact code. Most like people, we just want to get sh\*t done, right? And, why not do it in a way that's like how most of Python works?
|
||||||
|
|
||||||
|
@ -3713,6 +3713,8 @@ Specifies the amount of room reserved for the Element. For elements that are ch
|
||||||
|
|
||||||
Some elements, Text and Button, have an auto-size setting that is `on` by default. It will size the element based on the contents. The result is that buttons and text fields will be the size of the string creating them. You can turn it off. For example, for Buttons, the effect will be that all buttons will be the same size in that window.
|
Some elements, Text and Button, have an auto-size setting that is `on` by default. It will size the element based on the contents. The result is that buttons and text fields will be the size of the string creating them. You can turn it off. For example, for Buttons, the effect will be that all buttons will be the same size in that window.
|
||||||
|
|
||||||
|
Beginning in release 4.47.0 sizes can also be an `int` in addition to a tuple. If an int is specified, then that value is taken as the width and the height is set to 1. If given `size=12` then it's the same as `size=(12,1)`
|
||||||
|
|
||||||
#### Element Sizes - Non-tkinter Ports (Qt, WxPython, Web)
|
#### Element Sizes - Non-tkinter Ports (Qt, WxPython, Web)
|
||||||
|
|
||||||
In non-tkinter ports you can set the specific element sizes in 2 ways. One is to use the normal `size` parameter like you're used to using. This will be in characters and rows.
|
In non-tkinter ports you can set the specific element sizes in 2 ways. One is to use the normal `size` parameter like you're used to using. This will be in characters and rows.
|
||||||
|
@ -3727,6 +3729,10 @@ If you're curious about the math used to do the character to pixels conversion,
|
||||||
|
|
||||||
The conversion simply takes your `size[0]` and multiplies by 10 and your `size[1]` and multiplies it by 26.
|
The conversion simply takes your `size[0]` and multiplies by 10 and your `size[1]` and multiplies it by 26.
|
||||||
|
|
||||||
|
##### Specifying Size as an INT
|
||||||
|
|
||||||
|
Beginning in version 4.47.0 you can specify a single int as the size. This will set the size to be a single row in height (1). Writing `size=10` is now the same as writing `size=(10,1)`. A tuple is created on your behalf when you specify a size and an int. This will save a considerable amount of typing, especially for the elements where you typically have only 1 row or can only have 1 row.
|
||||||
|
|
||||||
#### Colors
|
#### Colors
|
||||||
|
|
||||||
A string representing color. Anytime colors are involved, you can specify the tkinter color name such as 'lightblue' or an RGB hex value '#RRGGBB'. For buttons, the color parameter is a tuple (text color, background color)
|
A string representing color. Anytime colors are involved, you can specify the tkinter color name such as 'lightblue' or an RGB hex value '#RRGGBB'. For buttons, the color parameter is a tuple (text color, background color)
|
||||||
|
@ -3739,6 +3745,10 @@ The amount of room around the element in pixels. The default value is (5,3) whic
|
||||||
|
|
||||||
If you want more pixels on one side than the other, then you can split the number into 2 number. If you want 200 pixels on the left side, and 3 pixels on the right, the pad would be ((200,3), 3). In this example, only the x-axis is split.
|
If you want more pixels on one side than the other, then you can split the number into 2 number. If you want 200 pixels on the left side, and 3 pixels on the right, the pad would be ((200,3), 3). In this example, only the x-axis is split.
|
||||||
|
|
||||||
|
##### Specifying pad as an INT
|
||||||
|
|
||||||
|
Starting in version 4.47.0, it's possible to set pad to be an int rather than a tuple. If an int is specified, then the pad is set to a tuple with each position being the same as the int. This reduces the code in your layout significantly if you use values such as (0,0) for your pad. This is not an uncommon value. Now you can write `pad=0` and you will get the same result as if you typed `pad=(0,0)`
|
||||||
|
|
||||||
#### Font
|
#### Font
|
||||||
|
|
||||||
Specifies the font family, size, and style. Font families on Windows include:
|
Specifies the font family, size, and style. Font families on Windows include:
|
||||||
|
@ -3925,10 +3935,14 @@ Individual colors are specified using either the color names as defined in tkint
|
||||||
### `auto_size_text `
|
### `auto_size_text `
|
||||||
A `True` value for `auto_size_text`, when placed on Text Elements, indicates that the width of the Element should be shrunk do the width of the text. The default setting is True. You need to remember this when you create `Text` elements that you are using for output.
|
A `True` value for `auto_size_text`, when placed on Text Elements, indicates that the width of the Element should be shrunk do the width of the text. The default setting is True. You need to remember this when you create `Text` elements that you are using for output.
|
||||||
|
|
||||||
`Text(key='-TXTOUT-)` will create a `Text` Element that has 0 length. Notice that for Text elements with an empty string, no string value needs to be indicated. The default value for strings is `''` for Text Elements. If you try to output a string that's 5 characters, it won't be shown in the window because there isn't enough room. The remedy is to manually set the size to what you expect to output
|
`Text(key='-TXTOUT-)` will create a `Text` Element that has 0 length. Notice that for Text elements with an empty string, no string value needs to be indicated. The default value for strings is `''` for Text Elements. Prior to release 4.45.0 you needed to reserve enough room for your longest string. If you tried to output a string that's 5 characters, it wasn't shown in the window because there wasn't enough room. The remedy was to manually set the size to what you expect to output
|
||||||
|
|
||||||
`Text(size=(15,1), key='-TXTOUT-)` creates a `Text` Element that can hold 15 characters.
|
`Text(size=(15,1), key='-TXTOUT-)` creates a `Text` Element that can hold 15 characters.
|
||||||
|
|
||||||
|
With the newer versions, after 4.45.0, if you set no size at all, that is `size=(None, None)`, then both the `Text` element will grow and shrink to fit the text and so will the `Window`. Additionally, if you indicate that the height is `None` then the element will grow and shrink in their to match the string.
|
||||||
|
|
||||||
|
The way the `Text` element now works is truly auto-sized.
|
||||||
|
|
||||||
### Chortcut functions
|
### Chortcut functions
|
||||||
The shorthand functions for `Text` are `Txt` and `T`
|
The shorthand functions for `Text` are `Txt` and `T`
|
||||||
|
|
||||||
|
@ -8908,11 +8922,52 @@ Text Elements really autosize now
|
||||||
- Added exception details if have a problem with the wm_overriderediect
|
- Added exception details if have a problem with the wm_overriderediect
|
||||||
- Addition of "project information" to the issue your opportunity to share something about what you're making
|
- Addition of "project information" to the issue your opportunity to share something about what you're making
|
||||||
|
|
||||||
|
## 4.47.0 PySimpleGUI 30-Aug-2021
|
||||||
|
|
||||||
|
Stretch & VStretch - A new era of element alignment!
|
||||||
|
Upgrade from GitHub - uses pip for real now
|
||||||
|
Image element - Simpler to use
|
||||||
|
`size` and `pad` parms can be ints in addition to tuples to speed up coding
|
||||||
|
|
||||||
|
- `rstrip` parm added to `Multiline` element
|
||||||
|
- `Combo.update` fixed bug added in 4.45.0 with disabled not working correctly when calling update
|
||||||
|
- Changed font type in all docstrings to be (str or (str, int[, str]) or None) (thank you Jason!!)
|
||||||
|
- Added code from Jason (slightly modified) for _fixed_map
|
||||||
|
- Fix for default element size was incorrectly using as the default for parm in Window.
|
||||||
|
- Needed to set it in the init code rather than using the parm to set it.
|
||||||
|
- `Window.location` gets a new parm `more_accurate` (defaults to `False`). If `True`, uses window's geometry
|
||||||
|
- Added `Window.keep_on_top_set` and `Window.keep_on_top_clear`. Makes window behave like was set when creating Window
|
||||||
|
- Image Element
|
||||||
|
- Added new constant `BLANK_BASE64` that essentially erases an Image element if assigned to it. It's 1x1 pixel and Alpha=0
|
||||||
|
- Image element New `source` parameter as the first parm.
|
||||||
|
- Can be a string or a bytestring. Backwards compatible because first was filename.
|
||||||
|
- Works for both the init and the update. No need to specify any name at all... just pass in the thing you want to change to. Greatly shortens code.
|
||||||
|
- Ths idea is to not have to specify the parameter name. `sg.Image('filename')` and `sg.Image(base64)` both work without using any parameter names.
|
||||||
|
- Fix for `Image.update` docstring
|
||||||
|
- Element sizes, when being created, can be an **int**. If `size=int`, then it represents a `size=(int, 1)`. GREATLY shortens layouts.
|
||||||
|
- Sometimes this these things only become apparent later even though it seems obvious
|
||||||
|
- padding - Another tuple / int convenience change.
|
||||||
|
- Tired of typing `pad=(0,0)`? Yea, me too. Now we can type `pad=0`.
|
||||||
|
- If an int is specified instead of a tuple, then a tuple will be created to be same as the int. `pad=0` is the same as `pad=(0,0)`
|
||||||
|
- Add NEW upgrade from GitHub code. Thank you @israel-dryer!
|
||||||
|
- Change in ttk style naming to ensure more unique style names are used
|
||||||
|
- Cast key to string when making a ttk style
|
||||||
|
- Added `"___"` between unique counter and user's key when making a unique style string for ttk widgets. Fixed problem with elements from one window interfering with another window elements
|
||||||
|
- Changed Upgrade From GitHub Code
|
||||||
|
- When upgrading, use the interpreter from the global settings for the upgrade! This could get tricky, but trying to make it logical
|
||||||
|
- Output of the pip command shown in an upgrade window using a `Multiline` element so errors can be copied from it.
|
||||||
|
- Added printing of the value of `sys.executable` to the upgrade information
|
||||||
|
- `Stretch` and `VStretch` Elements - a promising solution to element justification!
|
||||||
|
- Redefinition of the `Stretch` element. No longer returns an Error Element. It now returns a Text element that does the same kind of operation as the PySimpleGUIQt's `Stretch` element! Very nice!
|
||||||
|
- `VStretch` stretches vertically instead of horizontally
|
||||||
|
- UserSettings APIs
|
||||||
|
- Changed the repr method of the user settings object to use the pretty printer to format the dictionary information into a nicer string
|
||||||
|
|
||||||
## Upcoming
|
## Upcoming
|
||||||
|
|
||||||
The future for PySimpleGUI looks bright!
|
The future for PySimpleGUI looks bright!
|
||||||
|
|
||||||
The overall roadmap is a simple one:
|
The overall road-map is a simple one:
|
||||||
* Continue to build-out the tkinter port
|
* Continue to build-out the tkinter port
|
||||||
* Continue to bring features forward from the tkinter port to the other ports (Qt, WxPython, Remi)
|
* Continue to bring features forward from the tkinter port to the other ports (Qt, WxPython, Remi)
|
||||||
* Add mobile applications (native built applications instead of PyDriod3 that's used today)
|
* Add mobile applications (native built applications instead of PyDriod3 that's used today)
|
||||||
|
@ -8983,6 +9038,6 @@ The project is self-funded and there are ongoing costs just to offer the softwar
|
||||||
|
|
||||||
## Legal
|
## Legal
|
||||||
|
|
||||||
All documentation in this file and in the PySimpleGUI GitHub account are copyright 2021 by PySimpleGUI Inc. The PySimpleGUI code, the demo programs and other source code in the PySimpleGUI account also have a copyright owned by PySimpleGUI Inc.
|
All documentation in this file and in the PySimpleGUI GitHub account are copyright 2021 by PySimpleGUI Tech LLC. The PySimpleGUI code, the demo programs and other source code in the PySimpleGUI account also have a copyright owned by PySimpleGUI Inc.
|
||||||
|
|
||||||
The name "PySimpleGUI" and the PySimpleGUI logo are Trademarked
|
The name "PySimpleGUI" and the PySimpleGUI logo are Trademarked
|
|
@ -557,7 +557,7 @@ Be aware that Macs default to using ttk buttons. You can override this setting
|
||||||
|
|
||||||
## Don't Suffer Silently
|
## Don't Suffer Silently
|
||||||
|
|
||||||
The GitHub Issues are checked *often*. Very often. **Please** post your questions and problems there and there only. Please don't post on Reddit, Stackoverflow, on forums, until you've tried posting on the GitHub.
|
The GitHub Issues are checked *often*. Very often. **Please** post your questions and problems there and there only. Please don't post on Reddit, StackOverflow, on forums, until you've tried posting on the GitHub.
|
||||||
|
|
||||||
Why? *It will get you the best support possible.* Second, you'll be helping the project as what you're experiencing might very well be a bug, or even a *known* bug. Why spend hours thrashing, fighting against a known bug?
|
Why? *It will get you the best support possible.* Second, you'll be helping the project as what you're experiencing might very well be a bug, or even a *known* bug. Why spend hours thrashing, fighting against a known bug?
|
||||||
|
|
||||||
|
@ -589,7 +589,7 @@ Is file I/O in Python limited to only certain people? Is starting a thread, bui
|
||||||
|
|
||||||
Why can't it be 2 lines of code to show a GUI window? What's SO special about the Python GUI libraries that they require you to follow a specific Object Oriented model of development? Other parts and packages of Python don't tend to do that.
|
Why can't it be 2 lines of code to show a GUI window? What's SO special about the Python GUI libraries that they require you to follow a specific Object Oriented model of development? Other parts and packages of Python don't tend to do that.
|
||||||
|
|
||||||
The reason is because they didn't originate in Python. They are strangers in a strange land and they had to be "adapted". They started as C++ programs / SDKs, and remain that way too. There's a vaneer of Python slapped onto the top of them, but that sure didn't make them fit the language as well as they could have.
|
The reason is because they didn't originate in Python. They are strangers in a strange land and they had to be "adapted". They started as C++ programs / SDKs, and remain that way too. There's a veneer of Python slapped onto the top of them, but that sure didn't make them fit the language as well as they could have.
|
||||||
|
|
||||||
PySimpleGUI is designed with both the beginner and the experienced developer in mind. Why? Because both tend to like compact code. Most like people, we just want to get sh\*t done, right? And, why not do it in a way that's like how most of Python works?
|
PySimpleGUI is designed with both the beginner and the experienced developer in mind. Why? Because both tend to like compact code. Most like people, we just want to get sh\*t done, right? And, why not do it in a way that's like how most of Python works?
|
||||||
|
|
||||||
|
|
|
@ -2140,6 +2140,8 @@ Specifies the amount of room reserved for the Element. For elements that are ch
|
||||||
|
|
||||||
Some elements, Text and Button, have an auto-size setting that is `on` by default. It will size the element based on the contents. The result is that buttons and text fields will be the size of the string creating them. You can turn it off. For example, for Buttons, the effect will be that all buttons will be the same size in that window.
|
Some elements, Text and Button, have an auto-size setting that is `on` by default. It will size the element based on the contents. The result is that buttons and text fields will be the size of the string creating them. You can turn it off. For example, for Buttons, the effect will be that all buttons will be the same size in that window.
|
||||||
|
|
||||||
|
Beginning in release 4.47.0 sizes can also be an `int` in addition to a tuple. If an int is specified, then that value is taken as the width and the height is set to 1. If given `size=12` then it's the same as `size=(12,1)`
|
||||||
|
|
||||||
#### Element Sizes - Non-tkinter Ports (Qt, WxPython, Web)
|
#### Element Sizes - Non-tkinter Ports (Qt, WxPython, Web)
|
||||||
|
|
||||||
In non-tkinter ports you can set the specific element sizes in 2 ways. One is to use the normal `size` parameter like you're used to using. This will be in characters and rows.
|
In non-tkinter ports you can set the specific element sizes in 2 ways. One is to use the normal `size` parameter like you're used to using. This will be in characters and rows.
|
||||||
|
@ -2154,6 +2156,9 @@ If you're curious about the math used to do the character to pixels conversion,
|
||||||
|
|
||||||
The conversion simply takes your `size[0]` and multiplies by 10 and your `size[1]` and multiplies it by 26.
|
The conversion simply takes your `size[0]` and multiplies by 10 and your `size[1]` and multiplies it by 26.
|
||||||
|
|
||||||
|
##### Specifying Size as an INT
|
||||||
|
|
||||||
|
Beginning in version 4.47.0 you can specify a single int as the size. This will set the size to be a single row in height (1). Writing `size=10` is now the same as writing `size=(10,1)`. A tuple is created on your behalf when you specify a size and an int. This will save a considerable amount of typing, especially for the elements where you typically have only 1 row or can only have 1 row.
|
||||||
|
|
||||||
#### Colors
|
#### Colors
|
||||||
|
|
||||||
|
@ -2167,6 +2172,10 @@ The amount of room around the element in pixels. The default value is (5,3) whic
|
||||||
|
|
||||||
If you want more pixels on one side than the other, then you can split the number into 2 number. If you want 200 pixels on the left side, and 3 pixels on the right, the pad would be ((200,3), 3). In this example, only the x-axis is split.
|
If you want more pixels on one side than the other, then you can split the number into 2 number. If you want 200 pixels on the left side, and 3 pixels on the right, the pad would be ((200,3), 3). In this example, only the x-axis is split.
|
||||||
|
|
||||||
|
##### Specifying pad as an INT
|
||||||
|
|
||||||
|
Starting in version 4.47.0, it's possible to set pad to be an int rather than a tuple. If an int is specified, then the pad is set to a tuple with each position being the same as the int. This reduces the code in your layout significantly if you use values such as (0,0) for your pad. This is not an uncommon value. Now you can write `pad=0` and you will get the same result as if you typed `pad=(0,0)`
|
||||||
|
|
||||||
#### Font
|
#### Font
|
||||||
|
|
||||||
Specifies the font family, size, and style. Font families on Windows include:
|
Specifies the font family, size, and style. Font families on Windows include:
|
||||||
|
@ -2368,10 +2377,14 @@ Individual colors are specified using either the color names as defined in tkint
|
||||||
### `auto_size_text `
|
### `auto_size_text `
|
||||||
A `True` value for `auto_size_text`, when placed on Text Elements, indicates that the width of the Element should be shrunk do the width of the text. The default setting is True. You need to remember this when you create `Text` elements that you are using for output.
|
A `True` value for `auto_size_text`, when placed on Text Elements, indicates that the width of the Element should be shrunk do the width of the text. The default setting is True. You need to remember this when you create `Text` elements that you are using for output.
|
||||||
|
|
||||||
`Text(key='-TXTOUT-)` will create a `Text` Element that has 0 length. Notice that for Text elements with an empty string, no string value needs to be indicated. The default value for strings is `''` for Text Elements. If you try to output a string that's 5 characters, it won't be shown in the window because there isn't enough room. The remedy is to manually set the size to what you expect to output
|
`Text(key='-TXTOUT-)` will create a `Text` Element that has 0 length. Notice that for Text elements with an empty string, no string value needs to be indicated. The default value for strings is `''` for Text Elements. Prior to release 4.45.0 you needed to reserve enough room for your longest string. If you tried to output a string that's 5 characters, it wasn't shown in the window because there wasn't enough room. The remedy was to manually set the size to what you expect to output
|
||||||
|
|
||||||
`Text(size=(15,1), key='-TXTOUT-)` creates a `Text` Element that can hold 15 characters.
|
`Text(size=(15,1), key='-TXTOUT-)` creates a `Text` Element that can hold 15 characters.
|
||||||
|
|
||||||
|
With the newer versions, after 4.45.0, if you set no size at all, that is `size=(None, None)`, then both the `Text` element will grow and shrink to fit the text and so will the `Window`. Additionally, if you indicate that the height is `None` then the element will grow and shrink in their to match the string.
|
||||||
|
|
||||||
|
The way the `Text` element now works is truly auto-sized.
|
||||||
|
|
||||||
|
|
||||||
### Chortcut functions
|
### Chortcut functions
|
||||||
The shorthand functions for `Text` are `Txt` and `T`
|
The shorthand functions for `Text` are `Txt` and `T`
|
||||||
|
|
|
@ -2088,11 +2088,53 @@ Text Elements really autosize now
|
||||||
- Addition of "project information" to the issue your opportunity to share something about what you're making
|
- Addition of "project information" to the issue your opportunity to share something about what you're making
|
||||||
|
|
||||||
|
|
||||||
|
## 4.47.0 PySimpleGUI 30-Aug-2021
|
||||||
|
|
||||||
|
Stretch & VStretch - A new era of element alignment!
|
||||||
|
Upgrade from GitHub - uses pip for real now
|
||||||
|
Image element - Simpler to use
|
||||||
|
`size` and `pad` parms can be ints in addition to tuples to speed up coding
|
||||||
|
|
||||||
|
- `rstrip` parm added to `Multiline` element
|
||||||
|
- `Combo.update` fixed bug added in 4.45.0 with disabled not working correctly when calling update
|
||||||
|
- Changed font type in all docstrings to be (str or (str, int[, str]) or None) (thank you Jason!!)
|
||||||
|
- Added code from Jason (slightly modified) for _fixed_map
|
||||||
|
- Fix for default element size was incorrectly using as the default for parm in Window.
|
||||||
|
- Needed to set it in the init code rather than using the parm to set it.
|
||||||
|
- `Window.location` gets a new parm `more_accurate` (defaults to `False`). If `True`, uses window's geometry
|
||||||
|
- Added `Window.keep_on_top_set` and `Window.keep_on_top_clear`. Makes window behave like was set when creating Window
|
||||||
|
- Image Element
|
||||||
|
- Added new constant `BLANK_BASE64` that essentially erases an Image element if assigned to it. It's 1x1 pixel and Alpha=0
|
||||||
|
- Image element New `source` parameter as the first parm.
|
||||||
|
- Can be a string or a bytestring. Backwards compatible because first was filename.
|
||||||
|
- Works for both the init and the update. No need to specify any name at all... just pass in the thing you want to change to. Greatly shortens code.
|
||||||
|
- Ths idea is to not have to specify the parameter name. `sg.Image('filename')` and `sg.Image(base64)` both work without using any parameter names.
|
||||||
|
- Fix for `Image.update` docstring
|
||||||
|
- Element sizes, when being created, can be an **int**. If `size=int`, then it represents a `size=(int, 1)`. GREATLY shortens layouts.
|
||||||
|
- Sometimes this these things only become apparent later even though it seems obvious
|
||||||
|
- padding - Another tuple / int convenience change.
|
||||||
|
- Tired of typing `pad=(0,0)`? Yea, me too. Now we can type `pad=0`.
|
||||||
|
- If an int is specified instead of a tuple, then a tuple will be created to be same as the int. `pad=0` is the same as `pad=(0,0)`
|
||||||
|
- Add NEW upgrade from GitHub code. Thank you @israel-dryer!
|
||||||
|
- Change in ttk style naming to ensure more unique style names are used
|
||||||
|
- Cast key to string when making a ttk style
|
||||||
|
- Added `"___"` between unique counter and user's key when making a unique style string for ttk widgets. Fixed problem with elements from one window interfering with another window elements
|
||||||
|
- Changed Upgrade From GitHub Code
|
||||||
|
- When upgrading, use the interpreter from the global settings for the upgrade! This could get tricky, but trying to make it logical
|
||||||
|
- Output of the pip command shown in an upgrade window using a `Multiline` element so errors can be copied from it.
|
||||||
|
- Added printing of the value of `sys.executable` to the upgrade information
|
||||||
|
- `Stretch` and `VStretch` Elements - a promising solution to element justification!
|
||||||
|
- Redefinition of the `Stretch` element. No longer returns an Error Element. It now returns a Text element that does the same kind of operation as the PySimpleGUIQt's `Stretch` element! Very nice!
|
||||||
|
- `VStretch` stretches vertically instead of horizontally
|
||||||
|
- UserSettings APIs
|
||||||
|
- Changed the repr method of the user settings object to use the pretty printer to format the dictionary information into a nicer string
|
||||||
|
|
||||||
|
|
||||||
## Upcoming
|
## Upcoming
|
||||||
|
|
||||||
The future for PySimpleGUI looks bright!
|
The future for PySimpleGUI looks bright!
|
||||||
|
|
||||||
The overall roadmap is a simple one:
|
The overall road-map is a simple one:
|
||||||
* Continue to build-out the tkinter port
|
* Continue to build-out the tkinter port
|
||||||
* Continue to bring features forward from the tkinter port to the other ports (Qt, WxPython, Remi)
|
* Continue to bring features forward from the tkinter port to the other ports (Qt, WxPython, Remi)
|
||||||
* Add mobile applications (native built applications instead of PyDriod3 that's used today)
|
* Add mobile applications (native built applications instead of PyDriod3 that's used today)
|
||||||
|
@ -2166,6 +2208,6 @@ The project is self-funded and there are ongoing costs just to offer the softwar
|
||||||
|
|
||||||
## Legal
|
## Legal
|
||||||
|
|
||||||
All documentation in this file and in the PySimpleGUI GitHub account are copyright 2021 by PySimpleGUI Inc. The PySimpleGUI code, the demo programs and other source code in the PySimpleGUI account also have a copyright owned by PySimpleGUI Inc.
|
All documentation in this file and in the PySimpleGUI GitHub account are copyright 2021 by PySimpleGUI Tech LLC. The PySimpleGUI code, the demo programs and other source code in the PySimpleGUI account also have a copyright owned by PySimpleGUI Inc.
|
||||||
|
|
||||||
The name "PySimpleGUI" and the PySimpleGUI logo are Trademarked
|
The name "PySimpleGUI" and the PySimpleGUI logo are Trademarked
|
|
@ -13,7 +13,7 @@ Work is underway to get the PySimpleGUIQt docstrings completed and corrected.
|
||||||
|
|
||||||
## Caution - Some functions / methods may be internal only yet exposed in this documentation
|
## Caution - Some functions / methods may be internal only yet exposed in this documentation
|
||||||
|
|
||||||
This section of the documentation is generated directly from the source code. As a result, sometimes internal only functions or methods that you are not supposed to be calling are accidently shown in this documentation. Hopefully these accidents don't happen often.
|
This section of the documentation is generated directly from the source code. As a result, sometimes internal only functions or methods that you are not supposed to be calling are accidentally shown in this documentation. Hopefully these accidents don't happen often.
|
||||||
|
|
||||||
Here are all of the Elements, the Window & SystemTray classes, and all functions
|
Here are all of the Elements, the Window & SystemTray classes, and all functions
|
||||||
|
|
||||||
|
@ -1944,6 +1944,12 @@ The following methods are here for backwards compatibility reference. You will
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Stretch Element
|
||||||
|
<!-- <+func.Stretch+> -->
|
||||||
|
|
||||||
|
---------
|
||||||
|
|
||||||
## Tab Element
|
## Tab Element
|
||||||
<!-- <+Tab.doc+> -->
|
<!-- <+Tab.doc+> -->
|
||||||
<!-- <+Tab.__init__+> -->
|
<!-- <+Tab.__init__+> -->
|
||||||
|
@ -2424,8 +2430,11 @@ The following methods are here for backwards compatibility reference. You will
|
||||||
|
|
||||||
### visible
|
### visible
|
||||||
<!-- <+VerticalSeparator.visible+> -->
|
<!-- <+VerticalSeparator.visible+> -->
|
||||||
|
---------
|
||||||
|
|
||||||
|
|
||||||
|
## VStretch Element
|
||||||
|
<!-- <+func.VStretch+> -->
|
||||||
---------
|
---------
|
||||||
|
|
||||||
### These are non-PEP8 Compliant Methods - do NOT use
|
### These are non-PEP8 Compliant Methods - do NOT use
|
||||||
|
@ -2581,6 +2590,12 @@ The following methods are here for backwards compatibility reference. You will
|
||||||
### hide
|
### hide
|
||||||
<!-- <+Window.hide+> -->
|
<!-- <+Window.hide+> -->
|
||||||
|
|
||||||
|
### keep_on_top_clear
|
||||||
|
<!-- <+Window.keep_on_top_clear+> -->
|
||||||
|
|
||||||
|
### keep_on_top_set
|
||||||
|
<!-- <+Window.keep_on_top_set+> -->
|
||||||
|
|
||||||
### key_dict
|
### key_dict
|
||||||
<!-- <+Window.key_dict+> -->
|
<!-- <+Window.key_dict+> -->
|
||||||
|
|
||||||
|
@ -2800,6 +2815,7 @@ The following methods are here for backwards compatibility reference. You will
|
||||||
### hide
|
### hide
|
||||||
<!-- <+SystemTray.hide+> -->
|
<!-- <+SystemTray.hide+> -->
|
||||||
|
|
||||||
|
|
||||||
### metadata
|
### metadata
|
||||||
<!-- <+SystemTray.metadata+> -->
|
<!-- <+SystemTray.metadata+> -->
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -496,7 +496,7 @@ Be aware that Macs default to using ttk buttons. You can override this setting
|
||||||
|
|
||||||
## Don't Suffer Silently
|
## Don't Suffer Silently
|
||||||
|
|
||||||
The GitHub Issues are checked *often*. Very often. **Please** post your questions and problems there and there only. Please don't post on Reddit, Stackoverflow, on forums, until you've tried posting on the GitHub.
|
The GitHub Issues are checked *often*. Very often. **Please** post your questions and problems there and there only. Please don't post on Reddit, StackOverflow, on forums, until you've tried posting on the GitHub.
|
||||||
|
|
||||||
Why? *It will get you the best support possible.* Second, you'll be helping the project as what you're experiencing might very well be a bug, or even a *known* bug. Why spend hours thrashing, fighting against a known bug?
|
Why? *It will get you the best support possible.* Second, you'll be helping the project as what you're experiencing might very well be a bug, or even a *known* bug. Why spend hours thrashing, fighting against a known bug?
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ Is file I/O in Python limited to only certain people? Is starting a thread, bui
|
||||||
|
|
||||||
Why can't it be 2 lines of code to show a GUI window? What's SO special about the Python GUI libraries that they require you to follow a specific Object Oriented model of development? Other parts and packages of Python don't tend to do that.
|
Why can't it be 2 lines of code to show a GUI window? What's SO special about the Python GUI libraries that they require you to follow a specific Object Oriented model of development? Other parts and packages of Python don't tend to do that.
|
||||||
|
|
||||||
The reason is because they didn't originate in Python. They are strangers in a strange land and they had to be "adapted". They started as C++ programs / SDKs, and remain that way too. There's a vaneer of Python slapped onto the top of them, but that sure didn't make them fit the language as well as they could have.
|
The reason is because they didn't originate in Python. They are strangers in a strange land and they had to be "adapted". They started as C++ programs / SDKs, and remain that way too. There's a veneer of Python slapped onto the top of them, but that sure didn't make them fit the language as well as they could have.
|
||||||
|
|
||||||
PySimpleGUI is designed with both the beginner and the experienced developer in mind. Why? Because both tend to like compact code. Most like people, we just want to get sh\*t done, right? And, why not do it in a way that's like how most of Python works?
|
PySimpleGUI is designed with both the beginner and the experienced developer in mind. Why? Because both tend to like compact code. Most like people, we just want to get sh\*t done, right? And, why not do it in a way that's like how most of Python works?
|
||||||
|
|
||||||
|
@ -3713,6 +3713,8 @@ Specifies the amount of room reserved for the Element. For elements that are ch
|
||||||
|
|
||||||
Some elements, Text and Button, have an auto-size setting that is `on` by default. It will size the element based on the contents. The result is that buttons and text fields will be the size of the string creating them. You can turn it off. For example, for Buttons, the effect will be that all buttons will be the same size in that window.
|
Some elements, Text and Button, have an auto-size setting that is `on` by default. It will size the element based on the contents. The result is that buttons and text fields will be the size of the string creating them. You can turn it off. For example, for Buttons, the effect will be that all buttons will be the same size in that window.
|
||||||
|
|
||||||
|
Beginning in release 4.47.0 sizes can also be an `int` in addition to a tuple. If an int is specified, then that value is taken as the width and the height is set to 1. If given `size=12` then it's the same as `size=(12,1)`
|
||||||
|
|
||||||
#### Element Sizes - Non-tkinter Ports (Qt, WxPython, Web)
|
#### Element Sizes - Non-tkinter Ports (Qt, WxPython, Web)
|
||||||
|
|
||||||
In non-tkinter ports you can set the specific element sizes in 2 ways. One is to use the normal `size` parameter like you're used to using. This will be in characters and rows.
|
In non-tkinter ports you can set the specific element sizes in 2 ways. One is to use the normal `size` parameter like you're used to using. This will be in characters and rows.
|
||||||
|
@ -3727,6 +3729,10 @@ If you're curious about the math used to do the character to pixels conversion,
|
||||||
|
|
||||||
The conversion simply takes your `size[0]` and multiplies by 10 and your `size[1]` and multiplies it by 26.
|
The conversion simply takes your `size[0]` and multiplies by 10 and your `size[1]` and multiplies it by 26.
|
||||||
|
|
||||||
|
##### Specifying Size as an INT
|
||||||
|
|
||||||
|
Beginning in version 4.47.0 you can specify a single int as the size. This will set the size to be a single row in height (1). Writing `size=10` is now the same as writing `size=(10,1)`. A tuple is created on your behalf when you specify a size and an int. This will save a considerable amount of typing, especially for the elements where you typically have only 1 row or can only have 1 row.
|
||||||
|
|
||||||
#### Colors
|
#### Colors
|
||||||
|
|
||||||
A string representing color. Anytime colors are involved, you can specify the tkinter color name such as 'lightblue' or an RGB hex value '#RRGGBB'. For buttons, the color parameter is a tuple (text color, background color)
|
A string representing color. Anytime colors are involved, you can specify the tkinter color name such as 'lightblue' or an RGB hex value '#RRGGBB'. For buttons, the color parameter is a tuple (text color, background color)
|
||||||
|
@ -3739,6 +3745,10 @@ The amount of room around the element in pixels. The default value is (5,3) whic
|
||||||
|
|
||||||
If you want more pixels on one side than the other, then you can split the number into 2 number. If you want 200 pixels on the left side, and 3 pixels on the right, the pad would be ((200,3), 3). In this example, only the x-axis is split.
|
If you want more pixels on one side than the other, then you can split the number into 2 number. If you want 200 pixels on the left side, and 3 pixels on the right, the pad would be ((200,3), 3). In this example, only the x-axis is split.
|
||||||
|
|
||||||
|
##### Specifying pad as an INT
|
||||||
|
|
||||||
|
Starting in version 4.47.0, it's possible to set pad to be an int rather than a tuple. If an int is specified, then the pad is set to a tuple with each position being the same as the int. This reduces the code in your layout significantly if you use values such as (0,0) for your pad. This is not an uncommon value. Now you can write `pad=0` and you will get the same result as if you typed `pad=(0,0)`
|
||||||
|
|
||||||
#### Font
|
#### Font
|
||||||
|
|
||||||
Specifies the font family, size, and style. Font families on Windows include:
|
Specifies the font family, size, and style. Font families on Windows include:
|
||||||
|
@ -3925,10 +3935,14 @@ Individual colors are specified using either the color names as defined in tkint
|
||||||
### `auto_size_text `
|
### `auto_size_text `
|
||||||
A `True` value for `auto_size_text`, when placed on Text Elements, indicates that the width of the Element should be shrunk do the width of the text. The default setting is True. You need to remember this when you create `Text` elements that you are using for output.
|
A `True` value for `auto_size_text`, when placed on Text Elements, indicates that the width of the Element should be shrunk do the width of the text. The default setting is True. You need to remember this when you create `Text` elements that you are using for output.
|
||||||
|
|
||||||
`Text(key='-TXTOUT-)` will create a `Text` Element that has 0 length. Notice that for Text elements with an empty string, no string value needs to be indicated. The default value for strings is `''` for Text Elements. If you try to output a string that's 5 characters, it won't be shown in the window because there isn't enough room. The remedy is to manually set the size to what you expect to output
|
`Text(key='-TXTOUT-)` will create a `Text` Element that has 0 length. Notice that for Text elements with an empty string, no string value needs to be indicated. The default value for strings is `''` for Text Elements. Prior to release 4.45.0 you needed to reserve enough room for your longest string. If you tried to output a string that's 5 characters, it wasn't shown in the window because there wasn't enough room. The remedy was to manually set the size to what you expect to output
|
||||||
|
|
||||||
`Text(size=(15,1), key='-TXTOUT-)` creates a `Text` Element that can hold 15 characters.
|
`Text(size=(15,1), key='-TXTOUT-)` creates a `Text` Element that can hold 15 characters.
|
||||||
|
|
||||||
|
With the newer versions, after 4.45.0, if you set no size at all, that is `size=(None, None)`, then both the `Text` element will grow and shrink to fit the text and so will the `Window`. Additionally, if you indicate that the height is `None` then the element will grow and shrink in their to match the string.
|
||||||
|
|
||||||
|
The way the `Text` element now works is truly auto-sized.
|
||||||
|
|
||||||
### Chortcut functions
|
### Chortcut functions
|
||||||
The shorthand functions for `Text` are `Txt` and `T`
|
The shorthand functions for `Text` are `Txt` and `T`
|
||||||
|
|
||||||
|
@ -8908,11 +8922,52 @@ Text Elements really autosize now
|
||||||
- Added exception details if have a problem with the wm_overriderediect
|
- Added exception details if have a problem with the wm_overriderediect
|
||||||
- Addition of "project information" to the issue your opportunity to share something about what you're making
|
- Addition of "project information" to the issue your opportunity to share something about what you're making
|
||||||
|
|
||||||
|
## 4.47.0 PySimpleGUI 30-Aug-2021
|
||||||
|
|
||||||
|
Stretch & VStretch - A new era of element alignment!
|
||||||
|
Upgrade from GitHub - uses pip for real now
|
||||||
|
Image element - Simpler to use
|
||||||
|
`size` and `pad` parms can be ints in addition to tuples to speed up coding
|
||||||
|
|
||||||
|
- `rstrip` parm added to `Multiline` element
|
||||||
|
- `Combo.update` fixed bug added in 4.45.0 with disabled not working correctly when calling update
|
||||||
|
- Changed font type in all docstrings to be (str or (str, int[, str]) or None) (thank you Jason!!)
|
||||||
|
- Added code from Jason (slightly modified) for _fixed_map
|
||||||
|
- Fix for default element size was incorrectly using as the default for parm in Window.
|
||||||
|
- Needed to set it in the init code rather than using the parm to set it.
|
||||||
|
- `Window.location` gets a new parm `more_accurate` (defaults to `False`). If `True`, uses window's geometry
|
||||||
|
- Added `Window.keep_on_top_set` and `Window.keep_on_top_clear`. Makes window behave like was set when creating Window
|
||||||
|
- Image Element
|
||||||
|
- Added new constant `BLANK_BASE64` that essentially erases an Image element if assigned to it. It's 1x1 pixel and Alpha=0
|
||||||
|
- Image element New `source` parameter as the first parm.
|
||||||
|
- Can be a string or a bytestring. Backwards compatible because first was filename.
|
||||||
|
- Works for both the init and the update. No need to specify any name at all... just pass in the thing you want to change to. Greatly shortens code.
|
||||||
|
- Ths idea is to not have to specify the parameter name. `sg.Image('filename')` and `sg.Image(base64)` both work without using any parameter names.
|
||||||
|
- Fix for `Image.update` docstring
|
||||||
|
- Element sizes, when being created, can be an **int**. If `size=int`, then it represents a `size=(int, 1)`. GREATLY shortens layouts.
|
||||||
|
- Sometimes this these things only become apparent later even though it seems obvious
|
||||||
|
- padding - Another tuple / int convenience change.
|
||||||
|
- Tired of typing `pad=(0,0)`? Yea, me too. Now we can type `pad=0`.
|
||||||
|
- If an int is specified instead of a tuple, then a tuple will be created to be same as the int. `pad=0` is the same as `pad=(0,0)`
|
||||||
|
- Add NEW upgrade from GitHub code. Thank you @israel-dryer!
|
||||||
|
- Change in ttk style naming to ensure more unique style names are used
|
||||||
|
- Cast key to string when making a ttk style
|
||||||
|
- Added `"___"` between unique counter and user's key when making a unique style string for ttk widgets. Fixed problem with elements from one window interfering with another window elements
|
||||||
|
- Changed Upgrade From GitHub Code
|
||||||
|
- When upgrading, use the interpreter from the global settings for the upgrade! This could get tricky, but trying to make it logical
|
||||||
|
- Output of the pip command shown in an upgrade window using a `Multiline` element so errors can be copied from it.
|
||||||
|
- Added printing of the value of `sys.executable` to the upgrade information
|
||||||
|
- `Stretch` and `VStretch` Elements - a promising solution to element justification!
|
||||||
|
- Redefinition of the `Stretch` element. No longer returns an Error Element. It now returns a Text element that does the same kind of operation as the PySimpleGUIQt's `Stretch` element! Very nice!
|
||||||
|
- `VStretch` stretches vertically instead of horizontally
|
||||||
|
- UserSettings APIs
|
||||||
|
- Changed the repr method of the user settings object to use the pretty printer to format the dictionary information into a nicer string
|
||||||
|
|
||||||
## Upcoming
|
## Upcoming
|
||||||
|
|
||||||
The future for PySimpleGUI looks bright!
|
The future for PySimpleGUI looks bright!
|
||||||
|
|
||||||
The overall roadmap is a simple one:
|
The overall road-map is a simple one:
|
||||||
* Continue to build-out the tkinter port
|
* Continue to build-out the tkinter port
|
||||||
* Continue to bring features forward from the tkinter port to the other ports (Qt, WxPython, Remi)
|
* Continue to bring features forward from the tkinter port to the other ports (Qt, WxPython, Remi)
|
||||||
* Add mobile applications (native built applications instead of PyDriod3 that's used today)
|
* Add mobile applications (native built applications instead of PyDriod3 that's used today)
|
||||||
|
@ -8983,6 +9038,6 @@ The project is self-funded and there are ongoing costs just to offer the softwar
|
||||||
|
|
||||||
## Legal
|
## Legal
|
||||||
|
|
||||||
All documentation in this file and in the PySimpleGUI GitHub account are copyright 2021 by PySimpleGUI Inc. The PySimpleGUI code, the demo programs and other source code in the PySimpleGUI account also have a copyright owned by PySimpleGUI Inc.
|
All documentation in this file and in the PySimpleGUI GitHub account are copyright 2021 by PySimpleGUI Tech LLC. The PySimpleGUI code, the demo programs and other source code in the PySimpleGUI account also have a copyright owned by PySimpleGUI Inc.
|
||||||
|
|
||||||
The name "PySimpleGUI" and the PySimpleGUI logo are Trademarked
|
The name "PySimpleGUI" and the PySimpleGUI logo are Trademarked
|
Loading…
Reference in New Issue