diff --git a/readme_creator/1_HEADER_top_part.md b/readme_creator/1_HEADER_top_part.md
index ae80f29d..04da2347 100644
--- a/readme_creator/1_HEADER_top_part.md
+++ b/readme_creator/1_HEADER_top_part.md
@@ -29,7 +29,7 @@ HOW DO I INSERT IMAGES ???
[](http://pepy.tech/project/pysimplegui) tkinter
-[](https://pepy.tech/project/pysimplegui27) tkinter 2.7 (WARNING - DISAPPEARING Entirely on 12/31/2019!!!)
+[](https://pepy.tech/project/pysimplegui27) tkinter 2.7
[](https://pepy.tech/project/pysimpleguiqt) Qt
@@ -42,8 +42,7 @@ HOW DO I INSERT IMAGES ???


-
-
+


@@ -74,7 +73,7 @@ pip3 install pysimplegui
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('DarkAmber') # Add a touch of color
+sg.theme('DarkAmber') # Add a touch of color
# All the stuff inside your window.
layout = [ [sg.Text('Some text on Row 1')],
[sg.Text('Enter something on Row 2'), sg.InputText()],
@@ -317,7 +316,7 @@ This makes the coding process extremely quick and the amount of code very small
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('DarkAmber') # Add a little color to your windows
+sg.theme('DarkAmber') # Add a little color to your windows
# All the stuff inside your window. This is the PSG magic code compactor...
layout = [ [sg.Text('Some text on Row 1')],
[sg.Text('Enter something on Row 2'), sg.InputText()],
@@ -788,7 +787,7 @@ Creating and reading the user's inputs for the window occupy the last 2 lines of
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Blue 3') # please make your creations colorful
+sg.theme('Dark Blue 3') # please make your creations colorful
layout = [ [sg.Text('Filename')],
[sg.Input(), sg.FileBrowse()],
@@ -893,9 +892,9 @@ Your program have 2 or 3 windows and you're concerned? Below you'll see 11 wind

-Just because you can't match a pair of socks doesn't mean your windows have to all look the same gray color. Choose from over 100 different "Themes". Add 1 line call to `change_look_and_feel` to instantly transform your window from gray to something more visually pleasing to interact with. If you mispell the theme name badly or specify a theme name is is missing from the table of allowed names, then a theme will be randomly assigned for you. Who knows, maybe the theme chosen you'll like and want to use instead of your original plan.
+Just because you can't match a pair of socks doesn't mean your windows have to all look the same gray color. Choose from over 100 different "Themes". Add 1 line call to `theme` to instantly transform your window from gray to something more visually pleasing to interact with. If you mispell the theme name badly or specify a theme name is is missing from the table of allowed names, then a theme will be randomly assigned for you. Who knows, maybe the theme chosen you'll like and want to use instead of your original plan.
-In PySimpleGUI release 4.6 the number of themes was dramatically increased from a couple dozen to over 100. To use the color schemes shown in the window below, add a call to `change_look_and_feel('Theme Name)` to your code, passing in the name of thd desired color theme. To see this window and the list of available themes on your releeae of softrware, call the function `preview_all_look_and_feel_themes()`. This will create a window with the frames like those below. It will shows you exactly what's available in your version of PySimpleGUI.
+In PySimpleGUI release 4.6 the number of themes was dramatically increased from a couple dozen to over 100. To use the color schemes shown in the window below, add a call to `theme('Theme Name)` to your code, passing in the name of thd desired color theme. To see this window and the list of available themes on your releeae of softrware, call the function `theme_previewer()`. This will create a window with the frames like those below. It will shows you exactly what's available in your version of PySimpleGUI.
In release 4.9 another 32 Color Themes were added... here are the current choices
diff --git a/readme_creator/2_readme.md b/readme_creator/2_readme.md
index e515d525..b666b353 100644
--- a/readme_creator/2_readme.md
+++ b/readme_creator/2_readme.md
@@ -429,7 +429,7 @@ Writing the code for this one is just as straightforward. There is one tricky t
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Blue 3') # please make your windows colorful
+sg.theme('Dark Blue 3') # please make your windows colorful
layout = [[sg.Text('Filename')],
[sg.Input(), sg.FileBrowse()],
@@ -448,7 +448,7 @@ Read on for detailed instructions on the calls that show the window and return y
All of your PySimpleGUI programs will utilize one of these 2 design patterns depending on the type of window you're implementing.
-## Pattern 1 - "One-shot Window" - Read a window one time then close it
+## Pattern 1 A - "One-shot Window" - Read a window one time then close it
This will be the most common pattern you'll follow if you are not using an "event loop" (not reading the window multiple times). The window is read and closed.
@@ -457,7 +457,7 @@ The input fields in your window will be returned to you as a dictionary (syntact
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Blue 3') # please make your windows colorful
+sg.theme('Dark Blue 3') # please make your windows colorful
layout = [[sg.Text('SHA-1 and SHA-256 Hashes for the file')],
@@ -472,6 +472,23 @@ window.close()
source_filename = values[0] # the first input element is values[0]
```
+## Pattern 1 B - "One-shot Window" - Read a window one time then close it (compact format)
+
+Same as Pattern 1, but done in a highly compact way. This example uses the `close` parameter in `window.read` to automatically close the window as part of the read operation (new in version 4.16.0). This enables you to write a single line of code that will create, display, gather input and close a window. It's really powerful stuff!
+
+```python
+import PySimpleGUI as sg
+
+sg.theme('Dark Blue 3') # please make your windows colorful
+
+event, values = sg.Window('SHA-1 & 256 Hash', [[sg.Text('SHA-1 and SHA-256 Hashes for the file')],
+ [sg.InputText(), sg.FileBrowse()],
+ [sg.Submit(), sg.Cancel()]]).read(close=True)
+
+source_filename = values[0] # the first input element is values[0]
+```
+
+
## Pattern 2 A - Persistent window (multiple reads using an event loop)
Some of the more advanced programs operate with the window remaining visible on the screen. Input values are collected, but rather than closing the window, it is kept visible acting as a way to both output information to the user and gather input data.
@@ -481,7 +498,7 @@ This code will present a window and will print values until the user clicks the
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Blue 3') # please make your windows colorful
+sg.theme('Dark Blue 3') # please make your windows colorful
layout = [[sg.Text('Persistent window')],
[sg.Input()],
@@ -506,15 +523,15 @@ Do not worry yet what all of these statements mean. Just copy it so you can be
A final note... the parameter `do_not_clear` in the input call determines the action of the input field after a button event. If this value is True, the input value remains visible following button clicks. If False, then the input field is CLEARED of whatever was input. If you are building a "Form" type of window with data entry, you likely want False. The default is to NOT clear the input element (`do_not_clear=True`).
-This example introduces the concept of "keys". Keys are super important in PySimpleGUI as they enable you to identify and work with Elements using names you want to use. Keys can be ANYTHING, except `None`. To access an input element's data that is read in the example below, you will use `values['_IN_']` instead of `values[0]` like before.
+This example introduces the concept of "keys". Keys are super important in PySimpleGUI as they enable you to identify and work with Elements using names you want to use. Keys can be ANYTHING, except `None`. To access an input element's data that is read in the example below, you will use `values['-IN-']` instead of `values[0]` like before.
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Blue 3') # please make your windows colorful
+sg.theme('Dark Blue 3') # please make your windows colorful
-layout = [[sg.Text('Your typed chars appear here:'), sg.Text(size=(12,1), key='_OUTPUT_')],
- [sg.Input(key='_IN_')],
+layout = [[sg.Text('Your typed chars appear here:'), sg.Text(size=(12,1), key='-OUTPUT-')],
+ [sg.Input(key='-IN-')],
[sg.Button('Show'), sg.Button('Exit')]]
window = sg.Window('Window Title', layout)
@@ -526,9 +543,9 @@ while True: # Event Loop
break
if event == 'Show':
# change the "output" element to be the value of "input" element
- window['_OUTPUT_'].update(values['_IN_'])
+ window['-OUTPUT-'].update(values['-IN-'])
# above line can also be written without the update specified
- window['_OUTPUT_'](values['_IN_'])
+ window['-OUTPUT-'](values['-IN-'])
window.close()
```
@@ -545,12 +562,12 @@ While one goal was making it simple to create a GUI another just as important go
The key to custom windows in PySimpleGUI is to view windows as ROWS of GUI Elements. Each row is specified as a list of these Elements. Put the rows together and you've got a window. This means the GUI is defined as a series of Lists, a Pythonic way of looking at things.
-Let's dissect this little program
+### Let's dissect this little program
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Blue 3') # please make your windows colorful
+sg.theme('Dark Blue 3') # please make your windows colorful
layout = [[sg.Text('Rename files or folders')],
[sg.Text('Source for Folders', size=(15, 1)), sg.InputText(), sg.FolderBrowse()],
@@ -565,16 +582,16 @@ folder_path, file_path = values[0], values[1] # get the data from the valu
print(folder_path, file_path)
```
-#### Colors
+### Themes

-The first line of code after the import is a call to `change_look_and_feel`. This single line of code make the window look like the window above instead of the window below. It will also stop PySimpleGUI from nagging you to put one of these calls into your program.
+The first line of code after the import is a call to `theme`.
+
+Until Dec 2019 the way a "theme" was specific in PySimpleGUI was to call `change_look_and_feel`. That call has been replaced by the more simple function `theme`.
-
-
-#### Window contents
+### Window contents (The Layout)
Let's agree the window has 4 rows.
@@ -599,7 +616,7 @@ For return values the window is scanned from top to bottom, left to right. Each
In our example window, there are 2 fields, so the return values from this window will be a dictionary with 2 values in it. Remember, if you do not specify a `key` when creating an element, one will be created for you. They are ints starting with 0. In this example, we have 2 input elements. They will be addressable as values[0] and values[1]
-#### "Reading" the window's values (also displays the window)
+### "Reading" the window's values (also displays the window)
```python
event, values = window.read()
@@ -815,13 +832,13 @@ Let's take a look at your first dictionary-based window.
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Blue 3') # please make your windows colorful
+sg.theme('Dark Blue 3') # please make your windows colorful
layout = [
[sg.Text('Please enter your Name, Address, Phone')],
- [sg.Text('Name', size=(15, 1)), sg.InputText('1', key='_NAME_')],
- [sg.Text('Address', size=(15, 1)), sg.InputText('2', key='_ADDRESS_')],
- [sg.Text('Phone', size=(15, 1)), sg.InputText('3', key='_PHONE_')],
+ [sg.Text('Name', size=(15, 1)), sg.InputText('1', key='-NAME-')],
+ [sg.Text('Address', size=(15, 1)), sg.InputText('2', key='-ADDRESS-')],
+ [sg.Text('Phone', size=(15, 1)), sg.InputText('3', key='-PHONE-')],
[sg.Submit(), sg.Cancel()]
]
@@ -829,22 +846,22 @@ window = sg.Window('Simple data entry window', layout)
event, values = window.read()
window.close()
-sg.Popup(event, values, values['_NAME_'], values['_ADDRESS_'], values['_PHONE_'])
+sg.Popup(event, values, values['-NAME-'], values['-ADDRESS-'], values['-PHONE-'])
```
To get the value of an input field, you use whatever value used as the `key` value as the index value. Thus to get the value of the name field, it is written as
- values['_NAME_']
+ values['-NAME-']
-Think of the variable values in the same way as you would a list, however, instead of using 0,1,2, to reference each item in the list, use the values of the key. The Name field in the window above is referenced by `values['_NAME_']`.
+Think of the variable values in the same way as you would a list, however, instead of using 0,1,2, to reference each item in the list, use the values of the key. The Name field in the window above is referenced by `values['-NAME-']`.
You will find the key field used quite heavily in most PySimpleGUI windows unless the window is very simple.
One convention you'll see in many of the demo programs is keys being named in all caps with an underscores at the beginning and the end. You don't HAVE to do this... your key value may look like this:
-`key = '_NAME__'`
+`key = '-NAME-'`
The reason for this naming convention is that when you are scanning the code, these key values jump out at you. You instantly know it's a key. Try scanning the code above and see if those keys pop out.
-`key = '_NAME__'`
+`key = '-NAME-'`
@@ -1008,6 +1025,81 @@ event, values = window.Read(timeout=100)
You can learn more about these async / non-blocking windows toward the end of this document.
+# Themes - Automatic Coloring of Your Windows
+
+In Dec 2019 the function `change_look_and_feel` was replaced by `theme`. The concept remains the same, but a new group of function alls makes it a lot easier to manage colors and other settings.
+
+By default the PySimpleGUI color theme is now `Dark Blue 3`. Gone are the "system default" gray colors. If you want your window to be devoid of all colors so that the system chooses the colors (gray) for you, then set the theme to 'SystemDefault1' or `Default1`.
+
+There are 130 themes available. You can preview these themes by calling `theme_previewer()` which will create a LARGE window displaying all of the color themes available.
+
+As of this writing, these are your available themes.
+
+
+
+## Default is `Dark Blue 3`
+
+
+
+
+In Dec 2019 the default for all PySimpleGUI windows changed from the system gray with blue buttons to a more complete theme using a grayish blue with white text. Previouisly users were nagged into choosing color theme other than gray. Now it's done for you instead of nagging you.
+
+If you're struggling with this color theme, then add a call to `theme` to change it.
+
+
+
+## Theme Name Formula
+
+Themes names that you specify can be "fuzzy". The text does not have to match exactly what you see printed. For example "Dark Blue 3" and "DarkBlue3" and "dark blue 3" all work.
+
+One way to quickly determine the best setting for your window is to simply display your window using a lot of different themes. Add the line of code to set the theme - `theme('Dark Green 1')`, run your code, see if you like it, if not, change the theme string to `'Dark Green 2'` and try again. Repeat until you find something you like.
+
+The "Formula" for the string is:
+
+`Dark Color #`
+
+or
+
+`Light Color #`
+
+Color can be Blue, Green, Black, Gray, Purple, Brown, Teal, Red. The # is optional or can be from 1 to XX. Some colors have a lot of choices. There are 13 "Light Brown" choices for example.
+
+### "System" Default - No Colors
+
+If you're bent on having no colors at all in your window, then choose `Default 1` or `System Default 1`.
+
+If you want the original PySimpleGUI color scheme of a blue button and everything else gray then you can get that with the theme `Default` or `System Default`.
+
+
+## Theme Functions
+
+The basic theme function call is `theme(theme_name)`. This sets the theme. Calling without a parameter, `theme()` will return the name of the current theme.
+
+If you want to get or modify any of the theme settings, you can do it with these functions that you will find detailed information about in the function definitions section at the bottom of the document. Each will return the current value if no parameter is used.
+
+```python
+theme_background_color
+theme_border_width
+theme_button_color
+theme_element_background_color
+theme_element_text_color
+theme_input_background_color
+theme_input_text_color
+theme_progress_bar_border_width
+theme_progress_bar_color
+theme_slider_border_width
+theme_slider_color
+theme_text_color
+```
+
+These will help you get a list of available choices.
+
+```python
+theme_list
+theme_previewer
+```
+
+
# Window Object - Beginning a window
The first step is to create the window object using the desired window customizations.
@@ -1410,7 +1502,7 @@ Here is our final program that uses simple addition to add the headers onto the
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Brown 1')
+sg.theme('Dark Brown 1')
headings = ['HEADER 1', 'HEADER 2', 'HEADER 3','HEADER 4']
header = [[sg.Text(' ')] + [sg.Text(h, size=(14,1)) for h in headings]]
@@ -1575,11 +1667,74 @@ You will find information on Elements and all other classes and functions are lo
- Stretch (Qt only)
- Sizer (plain PySimpleGUI only)
+## Keys
+
+***Keys are a super important concept to understand in PySimpleGUI.***
+
+If you are going to do anything beyond the basic stuff with your GUI, then you need to understand keys.
+
+You can think of a "key" as a "name" for an element. Or an "identifier". It's a way for you to identify and talk about an element with the PySimpleGUI library. It's the exact same kind of key as a dictionary key. They must be unique to a window.
+
+Keys are specified when the Element is created using the `key` parameter.
+
+Keys are used in these ways:
+* Specified when creating the element
+* Returned as events. If an element causes an event, its key will be used
+* In the `values` dictionary that is returned from `window.read()`
+* To make updates (changes), to an element that's in the window
+
+
+After you put a key in an element's definition, the values returned from `window.read` will use that key to tell you the value. For example, if you have an input element in your layout:
+
+`Input(key='mykey')`
+
+And your read looks like this: `event, values = Read()`
+
+Then to get the input value from the read it would be: `values['mykey']`
+
+You also use the same key if you want to call Update on an element. Please see the section Updating Elements to understand that usage. To get find an element object given the element's key, you can call the window method `find_element` (also written `FindElement`, `element`), or you can use the more common lookup mechanism:
+
+```python
+window['key']
+```
+
+While you'll often see keys written as strings in examples in this document, know that keys can be ***ANYTHING***.
+
+Let's say you have a window with a grid of input elements. You could use their row and column location as a key (a tuple)
+
+`key=(row, col)`
+
+Then when you read the `values` variable that's returned to you from calling `Window.read()`, the key in the `values` variable will be whatever you used to create the element. In this case you would read the values as:
+`values[(row, col)]`
+
+Most of the time they are simple text strings. In the Demo Programs, keys are written with this convention:
+`_KEY_NAME_` (underscore at beginning and end with all caps letters) or the most recent convention is to use a dash at the beginning and end (e.g. `'-KEY_NAME-'`). You don't have to follow the convention, but it's not a bad one to follow as other users are used to seeing this format and it's easy to spot when element keys are being used.
+
+If you have an element object, to find its key, access the member variable `.Key` for the element. This assumes you've got the element in a variable already.
+
+```python
+text_elem = sg.Text('', key='-TEXT-')
+
+the_key = text_elem.Key
+```
+
+### Default Keys
+
+If you fail to place a key on an Element, then one will be created for you automatically.
+
+For `Buttons`, the text on the button is that button's key. `Text` elements will default to the text's string (for when events are enabled and the text is clicked)
+
+If the element is one of the input elements (one that will cause an generate an entry in the return values dictionary) and you fail to specify one, then a number will be assigned to it beginning with the number 0. The effect will be as if the values are represented as a list even if a dictionary is used.
+
+### Menu Keys
+
+Menu items can have keys associated with them as well. See the section on Menus for more information about these special keys. They aren't the same as Element keys. Like all elements, Menu Element have one of these Element keys. The individual menu item keys are different.
+
## Common Element Parameters
Some parameters that you will see on almost all Element creation calls include:
-- key - Used with window.FindElement and with return values
+- key - Used with window[key], events, and in return value dictionary
- tooltip - Hover your mouse over the elemnt and you'll get a popup with this text
- size - (width, height) - usually measured in characters-wide, rows-high. Sometimes they mean pixels
- font - specifies the font family, size, etc
@@ -1657,34 +1812,7 @@ To specify an underlined, Helvetica font with a size of 15 the values:
#### Key
-If you are going to do anything beyond the basic stuff with your GUI, then you need to understand keys.
-Keys are a way for you to "tag" an Element with a value that will be used to identify that element. After you put a key in an element's definition, the values returned from Read will use that key to tell you the value. For example, if you have an input field:
-
-`Input(key='mykey')`
-
-And your read looks like this: `event, values = Read()`
-
-Then to get the input value from the read it would be: `values['mykey']`
-
-You also use the same key if you want to call Update on an element. Please see the section below on Updates to understand that usage.
-
-Keys can be ANYTHING. Let's say you have a window with a grid of input elements. You could use their row and column location as a key (a tuple)
-
-`key=(row, col)`
-
-Then when you read the `values` variable that's returned to you from calling `Window.Read()`, the key in the `values` variable will be whatever you used to create the element. In this case you would read the values as:
-`values[(row, col)]`
-
-Most of the time they are simple text strings. In the Demo Programs, keys are written with this convention:
-`_KEY_NAME_` (underscore at beginning and end with all caps letters) or '-KEY_NAME-. You don't have to follow that convention. It's used so that you can quickly spot when a key is being used.
-
-To find an element's key, access the member variable `.Key` for the element. This assumes you've got the element in a variable already.
-
-```python
-text_elem = sg.Text('', key='-TEXT-')
-
-the_key = text_elem.Key
-```
+See the section above that has full information about keys.
#### Visible
@@ -1718,7 +1846,7 @@ In other words, I am lazy and don't like to type. The result is multiple ways to
This enables you to code much quicker once you are used to using the SDK. The Text Element, for example, has 3 different names `Text`, `Txt` or`T`. InputText can also be written `Input` or `In` .
-The shortcuts aren't limited to Elements. The `Window` method `Window.FindElement` can be written as `Window.Element` because it's such a commonly used function. BUT,even that has now been shortened.
+The shortcuts aren't limited to Elements. The `Window` method `Window.FindElement` can be written as `Window.Element` because it's such a commonly used function. BUT, even that has now been shortened to `window[key]`
It's an ongoing thing. If you don't stay up to date and one of the newer shortcuts is used, you'll need to simply rename that shortcut in the code. For examples Replace sg.T with sg.Text if your version doesn't have sg.T in it.
@@ -1748,27 +1876,27 @@ With proportional spaced fonts (normally the default) the pixel size of one set
---
-## `Window.FindElement(key)` Shortcut `Window[key]`
+## `Window.FindElement(key)` shortened to `Window[key]`
There's been a fantastic leap forward in making PySimpleGUI code more compact.
Instead of writing:
```python
-window.FindElement(key).Update(new_value)
+window.FindElement(key).update(new_value)
```
You can now write it as:
```python
-window[key].Update(new_value)
+window[key].update(new_value)
```
This change has been released to PyPI for PySimpleGUI
-MANY Thanks is owed to the person that suggested and showed me how to do this. It's an incredible find.
+MANY Thanks is owed to the nngogol that suggested and showed me how to do this. It's an incredible find as have been many of his suggestions.
-## `Element.Update()` -> `Element()` shortcut
+## `Element.update()` -> `Element()` shortcut
This has to be one of the strangest syntactical contructs I've ever written.
@@ -1821,7 +1949,7 @@ layout = [[graph_element]]
.
.
.
-graph_element(background_color='blue') # this calls Graph.Update for the previously defined element
+graph_element(background_color='blue') # this calls Graph.update for the previously defined element
```
Hopefully this isn't too confusing. Note that the methods these shortcuts replace will not be removed. You can continue to use the old constructs without changes.
@@ -1842,9 +1970,9 @@ Individual colors are specified using either the color names as defined in tkint
### `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.
-`Text('', key='_TXTOUT_)` will create a `Text` Element that has 0 length. 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. 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('', 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.
### Chortcut functions
@@ -2575,7 +2703,7 @@ The order of operations to obtain a tkinter Canvas Widget is:
# add the plot to the window
- fig_photo = draw_figure(window.FindElement('canvas').TKCanvas, fig)
+ fig_photo = draw_figure(window['canvas'].TKCanvas, fig)
# show it all again and get buttons
event, values = window.read()
@@ -2846,11 +2974,11 @@ to this... with one function call...

-While you can do it on an element by element or window level basis, the easiest way, by far, is a call to `SetOptions`.
+While you can do it on an element by element or window level basis, the easier way is to use either the `theme` calls or `set_options`. These calls will set colors for all window that are created.
-Be aware that once you change these options they are changed for the rest of your program's execution. All of your windows will have that look and feel, until you change it to something else (which could be the system default colors.
+Be aware that once you change these options they are changed for the rest of your program's execution. All of your windows will have that Theme, until you change it to something else.
-This call sets all of the different color options.
+This call sets a number of the different color options.
```python
SetOptions(background_color='#9FB8AD',
@@ -2864,21 +2992,32 @@ SetOptions(background_color='#9FB8AD',
# SystemTray
-This is a PySimpleGUIQt and PySimpleGUIWx only feature. Don't know of a way to do it using tkinter. Your source code for SystemTray is identical for the Qt and Wx implementations. You can switch frameworks by simply changing your import statement.
-In addition to running normal windows, it's now also possible to have an icon down in the system tray that you can read to get menu events. There is a new SystemTray object that is used much like a Window object. You first get one, then you perform Reads in order to get events.
+In addition to running normal windows, it's now also possible to have an icon down in the system tray that you can read to get menu events. There is a new SystemTray object that is used much like a Window object. You first get one, then you perform Reads in order to get events.
+
+## Tkinter version
+
+While only PySimpleGUIQt and PySimpleGUIWx offer a true "system tray" feature, there is a simulated system tray feature that became available in 2020 for the tkinter version of PySimpleGUI. All of the same objects and method calls are the same and the effect is very similar to what you see with the Wx and Qt versions. The icon is placed in the bottom right corner of the window. Setting the location of it has not yet been exposed, but you can drag it to another location on your screen.
+
+The idea of supporting Wx, Qt, and tkinter with the exact same source code is very appealing and is one of the reasons a tkinter version was developed. You can switch frameworks by simply changing your import statement to any of those 3 ports.
+
+The balloons shown for the tkinter version is different than the message balloons shown by real system tray icons. Instead a nice semi-transparent window is shown. This window will fade in / out and is the same design as the one found in the [ptoaster package](https://github.com/PySimpleGUI/ptoaster).
+
+## SystemTray Object
Here is the definition of the SystemTray object.
```python
-SystemTray(menu=None, filename=None, data=None, data_base64=None, tooltip=None):
+SystemTray(menu=None, filename=None, data=None, data_base64=None, tooltip=None, metadata=None):
'''
SystemTray - create an icon in the system tray
:param menu: Menu definition
:param filename: filename for icon
:param data: in-ram image for icon
:param data_base64: basee-64 data for icon
- :param tooltip: tooltip string '''
+ :param tooltip: tooltip string
+ :param metadata: (Any) User metadata that can be set to ANYTHING
+'''
```
You'll notice that there are 3 different ways to specify the icon image. The base-64 parameter allows you to define a variable in your .py code that is the encoded image so that you do not need any additional files. Very handy feature.
@@ -2889,26 +3028,31 @@ Here is a design pattern you can use to get a jump-start.
This program will create a system tray icon and perform a blocking Read. If the item "Open" is chosen from the system tray, then a popup is shown.
+The same code can be executed on any of the Desktop versions of PySimpleGUI (tkinter, Qt, WxPython)
```python
import PySimpleGUIQt as sg
+# import PySimpleGUIWx as sg
+# import PySimpleGUI as sg
menu_def = ['BLANK', ['&Open', '---', '&Save', ['1', '2', ['a', 'b']], '&Properties', 'E&xit']]
tray = sg.SystemTray(menu=menu_def, filename=r'default_icon.ico')
while True: # The event loop
- menu_item = tray.Read()
+ menu_item = tray.read()
print(menu_item)
if menu_item == 'Exit':
break
elif menu_item == 'Open':
- sg.Popup('Menu item chosen', menu_item)
+ sg.popup('Menu item chosen', menu_item)
```
The design pattern creates an icon that will display this menu:

-### Icons
+### Icons for System Trays
+
+System Tray Icons are in PNG & GIF format when running on PySimpleGUI (tkinter version). PNG, GIF, and ICO formats will work for the Wx and Qt ports.
When specifying "icons", you can use 3 different formats.
* `filename`- filename
@@ -2917,6 +3061,13 @@ When specifying "icons", you can use 3 different formats.
You will find 3 parameters used to specify these 3 options on both the initialize statement and on the Update method.
+For testing you may find using the built-in PySimpleGUI icon is a good place to start to make sure you've got everything coded correctly before bringing in outside image assets. It'll tell you quickly if you've got a problem with your icon file. To run using the default icon, use something like this to create the System Tray:
+
+```python
+tray = sg.SystemTray(menu=menu_def, data_base64=sg.DEFAULT_BASE64_ICON)
+```
+
+
## Menu Definition
```python
menu_def = ['BLANK', ['&Open', '&Save', ['1', '2', ['a', 'b']], '!&Properties', 'E&xit']]
@@ -3055,6 +3206,24 @@ Update(menu=None, tooltip=None,filename=None, data=None, data_base64=None,)
```
-->
+### Notify Class Method
+
+In addition to being able to show messages via the system tray, the tkinter port has the added capability of being able to display the system tray messages without having a system tray object defined. You can simply show a notification window. This perhaps removes the need for using the ptoaster package?
+
+The method is a "class method" which means you can call it directly without first creating an instanciation of the object. To show a notification window, call `SystemTray.notify`.
+
+This line of code
+
+```python
+sg.SystemTray.notify('Notification Title', 'This is the notification message')
+```
+
+Will show this window, fading it in and out:
+
+
+
+This is a blocking call so expect it to take a few seconds if you're fading the window in and out. There are options to control the fade, how long things are displayed, the alpha channel, etc. See the call signature at the end of this document.
+
# Global Settings
@@ -3074,16 +3243,16 @@ Each lower level overrides the settings of the higher level. Once settings have
# Persistent windows (Window stays open after button click)
-Apologies that the next few pages are perhaps confusing. There have been a number of changes recently in PySimpleGUI's Read calls that added some really cool stuff, but at the expense of being not so simple. Part of the issue is an attempt to make sure existing code doesn't break. These changes are all in the area of non-blocking reads and reads with timeouts.
+Early versions of PySimpleGUI did not have a concept of "persisent window". Once a user clicked a button, the window would close. After some time, the functionality was expanded so that windows remained open by default.
-There are 2 ways to keep a window open after the user has clicked a button. One way is to use non-blocking windows (see the next section). The other way is to use buttons that 'read' the window instead of 'close' the window when clicked. The typical buttons you find in windows, including the shortcut buttons, close the window. These include OK, Cancel, Submit, etc. The Button Element also closes the window.
-The `RButton` Element creates a button that when clicked will return control to the user, but will leave the window open and visible. This button is also used in Non-Blocking windows. The difference is in which call is made to read the window. The normal `Read` call with no parameters will block, a call with a `timeout` value of zero will not block.
-
-Note that `InputText` and `MultiLine` Elements will be **cleared** when performing a `Read`. If you do not want your input field to be cleared after a `Read` then you can set the `do_not_clear` parameter to True when creating those elements. The clear is turned on and off on an element by element basis.
+## Input Fields that Auto-clear
+Note that `InputText` and `MultiLine` Elements can be **cleared** when performing a `read`. If you want your input field to be cleared after a `window.read` then you can set the `do_not_clear` parameter to False when creating those elements. The clear is turned on and off on an element by element basis.
The reasoning behind this is that Persistent Windows are often "forms". When "submitting" a form you want to have all of the fields left blank so the next entry of data will start with a fresh window. Also, when implementing a "Chat Window" type of interface, after each read / send of the chat data, you want the input field cleared. Think of it as a Texting application. Would you want to have to clear your previous text if you want to send a second text?
+## Basic Persistent Window Design Pattern
+
The design pattern for Persistent Windows was already shown to you earlier in the document... here it is for your convenience.
```python
@@ -3097,17 +3266,19 @@ window = sg.Window('Window that stays open', layout)
while True:
event, values = window.read()
- if event is None or event == 'Exit':
- break
print(event, values)
+ if event in (None, 'Exit'):
+ break
-window.Close()
+window.close()
```
-## Read(timeout = t, timeout_key=TIMEOUT_KEY)
+## Read(timeout = t, timeout_key=TIMEOUT_KEY, close=False)
-Read with a timeout is a very good thing for your GUIs to use in a read non-blocking situation, you can use them. If your device can wait for a little while, then use this kind of read. The longer you're able to add to the timeout value, the less CPU time you'll be taking.
+Read with a timeout is a very good thing for your GUIs to use in a non-blocking read situation. If your device can wait for a little while, then use this kind of read. The longer you're able to add to the timeout value, the less CPU time you'll be taking.
+
+The idea to wait for some number of milliseconds before returning. It's a trivial way to make a window that runs on a periodic basis.
One way of thinking of reads with timeouts:
> During the timeout time, you are "yielding" the processor to do other tasks.
@@ -3121,49 +3292,32 @@ Let's say you had a device that you want to "poll" every 100ms. The "easy way
while True: # Event Loop
event, values = window.ReadNonBlocking() # DO NOT USE THIS CALL ANYMORE
read_my_hardware() # process my device here
- time.sleep(.1) # sleep 1/10 second
+ time.sleep(.1) # sleep 1/10 second DO NOT PUT SLEEPS IN YOUR EVENT LOOP!
```
-This program will quickly test for user input, then deal with the hardware. Then it'll sleep for 100ms, while your gui is non-responsive, then it'll check in with your GUI again. I fully realize this is a crude way of doing things. We're talking dirt simple stuff without trying to use threads, etc to 'get it right'. It's for demonstration purposes.
+This program will quickly test for user input, then deal with the hardware. Then it'll sleep for 100ms, while your gui is non-responsive, then it'll check in with your GUI again.
-The new and better way....
-using the Read Timeout mechanism, the sleep goes away.
+The better way using PySimpleGUI... using the Read Timeout mechanism, the sleep goes away.
```python
# This is the right way to poll for hardware
while True: # Event Loop
- event, values = window.Read(timeout = 100)
+ event, values = window.read(timeout = 100)
read_my_hardware() # process my device here
```
-This event loop will run every 100 ms. You're making a Read call, so anything that the use does will return back to you immediately, and you're waiting up to 100ms for the user to do something. If the user doesn't do anything, then the read will timeout and execution will return to the program.
-
-
-## Non-Blocking Windows (Asynchronous reads, timeouts)
-
-You can easily spot a non-blocking call in PySimpleGUI. If you see a call to `Window.Read()` with a timeout parameter set to a value other than `None`, then it is a non-blocking call.
-
-This call to read is asynchronous as it has a timeout value:
-
-```
-The new way
-```python
-event, values = sg.Read(timeout=20)
-```
-You should use the new way if you're reading this for the first time.
-
-The difference in the 2 calls is in the value of event. For ReadNonBlocking, event will be `None` if there are no other events to report. There is a "problem" with this however. With normal Read calls, an event value of None signified the window was closed. For ReadNonBlocking, the way a closed window is returned is via the values variable being set to None.
+This event loop will run every 100 ms. You're making a `read` call, so anything that the use does will return back to you immediately, and you're waiting up to 100ms for the user to do something. If the user doesn't do anything, then the read will timeout and execution will return to the program.
## sg.TIMEOUT_KEY
-If you're using the new, timeout=0 method, then an event value of None signifies that the window was closed, just like a normal Read. That leaves the question of what it is set to when not other events are happening. This value will be the value of `timeout_key`. If you did not specify a timeout_key value in your call to read, then it will be set to a default value of:
+If you're using a read with a timeout value, then an event value of None signifies that the window was closed, just like a normal `window.read`. That leaves the question of what it is set to when not other events are happening. This value will be the value of `TIMEOUT_KEY`. If you did not specify a timeout_key value in your call to read, then it will be set to a default value of:
`TIMEOUT_KEY = __timeout__`
If you wanted to test for "no event" in your loop, it would be written like this:
```python
while True:
- event, value = window.Read(timeout=0)
+ event, value = window.Read(timeout=10)
if event is None:
break # the use has closed the window
if event == sg.TIMEOUT_KEY:
@@ -3173,7 +3327,15 @@ while True:
Use async windows sparingly. It's possible to have a window that appears to be async, but it is not. **Please** try to find other methods before going to async windows. The reason for this plea is that async windows poll tkinter over and over. If you do not have a timeout in your Read and you've got nothing else your program will block on, then you will eat up 100% of the CPU time. It's important to be a good citizen. Don't chew up CPU cycles needlessly. Sometimes your mouse wants to move ya know?
-Non-blocking (timeout=0) is generally reserved as a "last resort". Too many times people use non-blocking reads when a blocking read will do just fine.
+### `read(timeout=0)`
+
+You may find some PySimpleGUI programs that set the timeout value to zero. This is a very dangerous thing to do. If you do not pend on something else in your event loop, then your program will consume 100% of your CPU. Remember that today's CPUs are multi-cored. You may see only 7% of your CPU is busy when you're running with timeout of 0. This is because task manager is reporting a system-wide CPU usage. The single core your program is running on is likely at 100%.
+
+A true non-blocking (timeout=0) read is generally reserved as a "last resort". Too many times people use non-blocking reads when a blocking read will do just fine or a read with a timeout would work.
+
+It's valid to use a timeout value of zero if you're in need of every bit of CPU horsepower in your application. Maybe your loop is doing something super-CPU intensive and you can't afford for the GUI to use any CPU time. This is the kind of situation where a timeout of zero is appropriate.
+
+Be a good computing citizen. Run with a non-zero timeout so that other programs on your CPU will have time to run.
### Small Timeout Values (under 10ms)
@@ -3202,12 +3364,38 @@ There are 2 methods of interacting with non-blocking windows.
## Exiting (Closing) a Persistent Window
-If your window has a button that closes the window, then PySimpleGUI will automatically close the window for you. If all of your buttons are ReadButtons, then it'll be up to you to close the window when done.
-To close a window, call the `Close` method.
+If your window has a special button that closes the window, then PySimpleGUI will automatically close the window for you. If all of your buttons are normal `Button` elements, then it'll be up to you to close the window when done.
+
+To close a window, call the `close` method.
```python
-window.Close()
+window.close()
```
+Beginning in version 4.16.0 you can use a `close` parameter in the `window.read` call to indicate that the window should be closed before returning from the read. This capability to an excellent way to make a single line Window to quickly get information.
+
+This single line of code will display a window, get the user's input, close the window, and return the values as an event and a values dictionary.
+
+```python
+event, values = sg.Window('Login Window',
+ [[sg.T('Enter your Login ID'), sg.In(key='-ID-')],
+ [sg.B('OK'), sg.B('Cancel') ]]).read(close=True)
+
+login_id = values['-ID-']
+```
+
+You can also make a custom popup quite easily:
+
+```python
+long_string = '123456789 '* 40
+
+event, values = sg.Window('This is my customn popup',
+ [[sg.Text(long_string, size=(40,None))],
+ [sg.B('OK'), sg.B('Cancel') ]]).read(close=True)
+```
+
+Notice the height parameter of size is `None` in this case. For the tkinter port of PySimpleGUI this will cause the number of rows to "fit" the contents of the string to be displayed.
+
+
## Persistent Window Example - Running timer that updates
See the sample code on the GitHub named Demo Media Player for another example of Async windows. We're going to make a window and update one of the elements of that window every .01 seconds. Here's the entire code to do that.
@@ -3237,7 +3425,7 @@ while (True):
event, values = window.Read(timeout=10)
current_time = int(round(time.time() * 100)) - start_time
# --------- Display timer in window --------
- window.FindElement('text').Update('{:02d}:{:02d}.{:02d}'.format((current_time // 100) // 60,
+ window['text'].update('{:02d}:{:02d}.{:02d}'.format((current_time // 100) // 60,
(current_time // 100) % 60,
current_time % 100))
```
@@ -3265,14 +3453,14 @@ One example is you have an input field that changes as you press buttons on an o
If you want to change an Element's settings in your window after the window has been created, then you will call the Element's Update method.
-**NOTE** a window **must be Read or Finalized** before any Update calls can be made. Also, not all settings available to you when you created the Element are available to you via its `Update` method.
+**NOTE** a window **must be Read or Finalized** before any Update calls can be made. Also, not all settings available to you when you created the Element are available to you via its `update` method.
Here is an example of updating a Text Element
```python
import PySimpleGUI as sg
-layout = [ [sg.Text('My layout', key='_TEXT_')],
+layout = [ [sg.Text('My layout', key='-TEXT-')],
[sg.Button('Read')]]
window = sg.Window('My new window', layout)
@@ -3281,7 +3469,7 @@ while True: # Event Loop
event, values = window.read()
if event is None:
break
- window.Element('_TEXT_').Update('My new text value')
+ window['-TEXT-'].update('My new text value')
```
Notice the placement of the Update call. If you wanted to Update the Text Element *prior* to the Read call, outside of the event loop, then you must call Finalize on the window first.
@@ -3290,13 +3478,12 @@ In this example, the Update is done prior the Read. Because of this, the Finali
```python
import PySimpleGUI as sg
-layout = [ [sg.Text('My layout', key='_TEXT_')],
- [sg.Button('Read')]
- ]
+layout = [ [sg.Text('My layout', key='-TEXT-')],
+ [sg.Button('Read')]]
-window = sg.Window('My new window', layout).Finalize()
+window = sg.Window('My new window', layout, finalize=True)
-window.Element('_TEXT_').Update('My new text value')
+window['-TEXT-'].update('My new text value')
while True: # Event Loop
event, values = window.read()
@@ -3348,9 +3535,9 @@ while True:
if sz != fontSize:
fontSize = sz
font = "Helvetica " + str(fontSize)
- window.FindElement('text').Update(font=font)
- window.FindElement('slider').Update(sz)
- window.FindElement('spin').Update(sz)
+ window['text'].update(font=font)
+ window['slider'].update(sz)
+ window['spin'].update(sz)
print("Done.")
```
@@ -3362,21 +3549,21 @@ For example, `values['slider']` is the value of the Slider Element.
This program changes all 3 elements if either the Slider or the Spinner changes. This is done with these statements:
```python
-window.FindElement('text').Update(font=font)
-window.FindElement('slider').Update(sz)
-window.FindElement('spin').Update(sz)
+window['text'].update(font=font)
+window['slider'].update(sz)
+window['spin'].update(sz)
```
Remember this design pattern because you will use it OFTEN if you use persistent windows.
-It works as follows. The call to `window.FindElement` returns the Element object represented by they provided `key`. This element is then updated by calling it's `Update` method. This is another example of Python's "chaining" feature. We could write this code using the long-form:
+It works as follows. The expresion `window[key]` returns the Element object represented by the provided `key`. This element is then updated by calling it's `update` method. This is another example of Python's "chaining" feature. We could write this code using the long-form:
- text_element = window.FindElement('text')
- text_element.Update(font=font)
+ text_element = window['text']
+ text_element.update(font=font)
-The takeaway from this exercise is that keys are key in PySimpleGUI's design. They are used to both read the values of the window and also to identify elements. As already mentioned, they are used as targets in Button calls.
+The takeaway from this exercise is that keys are key in PySimpleGUI's design. They are used to both read the values of the window and also to identify elements. As already mentioned, they are used in a wide variety of places.
-### Locating Elements (FindElement == Element == Elem)
+### Locating Elements (FindElement == Element == Elem == [ ])
The Window method call that's used to find an element is:
`FindElement`
@@ -3385,13 +3572,15 @@ or the shortened version
or even shorter (version 4.1+)
`Elem`
-When you see a call to window.FindElement or window.Element, then you know an element is being addressed. Normally this is done so you can call the element's Update method.
+And now it's finally shortened down to:
+window[key]
+You'll find the pattern - `window.Element(key)` in older code. All of code after about 4.0 uses the shortened `window[key]` notation.
### ProgressBar / Progress Meters
-Note that to change a progress meter's progress, you call `UpdateBar`, not `Update`.
+Note that to change a progress meter's progress, you call `update_bar`, not `update`. A change to this is being considered for a future release.
# Keyboard & Mouse Capture
@@ -3431,7 +3620,7 @@ while True:
if event == "OK" or event is None:
print(event, "exiting")
break
- text_elem.Update(event)
+ text_elem.update(event)
```
You want to turn off the default focus so that there no buttons that will be selected should you press the spacebar.
@@ -3581,7 +3770,7 @@ import PySimpleGUI as sg
layout = [[ sg.Text('Window 1'),],
[sg.Input(do_not_clear=True)],
- [sg.Text(size=(15,1), key='_OUTPUT_')],
+ [sg.Text(size=(15,1), key='-OUTPUT-')],
[sg.Button('Launch 2'), sg.Button('Exit')]]
win1 = sg.Window('Window 1', layout)
@@ -3589,7 +3778,7 @@ win1 = sg.Window('Window 1', layout)
win2_active = False
while True:
ev1, vals1 = win1.Read(timeout=100)
- win1.FindElement('_OUTPUT_').Update(vals1[0])
+ win1['-OUTPUT-'].update(vals1[0])
if ev1 is None or ev1 == 'Exit':
break
@@ -3617,7 +3806,7 @@ import PySimpleGUIQt as sg
layout = [[ sg.Text('Window 1'),],
[sg.Input(do_not_clear=True)],
- [sg.Text(size=(15,1), key='_OUTPUT_')],
+ [sg.Text(size=(15,1), key='-OUTPUT-')],
[sg.Button('Launch 2')]]
win1 = sg.Window('Window 1', layout)
@@ -3626,7 +3815,7 @@ while True:
ev1, vals1 = win1.Read(timeout=100)
if ev1 is None:
break
- win1.FindElement('_OUTPUT_').Update(vals1[0])
+ win1.FindElement('-OUTPUT-').update(vals1[0])
if ev1 == 'Launch 2' and not win2_active:
win2_active = True
@@ -4049,7 +4238,7 @@ Three events are being bound.
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Green 2')
+sg.theme('Dark Green 2')
layout = [ [sg.Text('My Window')],
[sg.Input(key='-IN-'), sg.Text(size=(15,1), key='-OUT-')],
@@ -4091,2362 +4280,1835 @@ This section of the documentation is generated directly from the source code. A
Without further delay... here are all of the Elements and the Window class
-## Button Element
-
+## Button Element
-
### Click
-
### GetText
-
### SetFocus
-
### SetTooltip
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
-
### click
-
### expand
-
### get_size
-
### get_text
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## ButtonMenu Element
-
+## ButtonMenu Element
-### ButtonReboundCallback
-
-
-
### Click
-
### SetFocus
-
### SetTooltip
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## Canvas Element
-
+## Canvas Element
-### ButtonReboundCallback
-
-
-
### SetFocus
-
### SetTooltip
-
### TKCanvas
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
### tk_canvas
-
-### unhide_row
+### unbind
+
+### unhide_row
-## Checkbox Element
-
+## Checkbox Element
-### ButtonReboundCallback
-
-
-
### Get
-
### SetFocus
-
### SetTooltip
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## Column Element
-
+## Column Element
+### AddRow
+
-### ButtonReboundCallback
-
-
+### Layout
+
### SetFocus
-
### SetTooltip
-
### Update
-
### add_row
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get_size
-
### hide_row
-
### layout
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## Combo Element
-
+## Combo Element
-### ButtonReboundCallback
-
-
-
### Get
-
### SetFocus
-
### SetTooltip
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## Frame Element
+## Frame Element
+### AddRow
+
-### ButtonReboundCallback
-
-
-
+### Layout
+
### SetFocus
-
### SetTooltip
-
### Update
-
+### add_row
+
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get_size
-
### hide_row
-
+### layout
+
+
+### set_cursor
+
### set_focus
-
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## Graph Element
-
+## Graph Element
### BringFigureToFront
-
-### ButtonPressCallBack
-
-
-
-### ButtonReboundCallback
-
-
-
### DeleteFigure
-
### DrawArc
-
### DrawCircle
-
### DrawImage
-
### DrawLine
-
### DrawOval
-
### DrawPoint
-
-### DrawRectangle
+### DrawPolygon
+
+### DrawRectangle
### DrawText
-
### Erase
-
-
### GetBoundingBox
-
### GetFiguresAtLocation
-
### Move
-
### MoveFigure
-
### RelocateFigure
-
### SendFigureToBack
-
### SetFocus
-
### SetTooltip
-
### TKCanvas
-
### Update
-
### bind
-
### bring_figure_to_front
-
-### button_press_call_back
-
-
-
-### button_rebound_callback
-
-
-
+### change_coordinates
+
### delete_figure
-
### draw_arc
-
### draw_circle
-
### draw_image
-
### draw_line
-
### draw_oval
-
### draw_point
-
-### draw_rectangle
+### draw_polygon
+
+### draw_rectangle
### draw_text
-
### erase
-
### expand
-
-
-
### get_bounding_box
-
### get_figures_at_location
-
-
### get_size
-
### hide_row
-
### move
-
### move_figure
-
### relocate_figure
-
### send_figure_to_back
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
### tk_canvas
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## Image Element
-
+## Image Element
-### ButtonReboundCallback
-
-
-
### SetFocus
-
### SetTooltip
-
### Update
-
### UpdateAnimation
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
### update_animation
-
-## InputText Element
+### update_animation_no_buffering
+
+## InputText Element
-### ButtonReboundCallback
-
-
-
### Get
-
### SetFocus
-
### SetTooltip
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## Listbox Element
-
+## Listbox Element
-### ButtonReboundCallback
-
-
-
### GetIndexes
-
### GetListValues
-
### SetFocus
-
### SetTooltip
-
### SetValue
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
-### get_indexes
+### get
+
+### get_indexes
### get_list_values
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
### set_value
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## Menu Element
-
+## Menu Element
-### ButtonReboundCallback
-
-
-
### SetFocus
-
### SetTooltip
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## Multiline Element
-
+## Multiline Element
-### ButtonReboundCallback
-
-
-
### Get
-
### SetFocus
-
### SetTooltip
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get
-
### get_size
-
### hide_row
-
-### set_focus
+### print
+
+### set_cursor
+
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## OptionMenu Element
-
+## OptionMenu Element
-### ButtonReboundCallback
-
-
-
### SetFocus
-
### SetTooltip
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
### expand
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## Output Element
-
+## Output Element
-### ButtonReboundCallback
-
-
-
### Get
-
### SetFocus
-
### SetTooltip
-
### TKOut
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
### tk_out
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## Pane Element
-
+## Pane Element
-### ButtonReboundCallback
-
-
-
### SetFocus
-
### SetTooltip
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## ProgressBar Element
-
+## ProgressBar Element
-### ButtonReboundCallback
-
-
-
### SetFocus
-
### SetTooltip
-
### Update
-
### UpdateBar
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
### update_bar
-
-
-## Radio Element
-
+## Radio Element
-### ButtonReboundCallback
-
-
-
### Get
-
### ResetGroup
-
### SetFocus
-
### SetTooltip
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get
-
### get_size
-
### hide_row
-
### reset_group
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## Slider Element
-
+## Slider Element
-### ButtonReboundCallback
-
-
-
### SetFocus
-
### SetTooltip
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## Spin Element
-
+## Spin Element
-### ButtonReboundCallback
-
-
-
### Get
-
### SetFocus
-
### SetTooltip
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## StatusBar Element
-
+## StatusBar Element
-### ButtonReboundCallback
-
-
-
### SetFocus
-
### SetTooltip
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## Tab Element
+## SystemTray Element
+
+
+### Close
+
+
+### Hide
+
+
+### Read
+
+
+### ShowMessage
+
+
+### UnHide
+
+
+### Update
+
+
+### close
+
+
+### hide
+
+
+### notify
+
+
+### read
+
+
+### show_message
+
+
+### un_hide
+
+
+### update
+
+
+## Tab Element
-### ButtonReboundCallback
-
-
-
+### AddRow
+
+### Layout
+
### Select
-
### SetFocus
-
### SetTooltip
-
### Update
-
+### add_row
+
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get_size
-
### hide_row
-
+### layout
+
### select
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## TabGroup Element
-
+## TabGroup Element
-### ButtonReboundCallback
-
-
### FindKeyFromTabName
-
### Get
-
### SetFocus
-
### SetTooltip
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### find_key_from_tab_name
-
### get
-
### get_size
-
### hide_row
-
-### layout
-
+### set_cursor
+
### set_focus
-
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
-## Table Element
-
+## Table Element
-### ButtonReboundCallback
-
-
-
### Get
-
### SetFocus
-
### SetTooltip
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
### expand
-
### get
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
+### unbind
+
### unhide_row
-
### update
-
-## Text Element
-
+## Text Element
-### ButtonReboundCallback
-
-
-
### SetFocus
-
### SetTooltip
-
### Update
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
### update
-
-## ToolTip Element
-
-
-
-
-### enter
-
-
-
-### hidetip
-
-
-
-### leave
-
-
-
-### schedule
-
-
-
-### showtip
-
-
-
-### unschedule
-
-
-
-## Tree Element
+## Tree Element
-### ButtonReboundCallback
-
-
-
### SetFocus
-
### SetTooltip
-
### Update
-
### add_treeview_data
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### treeview_selected
-
-
+### unbind
+
### unhide_row
-
### update
-
-## TreeData Element
-
+## TreeData Element
### Insert
-
### Node
-
### insert
-
-## VerticalSeparator Element
-
+## VerticalSeparator Element
-### ButtonReboundCallback
-
-
-
### SetFocus
-
### SetTooltip
-
### bind
-
-### button_rebound_callback
-
-
-
### expand
-
### get_size
-
### hide_row
-
-### set_focus
+### set_cursor
+
+### set_focus
### set_size
-
### set_tooltip
-
-### unhide_row
+### unbind
+
+### unhide_row
-## Window Element
-
+## Window
### AddRow
-
### AddRows
-
### AlphaChannel
-
### BringToFront
-
### Close
-
-
### CurrentLocation
-
-
### Disable
-
### DisableDebugger
-
### Disappear
-
### Elem
-
### Element
-
### Enable
-
### EnableDebugger
-
### Fill
-
### Finalize
-
### Find
-
### FindElement
-
### FindElementWithFocus
-
-
### GetScreenDimensions
-
### GrabAnyWhereOff
-
### GrabAnyWhereOn
-
### Hide
-
### Layout
-
-
### LoadFromDisk
-
### Maximize
-
### Minimize
-
### Move
-
### Normal
-
-
### Read
-
### Reappear
-
### Refresh
-
### SaveToDisk
-
### SendToBack
-
### SetAlpha
-
### SetIcon
-
### SetTransparentColor
-
### Size
-
### UnHide
-
### VisibilityChanged
-
### add_row
-
### add_rows
-
### alpha_channel
-
### bind
-
### bring_to_front
-
### close
-
### current_location
-
### disable
-
### disable_debugger
-
### disappear
-
### elem
-
### element
-
-### enable
+### element_list
+
+### enable
### enable_debugger
-
-### fill
+### extend_layout
+
+### fill
### finalize
-
### find
-
### find_element
-
### find_element_with_focus
-
### get_screen_dimensions
-
### get_screen_size
-
### grab_any_where_off
-
### grab_any_where_on
-
### hide
-
### layout
-
### load_from_disk
-
### maximize
-
### minimize
-
### move
-
### normal
-
### read
-
-
### reappear
-
### refresh
-
### save_to_disk
-
### send_to_back
-
### set_alpha
-
### set_icon
-
### set_transparent_color
-
### size
-
### un_hide
-
-
### visibility_changed
-
@@ -6490,6 +6152,7 @@ Without further delay... here are all of the Elements and the Window class
+
@@ -6573,18 +6236,25 @@ Without further delay... here are all of the Elements and the Window class
-
-
## Themes
+
+
+
+
+
+
+
+
+
## Old Themes (Look and Feel) - Replaced by theme()
diff --git a/readme_creator/4_Release_notes.md b/readme_creator/4_Release_notes.md
index ab329792..ba42b96c 100644
--- a/readme_creator/4_Release_notes.md
+++ b/readme_creator/4_Release_notes.md
@@ -1038,6 +1038,94 @@ Table and Tree header colors, expanded Graph methods
* Test Harness sets incorrect look and feel on purpose so a random one is chosen
+## 4.14.0 PySimpleGUI 23-Dec-2019
+
+THEMES!
+
+* theme is replacing change_look_and_feel. The old calls will still be usable however
+* LOTS of new theme functions. Search for "theme_" to find them in this documentation. There's a section discussing themes too
+* "Dark Blue 3" is the default theme now. All windows will be colored using this theme unless the user sets another one
+* Removed the code that forced Macs to use gray
+* New element.set_cursor - can now set a cursor for any of the elements. Pass in a cursor string and cursor will appear when mouse over widget
+* Combo - enable setting to any value, not just those in the list
+* Combo - changed how initial value is set
+* Can change the font on tabs by setting font parameter in TabGroup
+* Table heading font now defaults correctly
+* Tree heading font now defaults correctly
+* Renamed DebugWin to _DebugWin to discourage use
+
+
+## 4.15.0 PySimpleGUI 08-Jan-2020
+
+Dynamic Window Layouts! Extend your layouts with `Window.extend_layout`
+Lots of fixes
+
+* Window.extend_layout
+* Graph.change_coordinates - realtime change of coordinate systems for the Graph element
+* theme_text_element_background_color - new function to expose this setting
+* Radio & Checkbox colors changed to be ligher/darker than background
+* Progress bar - allow updates of value > max value
+* Output element does deletes now so that cleanup works. Can use in multiple windows as a result
+* DrawArc (draw_arc) - New width / line width parameter
+* RGB does more error checking, converts types
+* More descriptive errors for find element
+* popup_error used interally now sets keep on top
+* Element Re-use wording changed so that it's clear the element is the problem not the layout when re-use detected
+* Window.Close (Window.close) - fix for not immediately seeing the window disappear on Linux when clicking "X"
+* Window.BringToFront (bring_to_front) - on Windows needed to use topmost to bring window to front insteade of lift
+* Multiline Scrollbar - removed the scrollbar color. It doesn't work on Windows so keeping consistent
+* Changed how Debug Windows are created. Uses finalize now instead of the read non-blocking
+* Fix for Debug Window being closed by X causing main window to also close
+* Changed all "black" and "white" in the Look and Feel table to #000000 and #FFFFFF
+* Added new color processing functions for internal use (hsl and hsv related)
+* popup - extended the automatic wrapping capabilities to messages containing \n
+* Test harness uses a nicer colors for event, value print outs.
+* _timeit decorator for timing functions
+
+
+
+## 4.15.1 PySimpleGUI 09-Jan-2020
+
+Quick patch to remove change to popup
+
+## 4.15.2 PySimpleGUI 15-Jan-2020
+
+Quick patch to remove f-string for 3.5 compat.
+
+
+## 4.16.0 PySimpleGUI 08-Jan-2020
+
+The "LONG time coming" release. System Tray, Read with close + loads more changes
+Note - there is a known problem with the built-in debugger created when the new read with close was added
+
+* System Tray - Simulates the System Tray feature currently in PySimpleGUIWx and PySimpleGUIQt. All calls are the same. The icon is located just above the system tray (bottom right corner)
+* Window.read - NEW close parameter will close the window for you after the read completes. Can make a single line window using this
+* Window.element_list - Returns a list of all elements in the window
+* Element.unbind - can remove a previously created binding
+* Element.set_size - retries using "length" if "height" setting fails
+* Listbox.update - select_mode parameter added
+* Listbox.update - no longer selects the first entry when all values are changed
+* Listbox.get - new. use to get the current values. Will be the same as the read return dictionary
+* Checkbox.update - added ability to change background and text colors. Uses the same combuted checkbox background color (may remove)
+* Multiline.update - fix for when no value is specified
+* Multiline - Check for None when creating. Ignores None rather than converting to string
+* Text.update - added changing value to string. Assumed caller was passing in string previously.
+* Text Element - justification can be specified with a single character. l=left, r=right, c=center. Previously had to fully spell out
+* Input Element - justification can be specified with a single character. l=left, r=right, c=center. Previously had to fully spell out
+* StatusBar Element - justification can be specified with a single character. l=left, r=right, c=center. Previously had to fully spell out
+* Image Element - can specify no image when creating. Previously gave a warning and required filename = '' to indicate nothing set
+* Table Element - justification can be specified as an "l" or "r" instead of full word left/right
+* Tree Element - justification can be specified as an "l" or "r" instead of full word left/right
+* Graph.draw_point - changed to using 1/2 the size rather than size. Set width = 0 so no outline will be drawn
+* Graph.draw_polygon - new drawing method! Can now draw polygons that fill
+* Layout error checking and reporting added for - Frame, Tab, TabGroup, Column, Window
+* Menu - Ability to set the font for the menu items
+* Debug window - fix for problem closing using the "Quit" button
+* print_to_element - print-like call that can be used to output to a Multiline element as if it is an Output element
+
+
+
+
### Upcoming
There will always be overlapping work as the ports will never actually be "complete" as there's always something new that can be built. However there's a definition for the base functionality for PySimpleGUI. This is what is being strived for with the currnt ports that are underway.
diff --git a/readme_creator/OUTPUT.txt b/readme_creator/OUTPUT.txt
new file mode 100644
index 00000000..7db8f6f5
--- /dev/null
+++ b/readme_creator/OUTPUT.txt
@@ -0,0 +1,16233 @@
+# PEP8 Bindings For Methods and Functions
+
+Beginning with release 4.3 of PySimpleGUI, ***all methods and function calls*** have PEP8 equivalents. This capability is only available, for the moment, on the PySimpleGUI tkinter port. It is being added, as quickly as possible, to all of the ports.
+
+As long as you know you're sticking with tkinter for the short term, it's safe to use the new bindings.
+
+## The Non-PEP8 Methods and Functions
+
+Why the need for these bindings? Simply put, the PySimpleGUI SDK has a PEP8 violation in the method and function names. PySimpleGUI uses CamelCase names for methods and functions. PEP8 suggests using snake_case_variables instead.
+
+This has not caused any problems and few complaints, but it's important the the interfaces into PySimpleGUI be compliant. Perhaps one of the reasons for lack of complaints is that the Qt library also uses SnakeCase for its methods. This practice has the effect of labelling a package as being "not Pythonic" and also suggests that ths package was originally used in another language and then ported to Python. This is exactly the situation with Qt. It was written for C++ and the interfaces continue to use C++ conventions.
+
+***PySimpleGUI was written in Python, for Python.*** The reason for the name problem was one of ignorance. The PEP8 convention wasn't understood by the developers when PySimpleGUI was designed and implemented.
+
+You can, and will be able to for some time, use both names. However, at some point in the future, the CamelCase names will disappear. A utility is planned to do the conversion for the developer when the old names are remove from PySimpleGUI.
+
+The help system will work with both names as will your IDE's docstring viewing. However, the result found will show the CamelCase names. For example `help(sg.Window.read)` will show the CamelCase name of the method/function. This is what will be returned:
+
+`Read(self, timeout=None, timeout_key='__TIMEOUT__')`
+
+## The Renaming Convention
+
+To convert a CamelCase method/function name to snake_case, you simply place an `_` where the Upper Case letter is located. If there are none, then only the first letter is changed.
+
+`Window.FindElement` becomes `Window.find_element`
+
+## Class Variables
+
+For the time being, class variables will remain the way they are currently. It is unusual, in PySimpleGUI, for class variables to be modified or read by the user code so the impact of leaving them is rarely seen in your code.
+
+# High Level API Calls - Popup's
+
+"High level calls" are those that start with "Popup". They are the most basic form of communications with the user. They are named after the type of window they create, a pop-up window. These windows are meant to be short lived while, either delivering information or collecting it, and then quickly disappearing.
+
+Think of Popups as your first windows, sorta like your first bicycle. It worked well, but was limited. It probably wasn't long before you wanted more features and it seemed too limiting for your newly found sense of adventure.
+
+When you've reached the point with Popups that you are thinking of filing a GitHub "Enhancement Issue" to get the Popup call extended to include a new feature that you think would be helpful.... not just to you but others is what you had in mind, right? For the good of others.
+
+It's at THIS time that you should immediately turn to the section entitled "Custom Window API Calls - Your First Window". Congratulations, you just graduated and are not an official "GUI Designer". Oh, nevermind that you only started learning Python 2 weeks ago, you're a real GUI Designer now so buck up and start acting like one.
+
+But, for now, let's stick with these 1-line window calls, the Popups.
+
+## Popup Output
+
+Think of the `Popup` call as the GUI equivalent of a `print` statement. It's your way of displaying results to a user in the windowed world. Each call to Popup will create a new Popup window.
+
+`Popup` calls are normally blocking. your program will stop executing until the user has closed the Popup window. A non-blocking window of Popup discussed in the async section.
+
+Just like a print statement, you can pass any number of arguments you wish. They will all be turned into strings and displayed in the popup window.
+
+There are a number of Popup output calls, each with a slightly different look (e.g. different button labels).
+
+The list of Popup output functions are:
+- Popup
+- PopupOk
+- PopupYesNo
+- PopupCancel
+- PopupOkCancel
+- PopupError
+- PopupTimed, PopupAutoClose
+- PopupNoWait, PopupNonBlocking
+
+The trailing portion of the function name after Popup indicates what buttons are shown. `PopupYesNo` shows a pair of button with Yes and No on them. `PopupCancel` has a Cancel button, etc.
+
+While these are "output" windows, they do collect input in the form of buttons. The Popup functions return the button that was clicked. If the Ok button was clicked, then Popup returns the string 'Ok'. If the user clicked the X button to close the window, then the button value returned is `None`.
+
+The function `PopupTimed` or `PopupAutoClose` are popup windows that will automatically close after come period of time.
+
+Here is a quick-reference showing how the Popup calls look.
+
+```python
+sg.Popup('Popup') # Shows OK button
+sg.PopupOk('PopupOk') # Shows OK button
+sg.PopupYesNo('PopupYesNo') # Shows Yes and No buttons
+sg.PopupCancel('PopupCancel') # Shows Cancelled button
+sg.PopupOKCancel('PopupOKCancel') # Shows OK and Cancel buttons
+sg.PopupError('PopupError') # Shows red error button
+sg.PopupTimed('PopupTimed') # Automatically closes
+sg.PopupAutoClose('PopupAutoClose') # Same as PopupTimed
+```
+
+Preview of popups:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Popup - Display a popup Window with as many parms as you wish to include. This is the GUI equivalent of the
+"print" statement. It's also great for "pausing" your program's flow until the user can read some error messages.
+
+```
+Popup(args=*<1 or N object>,
+ title=None,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ button_type=0,
+ auto_close=False,
+ auto_close_duration=None,
+ custom_text=(None, None),
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of your arguments. Load up the call with stuff to see! |
+| str | title | Optional title for the window. If none provided, the first arg will be used instead. |
+| Tuple[str, str] | button_color | Color of the buttons shown (text color, button color) |
+| str | background_color | Window's background color |
+| str | text_color | text color |
+| enum | button_type | NOT USER SET! Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). There are many Popup functions and they call Popup, changing this parameter to get the desired effect. |
+| bool | auto_close | If True the window will automatically close |
+| int | auto_close_duration | time in seconds to keep window open before closing it automatically |
+| Union[Tuple[str, str], str] | custom_text | A string or pair of strings that contain the text to display on the buttons |
+| bool | non_blocking | If True then will immediately return from the function without waiting for the user's input. |
+| Union[str, bytes] | icon | icon to display on the window. Same format as a Window call |
+| int | line_width | Width of lines in characters. Defaults to MESSAGE_BOX_LINE_WIDTH |
+| Union[str, tuple(font name, size, modifiers] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True will not show the frame around the window and the titlebar across the top |
+| bool | grab_anywhere | If True can grab anywhere to move the window. If no_titlebar is True, grab_anywhere should likely be enabled too |
+| Tuple[int, int] | location | Location on screen to display the top left corner of window. Defaults to window centered on screen |
+| Union[str, None] | **RETURN** | Returns text of the button that was pressed. None will be returned if user closed window with X
+
+The other output Popups are variations on parameters. Usually the button_type parameter is the primary one changed.
+
+The other output Popups are variations on parameters. Usually the button_type parameter is the primary one changed.
+
+The choices for button_type are:
+```
+POPUP_BUTTONS_YES_NO
+POPUP_BUTTONS_CANCELLED
+POPUP_BUTTONS_ERROR
+POPUP_BUTTONS_OK_CANCEL
+POPUP_BUTTONS_OK
+POPUP_BUTTONS_NO_BUTTONS
+```
+
+**Note that you should not call Popup yourself with different button_types.** Rely on the Popup function named that sets that value for you. For example PopupYesNo will set the button type to POPUP_BUTTONS_YES_NO for you.
+
+#### Scrolled Output
+There is a scrolled version of Popups should you have a lot of information to display.
+
+Show a scrolled Popup window containing the user's text that was supplied. Use with as many items to print as you
+want, just like a print statement.
+
+```
+PopupScrolled(args=*<1 or N object>,
+ title=None,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ yes_no=False,
+ auto_close=False,
+ auto_close_duration=None,
+ size=(None, None),
+ location=(None, None),
+ non_blocking=False,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ font=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | yes_no | If True, displays Yes and No buttons instead of Ok |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| Tuple[int, int] | location | Location on the screen to place the upper left corner of the window |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[str, None, TIMEOUT_KEY] | **RETURN** | Returns text of the button that was pressed. None will be returned if user closed window with X
+
+```python
+PopupScrolled(*args, button_color=None, yes_no=False, auto_close=False, auto_close_duration=None, size=(None, None), location=(None, None), title=None, non_blocking=False)
+```
+Typical usage:
+
+```python
+sg.PopupScrolled(my_text)
+```
+
+
+
+The `PopupScrolled` will auto-fit the window size to the size of the text. Specify `None` in the height field of a `size` parameter to get auto-sized height.
+
+This call will create a scrolled box 80 characters wide and a height dependent upon the number of lines of text.
+
+`sg.PopupScrolled(my_text, size=(80, None))`
+
+Note that the default max number of lines before scrolling happens is set to 50. At 50 lines the scrolling will begin.
+
+If `non_blocking` parameter is set, then the call will not blocking waiting for the user to close the window. Execution will immediately return to the user. Handy when you want to dump out debug info without disrupting the program flow.
+
+### PopupNoWait
+
+Show Popup window and immediately return (does not block)
+
+```
+PopupNoWait(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=True,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+The Popup call PopupNoWait or PopupNonBlocking will create a popup window and then immediately return control back to you. All other popup functions will block, waiting for the user to close the popup window.
+
+This function is very handy for when you're **debugging** and want to display something as output but don't want to change the programs's overall timing by blocking. Think of it like a `print` statement. There are no return values on one of these Popups.
+
+## Popup Input
+There are Popup calls for single-item inputs. These follow the pattern of `Popup` followed by `Get` and then the type of item to get. There are 3 of these input Popups to choose from, each with settings enabling customization.
+- `PopupGetText` - get a single line of text
+- `PopupGetFile` - get a filename
+- `PopupGetFolder` - get a folder name
+
+Use these Popups instead of making a custom window to get one data value, call the Popup input function to get the item from the user. If you find the parameters are unable to create the kind of window you are looking for, then it's time for you to create your own window.
+### PopupGetText
+Use this Popup to get a line of text from the user.
+
+Display Popup with text entry field. Returns the text entered or None if closed / cancelled
+
+```
+PopupGetText(message,
+ title=None,
+ default_text="",
+ password_char="",
+ size=(None, None),
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ icon=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | message | (str) message displayed to user |
+| str | title | (str) Window title |
+| str | default_text | (str) default value to put into input area |
+| str | password_char | (str) character to be shown instead of actually typed characters |
+| Tuple[int, int] | size | (width, height) of the InputText Element |
+| Tuple[str, str] | button_color | Color of the button (text, background) |
+| str | background_color | (str) background color of the entire window |
+| str | text_color | (str) color of the message text |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | (bool) If True no titlebar will be shown |
+| bool | grab_anywhere | (bool) If True can click and drag anywhere in the window to move the window |
+| bool | keep_on_top | (bool) If True the window will remain above all current windows |
+| Tuple[int, int] | location | (x,y) Location on screen to display the upper left corner of window |
+| Union[str, None] | **RETURN** | Text entered or None if window was closed or cancel button clicked
+
+```python
+import PySimpleGUI as sg
+text = sg.PopupGetText('Title', 'Please input something')
+sg.Popup('Results', 'The value returned from PopupGetText', text)
+```
+
+
+
+
+
+### PopupGetFile
+Gets a filename from the user. There are options to configure the type of dialog box to show. Normally an "Open File" dialog box is shown.
+
+Display popup window with text entry field and browse button so that a file can be chosen by user.
+
+```
+PopupGetFile(message,
+ title=None,
+ default_path="",
+ default_extension="",
+ save_as=False,
+ multiple_files=False,
+ file_types=(('ALL Files', '*.*'),),
+ no_window=False,
+ size=(None, None),
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ icon=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None),
+ initial_folder=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | message | message displayed to user |
+| str | title | Window title |
+| str | default_path | path to display to user as starting point (filled into the input field) |
+| str | default_extension | If no extension entered by user, add this to filename (only used in saveas dialogs) |
+| bool | save_as | if True, the "save as" dialog is shown which will verify before overwriting |
+| bool | multiple_files | if True, then allows multiple files to be selected that are returned with ';' between each filename |
+| Tuple[Tuple[str,str]] | file_types | List of extensions to show using wildcards. All files (the default) = (("ALL Files", "*.*"),) |
+| bool | no_window | if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown |
+| Tuple[int, int] | size | (width, height) of the InputText Element |
+| Tuple[str, str] | button_color | Color of the button (text, background) |
+| str | background_color | background color of the entire window |
+| str | text_color | color of the text |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| str | initial_folder | location in filesystem to begin browsing |
+| Union[str, None] | **RETURN** | string representing the file(s) chosen, None if cancelled or window closed with X
+
+If configured as an Open File Popup then (save_as is not True) the dialog box will look like this.
+
+
+
+If you set the parameter save_As to True, then the dialog box looks like this:
+
+
+
+If you choose a filename that already exists, you'll get a warning popup box asking if it's OK. You can also specify a file that doesn't exist. With an "Open" dialog box you cannot choose a non-existing file.
+
+A typical call produces this window.
+
+```python
+text = sg.PopupGetFile('Please enter a file name')
+sg.Popup('Results', 'The value returned from PopupGetFile', text)
+```
+
+
+
+### PopupGetFolder
+
+The window created to get a folder name looks the same as the get a file name. The difference is in what the browse button does. `PopupGetFile` shows an Open File dialog box while `PopupGetFolder` shows an Open Folder dialog box.
+
+Display popup with text entry field and browse button so that a folder can be chosen.
+
+```
+PopupGetFolder(message,
+ title=None,
+ default_path="",
+ no_window=False,
+ size=(None, None),
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ icon=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None),
+ initial_folder=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | message | message displayed to user |
+| str | title | Window title |
+| str | default_path | path to display to user as starting point (filled into the input field) |
+| bool | no_window | if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown |
+| Tuple[int, int] | size | (width, height) of the InputText Element |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| str | initial_folder | location in filesystem to begin browsing |
+| Union[str, None] | **RETURN** | string representing the path chosen, None if cancelled or window closed with X
+
+This is a typpical call
+
+```python
+ text = sg.PopupGetFolder('Please enter a folder name')
+ sg.Popup('Results', 'The value returned from PopupGetFolder', text)
+```
+
+
+
+### PopupAnimated
+
+
+
+The animated Popup enables you to easily display a "loading" style animation specified through a GIF file that is either stored in a file or a base64 variable.
+
+Show animation one frame at a time. This function has its own internal clocking meaning you can call it at any frequency
+ and the rate the frames of video is shown remains constant. Maybe your frames update every 30 ms but your
+ event loop is running every 10 ms. You don't have to worry about delaying, just call it every time through the
+ loop.
+
+```
+PopupAnimated(image_source,
+ message=None,
+ background_color=None,
+ text_color=None,
+ font=None,
+ no_titlebar=True,
+ grab_anywhere=True,
+ keep_on_top=True,
+ location=(None, None),
+ alpha_channel=None,
+ time_between_frames=0,
+ transparent_color=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[str, bytes] | image_source | Either a filename or a base64 string. |
+| str | message | An optional message to be shown with the animation |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| Union[str, tuple] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True then the titlebar and window frame will not be shown |
+| bool | grab_anywhere | If True then you can move the window just clicking anywhere on window, hold and drag |
+| bool | keep_on_top | If True then Window will remain on top of all other windows currently shownn |
+| (int, int) | location | (x,y) location on the screen to place the top left corner of your window. Default is to center on screen |
+| float | alpha_channel | Window transparency 0 = invisible 1 = completely visible. Values between are see through |
+| int | time_between_frames | Amount of time in milliseconds between each frame |
+| str | transparent_color | This color will be completely see-through in your window. Can even click through |
+
+***To close animated popups***, call PopupAnimated with `image_source=None`. This will close all of the currently open PopupAnimated windows.
+
+# Progress Meters!
+We all have loops in our code. 'Isn't it joyful waiting, watching a counter scrolling past in a text window? How about one line of code to get a progress meter, that contains statistics about your code?
+
+```
+OneLineProgressMeter(title,
+ current_value,
+ max_value,
+ key,
+ *args,
+ orientation=None,
+ bar_color=DEFAULT_PROGRESS_BAR_COLOR,
+ button_color=None,
+ size=DEFAULT_PROGRESS_BAR_SIZE,
+ border_width=DEFAULT_PROGRESS_BAR_BORDER_WIDTH):
+```
+
+Here's the one-line Progress Meter in action!
+
+```python
+for i in range(1,10000):
+ sg.OneLineProgressMeter('My Meter', i+1, 10000, 'key','Optional message')
+```
+
+That line of code resulted in this window popping up and updating.
+
+
+
+A meter AND fun statistics to watch while your machine grinds away, all for the price of 1 line of code.
+With a little trickery you can provide a way to break out of your loop using the Progress Meter window. The cancel button results in a `False` return value from `OneLineProgressMeter`. It normally returns `True`.
+
+***Be sure and add one to your loop counter*** so that your counter goes from 1 to the max value. If you do not add one, your counter will never hit the max value. Instead it will go from 0 to max-1.
+
+# Debug Output (EasyPrint = Print = eprint)
+
+Another call in the 'Easy' families of APIs is `EasyPrint`. As is with other commonly used PySimpleGUI calls, there are other names for the same call. You can use `Print` or `eprint` in addition to `EasyPrint`. They all do the same thing, output to a debug window. If the debug window isn't open, then the first call will open it. No need to do anything but stick an 'sg.Print' call in your code. You can even replace your 'print' calls with calls to EasyPrint by simply sticking the statement
+
+```python
+print = sg.EasyPrint
+```
+
+at the top of your code.
+
+`Print` is one of the better ones to use as it's easy to remember. It is simply `print` with a capital P. `sg.Print('this will go to the debug window')`
+
+```python
+import PySimpleGUI as sg
+
+for i in range(100):
+ sg.Print(i)
+```
+
+
+
+Or if you didn't want to change your code:
+
+```python
+import PySimpleGUI as sg
+
+print=sg.Print
+for i in range(100):
+print(i)
+```
+
+Just like the standard print call, `EasyPrint` supports the `sep` and `end` keyword arguments. Other names that can be used to call `EasyPrint` include `Print`, `eprint`, If you want to close the window, call the function `EasyPrintClose`.
+
+You can change the size of the debug window using the `SetOptions` call with the `debug_win_size` parameter.
+
+There is an option to tell PySimpleGUI to reroute all of your stdout and stderr output to this window. To do so call EasyPrint with the parameter `do_not_reroute_stdout` set to `False`. After calling it once with this parameter set to True, all future calls to a normal`print` will go to the debug window.
+
+If you close the debug window it will re-open the next time you Print to it. If you wish to close the window using your code, then you can call either `EasyPrintClose()` or `PrintClose()`
+
+---
+# Custom window API Calls (Your First window)
+
+This is the FUN part of the programming of this GUI. In order to really get the most out of the API, you should be using an IDE that supports auto complete or will show you the definition of the function. This will make customizing go smoother.
+
+This first section on custom windows is for your typical, blocking, non-persistent window. By this I mean, when you "show" the window, the function will not return until the user has clicked a button or closed the window with an X.
+
+Two other types of windows exist.
+1. Persistent window - the `Window.read()` method returns and the window continues to be visible. This is good for applications like a chat window or a timer or anything that stays active on the screen for a while.
+2. Asynchronous window - the trickiest of the lot. Great care must be exercised. Examples are an MP3 player or status dashboard. Async windows are updated (refreshed) on a periodic basis. You can spot them easily as they will have a `timeout` parameter on the call to read. `event, values = window.Read(timeout=100)`
+
+It's both not enjoyable nor helpful to immediately jump into tweaking each and every little thing available to you. Make some simple windows. Use the Cookbook and the Demo Programs as a way to learn and as a "starting point".
+
+## The window Designer
+
+The good news to newcomers to GUI programming is that PySimpleGUI has a window designer. Better yet, the window designer requires no training, no downloads, and everyone knows how to use it.
+
+
+
+It's a manual process, but if you follow the instructions, it will take only a minute to do and the result will be a nice looking GUI. The steps you'll take are:
+1. Sketch your GUI on paper
+2. Divide your GUI up into rows
+3. Label each Element with the Element name
+4. Write your Python code using the labels as pseudo-code
+
+Let's take a couple of examples.
+
+**Enter a number**.... Popular beginner programs are often based on a game or logic puzzle that requires the user to enter something, like a number. The "high-low" answer game comes to mind where you try to guess the number based on high or low tips.
+
+**Step 1- Sketch the GUI**
+
+
+**Step 2 - Divide into rows**
+
+
+
+Step 3 - Label elements
+
+
+
+Step 4 - Write the code
+The code we're writing is the layout of the GUI itself. This tutorial only focuses on getting the window code written, not the stuff to display it, get results.
+
+We have only 1 element on the first row, some text. Rows are written as a "list of elements", so we'll need [ ] to make a list. Here's the code for row 1
+
+```
+[ sg.Text('Enter a number') ]
+```
+
+Row 2 has 1 elements, an input field.
+
+```
+[ sg.Input() ]
+```
+
+Row 3 has an OK button
+
+```
+[ sg.OK() ]
+```
+
+Now that we've got the 3 rows defined, they are put into a list that represents the entire window.
+
+```
+layout = [ [sg.Text('Enter a Number')],
+ [sg.Input()],
+ [sg.OK()] ]
+```
+
+Finally we can put it all together into a program that will display our window.
+
+```python
+import PySimpleGUI as sg
+
+layout = [[sg.Text('Enter a Number')],
+ [sg.Input()],
+ [sg.OK()] ]
+
+event, values = sg.Window('Enter a number example', layout).Read()
+
+sg.Popup(event, values[0])
+```
+
+Your call to `Read` will return a dictionary, but will "look like a list" in how you access it. The first input field will be entry 0, the next one is 1, etc. Later you'll learn about the `key` parameter which allows you to use your own values to identify elements instead of them being numbered for you.
+
+### Example 2 - Get a filename
+Let's say you've got a utility you've written that operates on some input file and you're ready to use a GUI to enter than filename rather than the command line. Follow the same steps as the previous example - draw your window on paper, break it up into rows, label the elements.
+
+
+
+
+Writing the code for this one is just as straightforward. There is one tricky thing, that browse for a file button. Thankfully PySimpleGUI takes care of associating it with the input field next to it. As a result, the code looks almost exactly like the window on the paper.
+
+```python
+import PySimpleGUI as sg
+
+sg.theme('Dark Blue 3') # please make your windows colorful
+
+layout = [[sg.Text('Filename')],
+ [sg.Input(), sg.FileBrowse()],
+ [sg.OK(), sg.Cancel()] ]
+
+window = sg.Window('Get filename example', layout)
+event, values = window.read()
+window.close()
+
+sg.Popup(event, values[0])
+```
+
+Read on for detailed instructions on the calls that show the window and return your results.
+
+# Copy these design patterns!
+
+All of your PySimpleGUI programs will utilize one of these 2 design patterns depending on the type of window you're implementing.
+
+## Pattern 1 A - "One-shot Window" - Read a window one time then close it
+
+This will be the most common pattern you'll follow if you are not using an "event loop" (not reading the window multiple times). The window is read and closed.
+
+The input fields in your window will be returned to you as a dictionary (syntactically it looks just like a list lookup)
+
+```python
+import PySimpleGUI as sg
+
+sg.theme('Dark Blue 3') # please make your windows colorful
+
+layout = [[sg.Text('SHA-1 and SHA-256 Hashes for the file')],
+ [sg.InputText(), sg.FileBrowse()],
+ [sg.Submit(), sg.Cancel()]]
+
+window = sg.Window('SHA-1 & 256 Hash', layout)
+
+event, values = window.read()
+window.close()
+
+source_filename = values[0] # the first input element is values[0]
+```
+
+## Pattern 1 B - "One-shot Window" - Read a window one time then close it (compact format)
+
+Same as Pattern 1, but done in a highly compact way. This example uses the `close` parameter in `window.read` to automatically close the window as part of the read operation (new in version 4.16.0). This enables you to write a single line of code that will create, display, gather input and close a window. It's really powerful stuff!
+
+```python
+import PySimpleGUI as sg
+
+sg.theme('Dark Blue 3') # please make your windows colorful
+
+event, values = sg.Window('SHA-1 & 256 Hash', [[sg.Text('SHA-1 and SHA-256 Hashes for the file')],
+ [sg.InputText(), sg.FileBrowse()],
+ [sg.Submit(), sg.Cancel()]]).read(close=True)
+
+source_filename = values[0] # the first input element is values[0]
+```
+
+## Pattern 2 A - Persistent window (multiple reads using an event loop)
+
+Some of the more advanced programs operate with the window remaining visible on the screen. Input values are collected, but rather than closing the window, it is kept visible acting as a way to both output information to the user and gather input data.
+
+This code will present a window and will print values until the user clicks the exit button or closes window using an X.
+
+```python
+import PySimpleGUI as sg
+
+sg.theme('Dark Blue 3') # please make your windows colorful
+
+layout = [[sg.Text('Persistent window')],
+ [sg.Input()],
+ [sg.Button('Read'), sg.Exit()]]
+
+window = sg.Window('Window that stays open', layout)
+
+while True:
+ event, values = window.read()
+ if event is None or event == 'Exit':
+ break
+ print(event, values)
+
+window.close()
+```
+
+## Pattern 2 B - Persistent window (multiple reads using an event loop + updates data in window)
+
+This is a slightly more complex, but maybe more realistic version that reads input from the user and displays that input as text in the window. Your program is likely to be doing both of those activities (input and output) so this will give you a big jump-start.
+
+Do not worry yet what all of these statements mean. Just copy it so you can begin to play with it, make some changes. Experiment to see how thing work.
+
+A final note... the parameter `do_not_clear` in the input call determines the action of the input field after a button event. If this value is True, the input value remains visible following button clicks. If False, then the input field is CLEARED of whatever was input. If you are building a "Form" type of window with data entry, you likely want False. The default is to NOT clear the input element (`do_not_clear=True`).
+
+This example introduces the concept of "keys". Keys are super important in PySimpleGUI as they enable you to identify and work with Elements using names you want to use. Keys can be ANYTHING, except `None`. To access an input element's data that is read in the example below, you will use `values['-IN-']` instead of `values[0]` like before.
+
+```python
+import PySimpleGUI as sg
+
+sg.theme('Dark Blue 3') # please make your windows colorful
+
+layout = [[sg.Text('Your typed chars appear here:'), sg.Text(size=(12,1), key='-OUTPUT-')],
+ [sg.Input(key='-IN-')],
+ [sg.Button('Show'), sg.Button('Exit')]]
+
+window = sg.Window('Window Title', layout)
+
+while True: # Event Loop
+ event, values = window.read() # can also be written as event, values = window()
+ print(event, values)
+ if event is None or event == 'Exit':
+ break
+ if event == 'Show':
+ # change the "output" element to be the value of "input" element
+ window['-OUTPUT-'].update(values['-IN-'])
+ # above line can also be written without the update specified
+ window['-OUTPUT-'](values['-IN-'])
+
+window.close()
+```
+
+### Qt Designer
+
+There actually is a PySimpleGUI Window Designer that uses Qt's window designer. It's outside the scope of this document however. You'll find the project here: https://github.com/nngogol/PySimpleGUIDesigner
+
+I hope to start using it more soon.
+
+## How GUI Programming in Python Should Look? At least for beginners ?
+
+While one goal was making it simple to create a GUI another just as important goal was to do it in a Pythonic manner. Whether it achieved these goals is debatable, but it was an attempt just the same.
+
+The key to custom windows in PySimpleGUI is to view windows as ROWS of GUI Elements. Each row is specified as a list of these Elements. Put the rows together and you've got a window. This means the GUI is defined as a series of Lists, a Pythonic way of looking at things.
+
+### Let's dissect this little program
+
+```python
+import PySimpleGUI as sg
+
+sg.theme('Dark Blue 3') # please make your windows colorful
+
+layout = [[sg.Text('Rename files or folders')],
+ [sg.Text('Source for Folders', size=(15, 1)), sg.InputText(), sg.FolderBrowse()],
+ [sg.Text('Source for Files ', size=(15, 1)), sg.InputText(), sg.FolderBrowse()],
+ [sg.Submit(), sg.Cancel()]]
+
+window = sg.Window('Rename Files or Folders', layout)
+
+event, values = window.read()
+window.close()
+folder_path, file_path = values[0], values[1] # get the data from the values dictionary
+print(folder_path, file_path)
+```
+
+### Themes
+
+
+
+The first line of code after the import is a call to `theme`.
+
+Until Dec 2019 the way a "theme" was specific in PySimpleGUI was to call `change_look_and_feel`. That call has been replaced by the more simple function `theme`.
+
+### Window contents (The Layout)
+
+Let's agree the window has 4 rows.
+
+The first row only has **text** that reads `Rename files or folders`
+
+The second row has 3 elements in it. First the **text** `Source for Folders`, then an **input** field, then a **browse** button.
+
+Now let's look at how those 2 rows and the other two row from Python code:
+
+```python
+layout = [[sg.Text('Rename files or folders')],
+ [sg.Text('Source for Folders', size=(15, 1)), sg.InputText(), sg.FolderBrowse()],
+ [sg.Text('Source for Files ', size=(15, 1)), sg.InputText(), sg.FolderBrowse()],
+ [sg.Submit(), sg.Cancel()]]
+```
+
+See how the source code mirrors the layout? You simply make lists for each row, then submit that table to PySimpleGUI to show and get values from.
+
+And what about those return values? Most people simply want to show a window, get the input values and do something with them. So why break up the code into button callbacks, etc, when I simply want my window's input values to be given to me.
+
+For return values the window is scanned from top to bottom, left to right. Each field that's an input field will occupy a spot in the return values.
+
+In our example window, there are 2 fields, so the return values from this window will be a dictionary with 2 values in it. Remember, if you do not specify a `key` when creating an element, one will be created for you. They are ints starting with 0. In this example, we have 2 input elements. They will be addressable as values[0] and values[1]
+
+### "Reading" the window's values (also displays the window)
+
+```python
+event, values = window.read()
+folder_path, file_path = values[0], values[1]
+```
+
+In one statement we both show the window and read the user's inputs. In the next line of code the *dictionary* of return values is split into individual variables `folder_path` and `file_path`.
+
+Isn't this what a Python programmer looking for a GUI wants? Something easy to work with to get the values and move on to the rest of the program, where the real action is taking place. Why write pages of GUI code when the same layout can be achieved with PySimpleGUI in 3 or 4 lines of code. 4 lines or 40? Most would choose 4.
+
+## Return values
+
+There are 2 return values from a call to `Window.read()`, an `event` that caused the `Read` to return and `values` a list or dictionary of values. If there are no elements with keys in the layout, then it will be a list. However, some elements, like some buttons, have a key automatically added to them. **It's best to use keys on all of your input type elements.**
+
+### Two Return Values
+
+All Window Read calls return 2 values. By convention a read statement is written:
+
+```python
+event, values = window.read()
+```
+
+You don't HAVE to write your reads in this way. You can name your variables however you want. But if you want to code them in a way that other programmers using PySimpleGUI are used to, then use this statement.
+
+## Events
+
+The first parameter `event` describes **why** the read completed. Events are one of these:
+
+For all Windows:
+
+* Button click
+* Window closed using X
+
+For Windows that have specifically enabled these. Please see the appropriate section in this document to learn about how to enable these and what the event return values are.
+
+* Keyboard key press
+* Mouse wheel up/down
+* Menu item selected
+* An Element Changed (slider, spinner, etc)
+* A list item was clicked
+* Return key was pressed in input element
+* Timeout waiting for event
+* Text was clicked
+* Combobox item chosen
+* Table row selected
+* etc
+
+***Most*** of the time the event will be a button click or the window was closed. The other Element-specific kinds of events happen when you set `enable_events=True` when you create the Element.
+
+### Window closed event
+
+Another convention to follow is the check for windows being closed with an X. *This is an critically important event to catch*. If you don't check for this and you attempt to use the window, your program will crash. Please check for closed window and exit your program gracefully. Your users will like you for it.
+
+Close your windows when you're done with them even though exiting the program will also close them. tkinter can generate an error/warning sometimes if you don't close the window. For other ports, such as PySimpleGUIWeb, not closing the Window will potentially cause your program to continue to run in the background.
+
+To check for a closed window use this line of code:
+
+```python
+if event is None:
+```
+
+Putting it all together we end up with an "event loop" that looks something like this:
+
+```python
+while True:
+ event, values = window.read()
+ if event is None:
+ break
+window.close()
+```
+
+You will very often see the examples and demo programs write this check as:
+
+```python
+ event, values = window.read()
+ if event in (None, 'Exit'):
+ break
+```
+
+This if statement is the same as:
+```python
+ if event is None or event == 'Exit':
+ break
+```
+
+Instead of `'Exit'` use the name/key of the button you want to exit the window (Cancel, Quit, etc)
+
+### Button Click Events
+
+By default buttons will always return a click event, or in the case of realtime buttons, a button down event. You don't have to do anything to enable button clicks. To disable the events, disable the button using its Update method.
+
+You can enable an additional "Button Modified" event by setting `enable_events=True` in the Button call. These events are triggered when something 'writes' to a button, ***usually*** it's because the button is listed as a "target" in another button.
+
+The button value from a Read call will be one of 2 values:
+1. The Button's text - Default
+2. The Button's key - If a key is specified
+
+If a button has a key set when it was created, then that key will be returned, regardless of what text is shown on the button. If no key is set, then the button text is returned. If no button was clicked, but the window returned anyway, the event value is the key that caused the event to be generated. For example, if `enable_events` is set on an `Input` Element and someone types a character into that `Input` box, then the event will be the key of the input box.
+
+### **None is returned when the user clicks the X to close a window.**
+
+If your window has an event loop where it is read over and over, remember to give your user an "out". You should ***always check for a None value*** and it's a good practice to provide an Exit button of some kind. Thus design patterns often resemble this Event Loop:
+
+```python
+while True:
+ event, values = window.read()
+ if event is None or event == 'Quit':
+ break
+```
+
+Actually, the more "Pythonic version" is used in most Demo Programs and examples. They do **exactly** the same thing.
+
+```python
+while True:
+ event, values = window.read()
+ if event in (None, 'Quit'):
+ break
+```
+
+### Element Events
+
+Some elements are capable of generating events when something happens to them. For example, when a slider is moved, or list item clicked on or table row clicked on. These events are not enabled by default. To enable events for an Element, set the parameter `enable_events=True`. This is the same as the older `click_submits` parameter. You will find the `click_submits` parameter still in the function definition. You can continue to use it. They are the same setting. An 'or' of the two values is used. In the future, click_submits will be removed so please migrate your code to using `enable_events`.
+
+|Name|events|
+| --- | --- |
+| InputText | any change |
+| Combo | item chosen |
+| Listbox | selection changed |
+| Radio | selection changed |
+| Checkbox | selection changed |
+| Spinner | new item selected |
+| Multiline | any change |
+| Text | clicked |
+| Status Bar | clicked |
+| Graph | clicked |
+| Graph | dragged |
+| Graph | drag ended (mouse up) |
+| TabGroup | tab clicked |
+| Slider | slider moved |
+| Table | row selected |
+| Tree | node selected |
+| ButtonMenu | menu item chosen |
+| Right click menu | menu item chosen |
+
+### Other Events
+
+#### Menubar menu item chosen for MenuBar menus and ButtonMenu menus
+
+You will receive the key for the MenuBar and ButtonMenu. Use that key to read the value in the return values dictionary. The value shown will be the full text plus key for the menu item chosen. Remember that you can put keys onto menu items. You will get the text and the key together as you defined it in the menu
+definition.
+
+#### Right Click menu item chosen
+
+Unlike menu bar and button menus, you will directly receive the menu item text and its key value. You will not do a dictionary lookup to get the value. It is the event code returned from WindowRead().
+
+#### Windows - keyboard, mouse scroll wheel
+
+Windows are capable of returning keyboard events. These are returned as either a single character or a string if it's a special key. Experiment is all I can say. The mouse scroll wheel events are also strings. Put a print in your code to see what's returned.
+
+#### Timeouts
+
+If you set a timeout parameter in your read, then the system TIMEOUT_KEY will be returned. If you specified your own timeout key in the Read call then that value will be what's returned instead.
+
+### The `values` Variable - Return values as a list
+
+The second parameter from a Read call is either a list or a dictionary of the input fields on the Window.
+
+By default return values are a list of values, one entry for each input field, but for all but the simplest of windows the return values will be a dictionary. This is because you are likely to use a 'key' in your layout. When you do, it forces the return values to be a dictionary.
+
+Each of the Elements that are Input Elements will have a value in the list of return values. If you know for sure that the values will be returned as a list, then you could get clever and unpack directly into variables.
+
+event, (filename, folder1, folder2, should_overwrite) = sg.Window('My title', window_rows).Read()
+
+Or, more commonly, you can unpack the return results separately. This is the preferred method because it works for **both** list and dictionary return values.
+
+```python
+event, values = sg.Window('My title', window_rows).Read()
+event, value_list = window.read()
+value1 = value_list[0]
+value2 = value_list[1]
+ ...
+```
+
+However, this method isn't good when you have a lot of input fields. If you insert a new element into your window then you will have to shuffle your unpacks down, modifying each of the statements to reference `value_list[x]`.
+
+The more common method is to request your values be returned as a dictionary by placing keys on the "important" elements (those that you wish to get values from and want to interact with)
+
+### `values` Variable - Return values as a dictionary
+
+For those of you that have not encountered a Python dictionary, don't freak out! Just copy and paste the sample code and modify it. Follow this design pattern and you'll be fine. And you might learn something along the way.
+
+For windows longer than 3 or 4 fields you will want to use a dictionary to help you organize your return values. In almost all (if not all) of the demo programs you'll find the return values being passed as a dictionary. It is not a difficult concept to grasp, the syntax is easy to understand, and it makes for very readable code.
+
+The most common window read statement you'll encounter looks something like this:
+
+`window = sg.Window("My title", layout).Read()`
+
+To use a dictionary, you will need to:
+* Mark each input element you wish to be in the dictionary with the keyword `key`.
+
+If **any** element in the window has a `key`, then **all** of the return values are returned via a dictionary. If some elements do not have a key, then they are numbered starting at zero.
+
+Let's take a look at your first dictionary-based window.
+
+```python
+import PySimpleGUI as sg
+
+sg.theme('Dark Blue 3') # please make your windows colorful
+
+layout = [
+ [sg.Text('Please enter your Name, Address, Phone')],
+ [sg.Text('Name', size=(15, 1)), sg.InputText('1', key='-NAME-')],
+ [sg.Text('Address', size=(15, 1)), sg.InputText('2', key='-ADDRESS-')],
+ [sg.Text('Phone', size=(15, 1)), sg.InputText('3', key='-PHONE-')],
+ [sg.Submit(), sg.Cancel()]
+ ]
+
+window = sg.Window('Simple data entry window', layout)
+event, values = window.read()
+window.close()
+
+sg.Popup(event, values, values['-NAME-'], values['-ADDRESS-'], values['-PHONE-'])
+```
+
+To get the value of an input field, you use whatever value used as the `key` value as the index value. Thus to get the value of the name field, it is written as
+
+ values['-NAME-']
+
+Think of the variable values in the same way as you would a list, however, instead of using 0,1,2, to reference each item in the list, use the values of the key. The Name field in the window above is referenced by `values['-NAME-']`.
+
+You will find the key field used quite heavily in most PySimpleGUI windows unless the window is very simple.
+
+One convention you'll see in many of the demo programs is keys being named in all caps with an underscores at the beginning and the end. You don't HAVE to do this... your key value may look like this:
+`key = '-NAME-'`
+
+The reason for this naming convention is that when you are scanning the code, these key values jump out at you. You instantly know it's a key. Try scanning the code above and see if those keys pop out.
+`key = '-NAME-'`
+
+## The Event Loop / Callback Functions
+
+All GUIs have one thing in common, an "event loop". Usually the GUI framework runs the event loop for you, but sometimes you want greater control and will run your own event loop. You often hear the term event loop when discussing embedded systems or on a Raspberry Pi.
+
+With PySimpleGUI if your window will remain open following button clicks, then your code will have an event loop. If your program shows a single "one-shot" window, collects the data and then has no other GUI interaction, then you don't need an event loop.
+
+There's nothing mysterious about event loops... they are loops where you take care of.... wait for it..... *events*. Events are things like button clicks, key strokes, mouse scroll-wheel up/down.
+
+This little program has a typical PySimpleGUI Event Loop.
+
+The anatomy of a PySimpleGUI event loop is as follows, *generally speaking*.
+* The actual "loop" part is a `while True` loop
+* "Read" the event and any input values the window has
+* Check to see if window was closed or user wishes to exit
+* A series of `if event ....` statements
+
+Here is a complete, short program to demonstrate each of these concepts.
+```python
+import PySimpleGUI as sg
+
+sg.ChangeLookAndFeel('GreenTan')
+
+# ------ Menu Definition ------ #
+menu_def = [['&File', ['&Open', '&Save', 'E&xit', 'Properties']],
+ ['&Edit', ['Paste', ['Special', 'Normal', ], 'Undo'], ],
+ ['&Help', '&About...'], ]
+
+# ------ Column Definition ------ #
+column1 = [[sg.Text('Column 1', background_color='lightblue', justification='center', size=(10, 1))],
+ [sg.Spin(values=('Spin Box 1', '2', '3'), initial_value='Spin Box 1')],
+ [sg.Spin(values=('Spin Box 1', '2', '3'), initial_value='Spin Box 2')],
+ [sg.Spin(values=('Spin Box 1', '2', '3'), initial_value='Spin Box 3')]]
+
+layout = [
+ [sg.Menu(menu_def, tearoff=True)],
+ [sg.Text('(Almost) All widgets in one Window!', size=(30, 1), justification='center', font=("Helvetica", 25), relief=sg.RELIEF_RIDGE)],
+ [sg.Text('Here is some text.... and a place to enter text')],
+ [sg.InputText('This is my text')],
+ [sg.Frame(layout=[
+ [sg.Checkbox('Checkbox', size=(10,1)), sg.Checkbox('My second checkbox!', default=True)],
+ [sg.Radio('My first Radio! ', "RADIO1", default=True, size=(10,1)), sg.Radio('My second Radio!', "RADIO1")]], title='Options',title_color='red', relief=sg.RELIEF_SUNKEN, tooltip='Use these to set flags')],
+ [sg.Multiline(default_text='This is the default Text should you decide not to type anything', size=(35, 3)),
+ sg.Multiline(default_text='A second multi-line', size=(35, 3))],
+ [sg.InputCombo(('Combobox 1', 'Combobox 2'), size=(20, 1)),
+ sg.Slider(range=(1, 100), orientation='h', size=(34, 20), default_value=85)],
+ [sg.InputOptionMenu(('Menu Option 1', 'Menu Option 2', 'Menu Option 3'))],
+ [sg.Listbox(values=('Listbox 1', 'Listbox 2', 'Listbox 3'), size=(30, 3)),
+ sg.Frame('Labelled Group',[[
+ sg.Slider(range=(1, 100), orientation='v', size=(5, 20), default_value=25, tick_interval=25),
+ sg.Slider(range=(1, 100), orientation='v', size=(5, 20), default_value=75),
+ sg.Slider(range=(1, 100), orientation='v', size=(5, 20), default_value=10),
+ sg.Column(column1, background_color='lightblue')]])],
+ [sg.Text('_' * 80)],
+ [sg.Text('Choose A Folder', size=(35, 1))],
+ [sg.Text('Your Folder', size=(15, 1), auto_size_text=False, justification='right'),
+ sg.InputText('Default Folder'), sg.FolderBrowse()],
+ [sg.Submit(tooltip='Click to submit this form'), sg.Cancel()]]
+
+window = sg.Window('Everything bagel', layout, default_element_size=(40, 1), grab_anywhere=False)
+event, values = window.read()
+window.close()
+
+sg.Popup('Title',
+ 'The results of the window.',
+ 'The button clicked was "{}"'.format(event),
+ 'The values are', values)
+
+```
+This is a complex window with quite a bit of custom sizing to make things line up well. This is code you only have to write once. When looking at the code, remember that what you're seeing is a list of lists. Each row contains a list of Graphical Elements that are used to create the window. If you see a pair of square brackets [ ] then you know you're reading one of the rows. Each row of your GUI will be one of these lists.
+
+This window may look "ugly" to you which is because no effort has been made to make it look nice. It's purely functional. There are 30 Elements in the window. THIRTY Elements. Considering what it does, it's miraculous or in the least incredibly impressive. Why? Because in less than 50 lines of code that window was created, shown, collected the results and showed the results in another window.
+
+50 lines. It'll take you 50 lines of tkinter or Qt code to get the first 3 elements of the window written, if you can even do that.
+
+No, let's be clear here... this window will take a massive amount of code using the conventional Python GUI packages. It's a fact and if you care to prove me wrong, then by ALL means PLEASE do it. Please write this window using tkinter, Qt, or WxPython and send the code!
+
+Note this window even has a menubar across the top, something easy to miss.
+
+
+
+Clicking the Submit button caused the window call to return. The call to Popup resulted in this window.
+
+
+
+**`Note, event values can be None`**. The value for `event` will be the text that is displayed on the button element when it was created or the key for the button. If the user closed the window using the "X" in the upper right corner of the window, then `event` will be `None`. It is ***vitally*** ***important*** that your code contain the proper checks for None.
+
+For "persistent windows", **always give your users a way out of the window**. Otherwise you'll end up with windows that never properly close. It's literally 2 lines of code that you'll find in every Demo Program. While you're at it, make sure a `window.Close()` call is after your event loop so that your window closes for sure.
+
+You can see in the results Popup window that the values returned are a dictionary. Each input field in the window generates one item in the return values list. Input fields often return a `string`. Check Boxes and Radio Buttons return `bool`. Sliders return float or perhaps int depending on how you configured it or which port you're using.
+
+If your window has no keys and it has no buttons that are "browse" type of buttons, then it will return values to you as a list instead of a dictionary. If possible PySimpleGUI tries to return the values as a list to keep things simple.
+
+Note in the list of return values in this example, many of the keys are numbers. That's because no keys were specified on any of the elements (although one was automatically made for you). If you don't specify a key for your element, then a number will be sequentially assigned. For elements that you don't plan on modifying or reading values from, like a Text Element, you can skip adding keys. For other elements, you'll likely want to add keys so that you can easily access the values and perform operations on them.
+
+### Operations That Take a "Long Time"
+
+If you're a Windows user you've seen windows show in their title bar "Not Responding" which is soon followed by a Windows popop stating that "Your program has stopped responding". Well, you too can make that message and popup appear if you so wish! All you need to do is execute an operation that takes "too long" (i.e. a few seconds) inside your event loop.
+
+You have a couple of options for dealing this with. If your operation can be broken up into smaller parts, then you can call `Window.Refresh()` occassionally to avoid this message. If you're running a loop for example, drop that call in with your other work. This will keep the GUI happy and Window's won't complain.
+
+If, on the other hand, your operation is not under your control or you are unable to add `Refresh` calls, then the next option available to you is to move your long operations into a thread.
+
+There are a couple of demo programs available for you to see how to do this. You basically put your work into a thread. When the thread is completed, it tells the GUI by sending a message through a queue. The event loop will run with a timer set to a value that represents how "responsive" you want your GUI to be to the work completing.
+
+These 2 demo programs are called
+```python
+Demo_Threaded_Work.py - Best documented. Single thread used for long task
+Demo_Multithreaded_Long_Tasks.py - Similar to above, but with less fancy GUI. Allows you to set amount of time
+```
+
+These 2 particular demos have a LOT of comments showing you where to add your code, etc. The amount of code to do this is actually quite small and you don't need to understand the mechanisms used if you simply follow the demo that's been prepared for you.
+
+### Multitheaded Programs
+
+While on the topic of multiple threads, another demo was prepared that shows how you can run multiple threads in your program that all communicate with the event loop in order to display something in the GUI window. Recall that for PySimpleGUI (at least the tkinter port) you cannot make PySimpleGUI calls in threads other than the main program thread.
+
+The key to these threaded programs is communication from the threads to your event loop. The mechanism chosen for these demonstrations uses the Python built-in `queue` module. The event loop polls these queues to see if something has been sent over from one of the threads to be displayed.
+
+You'll find the demo that shows multiple threads communicating with a single GUI is called:
+
+```python
+Demo_Multithreaded_Queued.py
+```
+
+Once again a **warning** is in order for plain PySimpleGUI (tkinter based) - your GUI must never run as anything but the main program thread and no threads can directly call PySimpleGUI calls.
+
+---
+
+# Building Custom Windows
+
+You will find it ***much easier*** to write code using PySimpleGUI if you use an IDE such as ***PyCharm***. The features that show you documentation about the API call you are making will help you determine which settings you want to change, if any. In PyCharm, two commands are particularly helpful.
+
+ Control-Q (when cursor is on function name) brings up a box with the function definition
+ Control-P (when cursor inside function call "()") shows a list of parameters and their default values
+
+## Synchronous / Asynchronous Windows
+
+The most common use of PySimpleGUI is to display and collect information from the user. The most straightforward way to do this is using a "blocking" GUI call. Execution is "blocked" while waiting for the user to close the GUI window/dialog box.
+
+You've already seen a number of examples above that use blocking windows. You'll know it blocks if the `Read` call has no timeout parameter.
+
+A blocking Read (one that waits until an event happens) look like this:
+
+```python
+event, values = window.read()
+```
+
+A non-blocking / Async Read call looks like this:
+
+```python
+event, values = window.Read(timeout=100)
+```
+
+You can learn more about these async / non-blocking windows toward the end of this document.
+
+# Themes - Automatic Coloring of Your Windows
+
+In Dec 2019 the function `change_look_and_feel` was replaced by `theme`. The concept remains the same, but a new group of function alls makes it a lot easier to manage colors and other settings.
+
+By default the PySimpleGUI color theme is now `Dark Blue 3`. Gone are the "system default" gray colors. If you want your window to be devoid of all colors so that the system chooses the colors (gray) for you, then set the theme to 'SystemDefault1' or `Default1`.
+
+There are 130 themes available. You can preview these themes by calling `theme_previewer()` which will create a LARGE window displaying all of the color themes available.
+
+As of this writing, these are your available themes.
+
+
+
+## Default is `Dark Blue 3`
+
+
+
+In Dec 2019 the default for all PySimpleGUI windows changed from the system gray with blue buttons to a more complete theme using a grayish blue with white text. Previouisly users were nagged into choosing color theme other than gray. Now it's done for you instead of nagging you.
+
+If you're struggling with this color theme, then add a call to `theme` to change it.
+
+## Theme Name Formula
+
+Themes names that you specify can be "fuzzy". The text does not have to match exactly what you see printed. For example "Dark Blue 3" and "DarkBlue3" and "dark blue 3" all work.
+
+One way to quickly determine the best setting for your window is to simply display your window using a lot of different themes. Add the line of code to set the theme - `theme('Dark Green 1')`, run your code, see if you like it, if not, change the theme string to `'Dark Green 2'` and try again. Repeat until you find something you like.
+
+The "Formula" for the string is:
+
+`Dark Color #`
+
+or
+
+`Light Color #`
+
+Color can be Blue, Green, Black, Gray, Purple, Brown, Teal, Red. The # is optional or can be from 1 to XX. Some colors have a lot of choices. There are 13 "Light Brown" choices for example.
+
+### "System" Default - No Colors
+
+If you're bent on having no colors at all in your window, then choose `Default 1` or `System Default 1`.
+
+If you want the original PySimpleGUI color scheme of a blue button and everything else gray then you can get that with the theme `Default` or `System Default`.
+
+## Theme Functions
+
+The basic theme function call is `theme(theme_name)`. This sets the theme. Calling without a parameter, `theme()` will return the name of the current theme.
+
+If you want to get or modify any of the theme settings, you can do it with these functions that you will find detailed information about in the function definitions section at the bottom of the document. Each will return the current value if no parameter is used.
+
+```python
+theme_background_color
+theme_border_width
+theme_button_color
+theme_element_background_color
+theme_element_text_color
+theme_input_background_color
+theme_input_text_color
+theme_progress_bar_border_width
+theme_progress_bar_color
+theme_slider_border_width
+theme_slider_color
+theme_text_color
+```
+
+These will help you get a list of available choices.
+
+```python
+theme_list
+theme_previewer
+```
+
+# Window Object - Beginning a window
+
+The first step is to create the window object using the desired window customizations.
+
+Note - There is no direct support for "**modal windows**" in PySimpleGUI. All windows are accessable at all times unless you manually change the windows' settings.
+
+**IMPORTANT** - Many of the `Window` methods require you to either call `Window.Read` or `Window.Finalize` (or set `finalize=True` in your `Window` call) before you call the method. This is because these 2 calls are what actually creates the window using the underlying GUI Framework. Prior to one of those calls, the methods are likely to crash as they will not yet have their underlying widgets created.
+
+### Window Location
+
+PySimpleGUI computes the exact center of your window and centers the window on the screen. If you want to locate your window elsewhere, such as the system default of (0,0), if you have 2 ways of doing this. The first is when the window is created. Use the `location` parameter to set where the window. The second way of doing this is to use the `SetOptions` call which will set the default window location for all windows in the future.
+
+#### Multiple Monitors and Linux
+
+The auto-centering (default) location for your PySimpleGUI window may not be correct if you have multiple monitors on a Linux system. On Windows multiple monitors appear to work ok as the primary monitor the tkinter utilizes and reports on.
+
+Linux users with multiple monitors that have a problem when running with the default location will need to specify the location the window should be placed when creating the window by setting the `location` parameter.
+
+### Window Size
+
+You can get your window's size by access the `Size` property. The window has to be Read once or Finalized in order for the value to be correct. Note that it's a property, not a call.
+
+`my_windows_size = window.Size`
+
+To finalize your window:
+
+```python
+window = Window('My Title', layout, finalize=True)
+```
+
+### Element Sizes
+
+There are multiple ways to set the size of Elements. They are:
+
+1. The global default size - change using `SetOptions` function
+2. At the Window level - change using the parameter `default_element_size` in your call to `Window`
+3. At the Element level - each element has a `size` parameter
+
+Element sizes are measured in characters (there are exceptions). A Text Element with `size = (20,1)` has a size of 20 characters wide by 1 character tall.
+
+The default Element size for PySimpleGUI is `(45,1)`.
+
+There are a couple of widgets where one of the size values is in pixels rather than characters. This is true for Progress Meters and Sliders. The second parameter is the 'height' in pixels.
+
+### No Titlebar
+
+Should you wish to create cool looking windows that are clean with no windows titlebar, use the no_titlebar option when creating the window.
+
+Be sure an provide your user an "exit" button or they will not be able to close the window! When no titlebar is enabled, there will be no icon on your taskbar for the window. Without an exit button you will need to kill via taskmanager... not fun.
+
+Windows with no titlebar rely on the grab anywhere option to be enabled or else you will be unable to move the window.
+
+Windows without a titlebar can be used to easily create a floating launcher.
+
+Linux users! Note that this setting has side effects for some of the other Elements. Multi-line input doesn't work at all, for example So, use with caution.
+
+
+
+### Grab Anywhere
+
+This is a feature unique to PySimpleGUI.
+
+Note - there is a warning message printed out if the user closes a non-blocking window using a button with grab_anywhere enabled. There is no harm in these messages, but it may be distressing to the user. Should you wish to enable for a non-blocking window, simply get grab_anywhere = True when you create the window.
+
+### Always on top
+
+To keep a window on top of all other windows on the screen, set keep_on_top = True when the window is created. This feature makes for floating toolbars that are very helpful and always visible on your desktop.
+
+### Focus
+
+PySimpleGUI will set a default focus location for you. This generally means the first input field. You can set the focus to a particular element. If you are going to set the focus yourself, then you should turn off the automatic focus by setting `use_default_focus=False` in your Window call.
+
+### TTK Buttons
+
+Beginning in release 4.7.0 PySimpleGUI supports both "normal" tk Buttons and ttk Buttons. This change was needed so that Mac users can use colors on their buttons. There is a bug that causes tk Buttons to not show text when you attempt to change the button color. Note that this problem goes away if you install Python from the official Python.org site rather than using Homebrew. A number of users have switched and are quite happy since even tk Buttons work on the Mac after the switch.
+
+By default Mac users will get ttk Buttons when a Button Element is used. All other platforms will get a normal tk Button. There are ways to override this behavior. One is by using the parameter `use_ttk_buttons` when you create your window. If set to True, all buttons will be ttk Buttons in the window. If set to False, all buttons will be normal tk Buttons. If not set then the platform or the Button Element determines which is used.
+
+If a system-wide setting is desired, then the default can be set using `set_options`. This will affect all windows such as popups and the debug window.
+
+### TTK Themes
+
+tkinter has a number of "Themes" that can be used with ttk widgets. In PySimpleGUI these widgets include - Table, Tree, Combobox, Button, ProgressBar, Tabs & TabGroups. Some elements have a 'theme' parameter but these are no longer used and should be ignored. The initial release of PySimpleGUI attempted to mix themes in a single window but since have learned this is not possible so instead it is set at the Window or the system level.
+
+If a system-wide setting is desired, then the default can be set using `set_options`. This will affect all windows such as popups and the debug window.
+
+The ttk theme choices depend on the platform. Linux has a shorter number of selections than Windows. These are the Windows choices:
+'default', 'winnative', 'clam', 'alt', 'classic', 'vista', 'xpnative'
+
+There are constants defined to help you with code completion to determine what your choices are. Theme constants start with `THEME_`. For example, the "clam" theme is `THEME_CLAM`
+
+You're urged to experiment with this setting to determine which you like the most. They change the ttk-based elements in subtle but still significant ways.
+
+## Closing Windows
+
+When you are completely done with a window, you should close it and then delete it so that the resources, in particular the tkinter resources, are properly cleaned up.
+
+If you wish to do this in 1 line of code, here's your line:
+
+```python
+window.close(); del window
+```
+
+The delete helps with a problem multi-threaded application encounter where tkinter complains that it is being called from the wrong thread (not the program's main thread)
+
+## Window Methods That Complete Formation of Window
+
+After you have completed making your layout, stored in a variable called `layout` in these examples, you will create your window.
+
+The creation part of a window involves 3 steps.
+
+1. Create a `Window` object
+2. Adding your Layout to the window
+3. Optional - Finalize if want to make changes prior to `Read` call
+
+Over time the PySimpleGUI code has continued to compact, compress, so that as little code as possible will need to be written by the programmer.
+
+### The Individual Calls
+
+This is the "long form" as each method is called individually.
+
+```python
+window = sg.Window('My Title')
+window.layout(layout)
+window.finalize()
+```
+
+### Chaining The Calls (the old method)
+
+The next level of compression that was done was to chain the calls together into a single line of code.
+
+```python
+window = sg.Window('My Title').Layout(layout).finalize()
+```
+
+### Using Parameters Instead of Calls (New Preferred Method)
+
+Here's a novel concept, instead of using chaining, something that's foreign to beginners, use parameters to the `Window` call. And that is exactly what's happened as of 4.2 of the PySimpleGUI port.
+
+```python
+window = sg.Window('My Title', layout, finalize=True)
+```
+
+Rather than pushing the work onto the user of doing the layout and finalization calls, let the Window initialization code do it for you. Yea, it sounds totally obvious now, but it didn't a few months ago.
+
+This capability has been added to all 4 PySimpleGUI ports but none are on PyPI just yet as there is some runtime required first to make sure nothing truly bad is going to happen.
+
+Call to set the window layout. Must be called prior to `Read`. Most likely "chained" in line with the Window creation.
+
+```python
+window = sg.Window('My window title', layout)
+```
+
+#### `finalize()` or `Window` parameter `finalize=True`
+
+Call to force a window to go through the final stages of initialization. This will cause the tkinter resources to be allocated so that they can then be modified. This also causes your window to appear. If you do not want your window to appear when Finalize is called, then set the Alpha to 0 in your window's creation parameters.
+
+If you want to call an element's `Update` method or call a `Graph` element's drawing primitives, you ***must*** either call `Read` or `Finalize` prior to making those calls.
+
+#### read(timeout=None, timeout_key=TIMEOUT_KEY)
+
+Read the Window's input values and button clicks in a blocking-fashion
+
+Returns event, values. Adding a timeout can be achieved by setting timeout=*number of milliseconds* before the Read times out after which a "timeout event" is returned. The value of timeout_key will be returned as the event. If you do not specify a timeout key, then the value `TIMEOUT_KEY` will be returned.
+
+If you set the timeout = 0, then the Read will immediately return rather than waiting for input or for a timeout. It's a truly non-blocking "read" of the window.
+
+# Layouts
+
+While at this point in the documentation you've not been shown very much about each Element available, you should read this section carefully as you can use the techniques you learn in here to build better, shorter, and easier to understand PySimpleGUI code.
+
+If it feels like this layout section is too much too soon, then come back to this section after you're learned about each Element. **Whatever order you find the least confusing is the best.**
+
+While you've not learned about Elements yet, it makes sense for this section to be up front so that you'll have learned how to use the elements prior to learning how each element works. At this point in your PySimpleGUI education, it is better for you to grasp time efficient ways of working with Elements than what each Element does. By learning now how to assemble Elements now, you'll have a good model to put the elements you learn into.
+
+There are *several* aspects of PySimpleGUI that make it more "Pythonic" than other Python GUI SDKs. One of the areas that is unique to PySimpleGUI is how a window's "layout" is defined, specified or built. A window's "layout" is simply a list of lists of elements. As you've already learned, these lists combine to form a complete window. This method of defining a window is super-powerful because lists are core to the Python language as a whole and thus are very easy to create and manupulate.
+
+Think about that for a moment and compare/contrast with Qt, tkinter, etc. With PySimpleGUI the location of your element in a matrix determines where that Element is shown in the window. It's so ***simple*** and that makes it incredibly powerful. Want to switch a row in your GUI that has text with the one below it that has an input element? No problem, swap the lines of code and you're done.
+
+Layouts were designed to be visual. The idea is for you to be able to envision how a window will look by simplyh looking at the layout in the code. The CODE itself matches what is drawn on the screen. PySimpleGUI is a cross between straight Python code and a visual GUI designer.
+
+In the process of creating your window, you can manipulate these lists of elements without having an impact on the elements or on your window. Until you perform a "layout" of the list, they are nothing more than lists containing objects (they just happen to be your window's elements).
+
+Many times your window definition / layout will be a static, straightforward to create.
+
+However, window layouts are not limited to being one of these staticly defined list of Elements.
+
+# Generated Layouts (For sure want to read if you have > 5 repeating elements/rows)
+
+There are 5 specific techniques of generating layouts discussed in this section. They can be used alone or in combination with each other.
+
+1. Layout + Layout concatenation `[[A]] + [[B]] = [[A], [B]]`
+2. Element Addition on Same Row `[[A] + [B]] = [[A, B]]`
+3. List Comprehension to generate a row `[A for x in range(10)] = [A,A,A,A,A...]`
+4. List Comprehension to generate multiple rows `[[A] for x in range(10)] = [[A],[A],...]`
+5. User Defined Elements / Comound Elements
+
+## Example - List Comprehension To Concatenate Multiple Rows - "To Do" List Example
+
+Let's create a little layout that will be used to make a to-do list using PySimpleGUI.
+
+### Brute Force
+
+```python
+import PySimpleGUI as sg
+
+layout = [
+ [sg.Text('1. '), sg.In(key=1)],
+ [sg.Text('2. '), sg.In(key=2)],
+ [sg.Text('3. '), sg.In(key=3)],
+ [sg.Text('4. '), sg.In(key=4)],
+ [sg.Text('5. '), sg.In(key=5)],
+ [sg.Button('Save'), sg.Button('Exit')]
+ ]
+
+window = sg.Window('To Do List Example', layout)
+event, values = window.read()
+```
+
+The output from this script was this window:
+
+
+
+Take a moment and look at the code and the window that's generated. Are you able to look at the layout and envision the Window on the screen?
+
+### Build By Concatenating Rows
+
+The brute force method works great on a list that's 5 items long, but what if your todo list had 40 items on it. THEN what? Well, that's when we turn to a "generated" layout, a layout that is generated by your code. Replace the layout= stuff from the previous example with this definition of the layout.
+
+```python
+import PySimpleGUI as sg
+
+layout = []
+for i in range(1,6):
+ layout += [sg.Text(f'{i}. '), sg.In(key=i)],
+layout += [[sg.Button('Save'), sg.Button('Exit')]]
+
+window = sg.Window('To Do List Example', layout)
+event, values = window.read()
+```
+
+It produces the exact same window of course. That's progress.... went from writing out every row of the GUI to generating every row. If we want 48 items as suggested, change the range(1,6) to range(1,48). Each time through the list another row is added onto the layout.
+
+### Create Several Rows Using List Comprehension
+
+BUT, we're not done yet!
+
+This is **Python**, we're using lists to build something up, so we should be looking at ****list comprehensions****. Let's change the `for` loop into a list comprehension. Recall that our `for` loop was used to concatenate 6 rows into a layout.
+
+```python
+layout = [[sg.Text(f'{i}. '), sg.In(key=i)] for i in range(1,6)]
+```
+
+Here we've moved the `for` loop to inside of the list definition (a list comprehension)
+
+### Concatenating Multiple Rows
+
+We have our rows built using the list comprehension, now we just need the buttons. They can be easily "tacked onto the end" by simple addition.
+
+```python
+layout = [[sg.Text(f'{i}. '), sg.In(key=i)] for i in range(1,6)]
+layout += [[sg.Button('Save'), sg.Button('Exit')]]
+```
+
+Anytime you have 2 layouts, you can concatenate them by simple addition. Make sure your layout is a "list of lists" layout. In the above example, we know the first line is a generated layout of the input rows. The last line adds onto the layout another layout... note the format being [ [ ] ].
+
+This button definition is an entire layout, making it possible to add to our list comprehension
+
+`[[sg.Button('Save'), sg.Button('Exit')]]`
+
+It's quite readable code. The 2 layouts line up visually quite well.
+
+But let's not stop there with compressing the code. How about removing that += and instead change the layout into a single line with just a `+` between the two sets of row.
+
+Doing this concatenation on one line, we end up with this single statement that creates the **entire layout** for the GUI:
+
+```python
+layout = [[sg.Text(f'{i}. '), sg.In(key=i)] for i in range(1,6)] + [[sg.Button('Save'), sg.Button('Exit')]]
+```
+
+### Final "To Do List" Program
+
+And here we have our final program... all **4** lines.
+
+```python
+import PySimpleGUI as sg
+
+layout = [[sg.Text(f'{i}. '), sg.In(key=i)] for i in range(1,6)] + [[sg.Button('Save'), sg.Button('Exit')]]
+
+window = sg.Window('To Do List Example', layout)
+
+event, values = window.read()
+```
+
+If you really wanted to crunch things down, you can make it a 2 line program (an import and 1 line of code) by moving the layout into the call to `Window`
+
+```python
+import PySimpleGUI as sg
+
+event, values = sg.Window('To Do List Example', layout=[[sg.Text(f'{i}. '), sg.In(key=i)] for i in range(1,6)] + [[sg.Button('Save'), sg.Button('Exit')]]).Read()
+```
+
+## Example - List Comprehension to Build Rows - Table Simulation - Grid of Inputs
+
+In this example we're building a "table" that is 4 wide by 10 high using `Input` elements
+
+The end results we're seeking is something like this:
+
+```
+HEADER 1 HEADER 2 HEADER 3 HEADER 4
+INPUT INPUT INPUT INPUT
+INPUT INPUT INPUT INPUT
+INPUT INPUT INPUT INPUT
+INPUT INPUT INPUT INPUT
+INPUT INPUT INPUT INPUT
+INPUT INPUT INPUT INPUT
+INPUT INPUT INPUT INPUT
+INPUT INPUT INPUT INPUT
+INPUT INPUT INPUT INPUT
+INPUT INPUT INPUT INPUT
+```
+
+Once the code is completed, here is how the result will appear:
+
+
+
+We're going to be building each row using a list comprehension and we'll build the table by concatenating rows using another list comprehension. That's a list comprehension that goes across and another list comprehension that goes down the layout, adding one row after another.
+
+### Building the Header
+
+First let's build the header. There are 2 concepts to notice here:
+
+```python
+import PySimpleGUI as sg
+
+headings = ['HEADER 1', 'HEADER 2', 'HEADER 3','HEADER 4'] # the text of the headings
+header = [[sg.Text(' ')] + [sg.Text(h, size=(14,1)) for h in headings]] # build header layout
+```
+
+There are 2 things in this code to note
+1. The list comprehension that makes the heading elements
+2. The spaces added onto the front
+
+Let's start with the headers themselves.
+
+This is the code that makes a row of Text Elements containing the text for the headers. The result is a list of Text Elements, a row.
+
+```python
+[sg.Text(h, size=(14,1)) for h in headings]
+```
+
+Then we add on a few spaces to shift the headers over so they are centered over their columns. We do this by simply adding a `Text` Element onto the front of that list of headings.
+
+```python
+header = [[sg.Text(' ')] + [sg.Text(h, size=(14,1)) for h in headings]]
+```
+
+This `header` variable is a layout with 1 row that has a bunch of `Text` elements with the headings.
+
+### Building the Input Elements
+
+The `Input` elements are arranged in a grid. To do this we will be using a double list comprehension. One will build the row the other will add the rows together to make the grid. Here's the line of code that does that:
+
+```python
+input_rows = [[sg.Input(size=(15,1), pad=(0,0)) for col in range(4)] for row in range(10)]
+```
+
+This portion of the statement makes a single row of 4 `Input` Elements
+
+```python
+[sg.Input(size=(15,1), pad=(0,0)) for col in range(4)]
+```
+
+Next we take that list of `Input` Elements and make as many of them as there are rows, 10 in this case. We're again using Python's awesome list comprehensions to add these rows together.
+
+```python
+input_rows = [[sg.Input(size=(15,1), pad=(0,0)) for col in range(4)] for row in range(10)]
+```
+
+The first part should look familiar since it was just discussed as being what builds a single row. To make the matrix, we simply take that single row and create 10 of them, each being a list.
+
+### Putting it all together
+
+Here is our final program that uses simple addition to add the headers onto the top of the input matrix. To make it more attractive, the color theme is set to 'Dark Brown 1'.
+
+```python
+import PySimpleGUI as sg
+
+sg.theme('Dark Brown 1')
+
+headings = ['HEADER 1', 'HEADER 2', 'HEADER 3','HEADER 4']
+header = [[sg.Text(' ')] + [sg.Text(h, size=(14,1)) for h in headings]]
+
+input_rows = [[sg.Input(size=(15,1), pad=(0,0)) for col in range(4)] for row in range(10)]
+
+layout = header + input_rows
+
+window = sg.Window('Table Simulation', layout, font='Courier 12')
+event, values = window.read()
+```
+
+
+
+## User Defined Elements / Compound Elements
+
+"User Defined Elements" and "Compound Elements" are one or more PySimpleGUI Elements that are wrapped in a function definition. In a layout, they have the appearance of being a custom elements of some type.
+
+User Defined Elements are particularly useful when you set a lot of parameters on an element that you use over and over in your layout.
+
+### Example - A Grid of Buttons for Calculator App
+
+Let's say you're making a calculator application with buttons that have these settings:
+
+* font = Helvetica 20
+* size = 5,1
+* button color = white on blue
+
+The code for **one** of these buttons is:
+
+```python
+sg.Button('1', button_color=('white', 'blue'), size=(5, 1), font=("Helvetica", 20))
+```
+
+If you have 6 buttons across and 5 down, your layout will have 30 of these lines of text.
+
+One row of these buttons could be written:
+```python
+ [sg.Button('1', button_color=('white', 'blue'), size=(5, 1), font=("Helvetica", 20)),
+ sg.Button('2', button_color=('white', 'blue'), size=(5, 1), font=("Helvetica", 20)),
+ sg.Button('3', button_color=('white', 'blue'), size=(5, 1), font=("Helvetica", 20)),
+ sg.Button('log', button_color=('white', 'blue'), size=(5, 1), font=("Helvetica", 20)),
+ sg.Button('ln', button_color=('white', 'blue'), size=(5, 1), font=("Helvetica", 20)),
+ sg.Button('-', button_color=('white', 'blue'), size=(5, 1), font=("Helvetica", 20))],
+```
+
+By using User Defined Elements, you can significantly shorten your layouts. Let's call our element `CBtn`. It would be written like this:
+
+```python
+def CBtn(button_text):
+ return sg.Button(button_text, button_color=('white', 'blue'), size=(5, 1), font=("Helvetica", 20))
+```
+
+Using your new `CBtn` Element, you could rewrite the row of buttons above as:
+```python
+[CBtn('1'), CBtn('2'), CBtn('3'), CBtn('log'), CBtn('ln'), CBtn('-')],
+```
+
+See the tremendous amount of code you do not havew to write! USE this construct any time you find yourself copying an element many times.
+
+But let's not stop there.
+
+Since we've been discussing list comprehensions, let's use them to create this row. The way to do that is to make a list of the symbols that go across the row make a loop that steps through that list. The result is a list that looks like this:
+
+```python
+[CBtn(t) for t in ('1','2','3', 'log', 'ln', '-')],
+```
+
+That code produces the same list as this one we created by hand:
+
+```python
+[CBtn('1'), CBtn('2'), CBtn('3'), CBtn('log'), CBtn('ln'), CBtn('-')],
+```
+
+### Compound Elements
+
+Just like a `Button` can be returned from a User Defined Element, so can multiple Elements.
+
+Going back to the To-Do List example we did earlier, we could have defined a User Defined Element that represented a To-Do Item and this time we're adding a checkbox. A single line from this list will be:
+
+* The item # (a `Text` Element)
+* A `Checkbox` Element to indicate completed
+* An `Input` Element to type in what to do
+
+The definition of our User Element is this `ToDoItem` function. It is a single User Element that is a combination of 3 PySimpleGUI Elements.
+
+```python
+def ToDoItem(num):
+ return [sg.Text(f'{num}. '), sg.CBox(''), sg.In()]
+```
+
+This makes creating a list of 5 to-do items downright trivial when combined with the list comprehension techniques we learned earlier. Here is the code required to create 5 entries in our to-do list.
+
+```python
+layout = [ToDoItem(x) for x in range(1,6)]
+```
+
+We can then literally add on the buttons
+
+```python
+layout = [ToDoItem(x) for x in range(1,6)] + [[sg.Button('Save'), sg.Button('Exit')]]
+```
+
+And here is our final program
+```python
+import PySimpleGUI as sg
+
+def ToDoItem(num):
+ return [sg.Text(f'{num}. '), sg.CBox(''), sg.In()]
+
+layout = [ToDoItem(x) for x in range(1,6)] + [[sg.Button('Save'), sg.Button('Exit')]]
+
+window = sg.Window('To Do List Example', layout)
+event, values = window.read()
+```
+
+And the window it creates looks like this:
+
+
+
+---
+
+# Elements
+
+You will find information on Elements and all other classes and functions are located near the end of this manual. They are in 1 large section of the readme, in alphabetical order for easy lookups. This section's discussion of Elements is meant to teach you how they work. The other section has detailed call signatures and parameter definitions.
+
+"Elements" are the building blocks used to create windows. Some GUI APIs use the term "Widget" to describe these graphic elements.
+
+- Text
+- Single Line Input
+- Buttons including these types:
+ - File Browse
+ - Folder Browse
+ - Calendar picker
+ - Date Chooser
+ - Read window
+ - Close window ("Button" & all shortcut buttons)
+ - Realtime
+- Checkboxes
+- Radio Buttons
+- Listbox
+- Slider
+- Multi-line Text Input/Output
+- Multi-line Text Output (not on tkinter version)
+- Scroll-able Output
+- Vertical Separator
+- Progress Bar
+- Option Menu
+- Menu
+- ButtonMenu
+- Frame
+- Column
+- Graph
+- Image
+- Table
+- Tree
+- Tab, TabGroup
+- StatusBar
+- Pane
+- Stretch (Qt only)
+- Sizer (plain PySimpleGUI only)
+
+## Keys
+
+***Keys are a super important concept to understand in PySimpleGUI.***
+
+If you are going to do anything beyond the basic stuff with your GUI, then you need to understand keys.
+
+You can think of a "key" as a "name" for an element. Or an "identifier". It's a way for you to identify and talk about an element with the PySimpleGUI library. It's the exact same kind of key as a dictionary key. They must be unique to a window.
+
+Keys are specified when the Element is created using the `key` parameter.
+
+Keys are used in these ways:
+* Specified when creating the element
+* Returned as events. If an element causes an event, its key will be used
+* In the `values` dictionary that is returned from `window.read()`
+* To make updates (changes), to an element that's in the window
+
+After you put a key in an element's definition, the values returned from `window.read` will use that key to tell you the value. For example, if you have an input element in your layout:
+
+`Input(key='mykey')`
+
+And your read looks like this: `event, values = Read()`
+
+Then to get the input value from the read it would be: `values['mykey']`
+
+You also use the same key if you want to call Update on an element. Please see the section Updating Elements to understand that usage. To get find an element object given the element's key, you can call the window method `find_element` (also written `FindElement`, `element`), or you can use the more common lookup mechanism:
+
+```python
+window['key']
+```
+
+While you'll often see keys written as strings in examples in this document, know that keys can be ***ANYTHING***.
+
+Let's say you have a window with a grid of input elements. You could use their row and column location as a key (a tuple)
+
+`key=(row, col)`
+
+Then when you read the `values` variable that's returned to you from calling `Window.read()`, the key in the `values` variable will be whatever you used to create the element. In this case you would read the values as:
+`values[(row, col)]`
+
+Most of the time they are simple text strings. In the Demo Programs, keys are written with this convention:
+`_KEY_NAME_` (underscore at beginning and end with all caps letters) or the most recent convention is to use a dash at the beginning and end (e.g. `'-KEY_NAME-'`). You don't have to follow the convention, but it's not a bad one to follow as other users are used to seeing this format and it's easy to spot when element keys are being used.
+
+If you have an element object, to find its key, access the member variable `.Key` for the element. This assumes you've got the element in a variable already.
+
+```python
+text_elem = sg.Text('', key='-TEXT-')
+
+the_key = text_elem.Key
+```
+
+### Default Keys
+
+If you fail to place a key on an Element, then one will be created for you automatically.
+
+For `Buttons`, the text on the button is that button's key. `Text` elements will default to the text's string (for when events are enabled and the text is clicked)
+
+If the element is one of the input elements (one that will cause an generate an entry in the return values dictionary) and you fail to specify one, then a number will be assigned to it beginning with the number 0. The effect will be as if the values are represented as a list even if a dictionary is used.
+
+### Menu Keys
+
+Menu items can have keys associated with them as well. See the section on Menus for more information about these special keys. They aren't the same as Element keys. Like all elements, Menu Element have one of these Element keys. The individual menu item keys are different.
+
+## Common Element Parameters
+
+Some parameters that you will see on almost all Element creation calls include:
+
+- key - Used with window[key], events, and in return value dictionary
+- tooltip - Hover your mouse over the elemnt and you'll get a popup with this text
+- size - (width, height) - usually measured in characters-wide, rows-high. Sometimes they mean pixels
+- font - specifies the font family, size, etc
+- colors - Color name or #RRGGBB string
+- pad - Amount of padding to put around element
+- enable_events - Turns on the element specific events
+- visible - Make elements appear and disappear
+
+#### Tooltip
+
+Tooltips are text boxes that popup next to an element if you hold your mouse over the top of it. If you want to be extra kind to your window's user, then you can create tooltips for them by setting the parameter `tooltip` to some text string. You will need to supply your own line breaks / text wrapping. If you don't want to manually add them, then take a look at the standard library package `textwrap`.
+
+Tooltips are one of those "polish" items that really dress-up a GUI and show's a level of sophistication. Go ahead, impress people, throw some tooltips into your GUI. You can change the color of the background of the tooltip on the tkinter version of PySimpleGUI by setting `TOOLTIP_BACKGROUND_COLOR` to the color string of your choice. The default value for the color is:
+
+`TOOLTIP_BACKGROUND_COLOR = "#ffffe0"`
+
+#### Size
+
+Info on setting default element sizes is discussed in the Window section above.
+
+Specifies the amount of room reserved for the Element. For elements that are character based, such a Text, it is (# characters, # rows). Sometimes it is a pixel measurement such as the Image element. And sometimes a mix like on the Slider element (characters long by pixels wide).
+
+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.
+
+#### 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.
+
+The other way is to use a new parameter, `size_px`. This parameter allows you to specify the size directly in pixels. A setting of `size_px=(300,200)` will create an Element that is 300 x 200 pixels.
+
+Additionally, you can also indicate pixels using the `size` parameter, **if the size exceeds the threshold for conversion.** What does that mean? It means if your width is > 20 (`DEFAULT_PIXEL_TO_CHARS_CUTOFF`), then it is assumed you're talking pixels, not characters. However, some of the "normally large" Elements have a cutoff value of 100. These include, for example, the `Multline` and `Output` elements.
+
+If you're curious about the math used to do the character to pixels conversion, it's quite crude, but functional. The conversion is completed with the help of this variable:
+
+`DEFAULT_PIXELS_TO_CHARS_SCALING = (10,26)`
+
+The conversion simply takes your `size[0]` and multiplies by 10 and your `size[1]` and multiplies it by 26.
+
+#### 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)
+
+Anytime colors are written as a tuple in PySimpleGUI, the way to figure out which color is the background is to replace the "," with the word "on". ('white', 'red') specifies a button that is "white on red". Works anywhere there's a color tuple.
+
+#### Pad
+
+The amount of room around the element in pixels. The default value is (5,3) which means leave 5 pixels on each side of the x-axis and 3 pixels on each side of the y-axis. You can change this on a global basis using a call to SetOptions, or on an element basis.
+
+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.
+
+#### Font
+
+Specifies the font family, size, and style. Font families on Windows include:
+* Arial
+* Courier
+* Comic,
+* Fixedsys
+* Times
+* Verdana
+* Helvetica (the default I think)
+
+The fonts will vary from system to system, however, Tk 8.0 automatically maps Courier, Helvetica and Times to their corresponding native family names on all platforms. Also, font families cannot cause a font specification to fail on Tk 8.0 and greater.
+
+If you wish to leave the font family set to the default, you can put anything not a font name as the family. The PySimpleGUI Demo programs and documentation use the family 'Any' to demonstrate this fact.. You could use "default" if that's more clear to you.
+
+There are 2 formats that can be used to specify a font... a string, and a tuple
+Tuple - (family, size, styles)
+String - "Family Size Styles"
+
+To specify an underlined, Helvetica font with a size of 15 the values:
+('Helvetica', 15, 'underline italics')
+'Helvetica 15 underline italics'
+
+#### Key
+
+See the section above that has full information about keys.
+
+#### Visible
+
+Beginning in version 3.17 you can create Elements that are initially invisible that you can later make visible.
+
+To create an invisible Element, place the element in the layout like you normally would and add the parameter
+
+`visible=False`.
+
+Later when you want to make that Element visible you simply call the Element's `Update` method and pass in the parameter `visible=True`
+
+This feature works best on Qt, but does work on the tkinter version as well. The visible parameter can also be used with the Column and Frame "container" Elements.
+
+Note - Tkiner elements behave differently than Qt elements in how they arrange themselves when going from invisible to visible.
+
+Tkinet elements tend to STACK themselves.
+
+One workaround is to place the element in a Column with other elements on its row. This will hold the place of the row it is to be placed on. It will move the element to the end of the row however.
+
+If you want to not only make the element invisible, on tkinter you can call `Element.
+
+Qt elements tend to hold their place really well and the window resizes itself nicely. It is more precise and less klunky.
+
+## Shortcut Functions / Multiple Function Names
+
+Perhaps not the best idea, but one that's done none the less is the naming of methods and functions. Some of the more "Heavily Travelled Elements" (and methods/functions) have "shortcuts".
+
+In other words, I am lazy and don't like to type. The result is multiple ways to do exactly the same thing. Typically, the Demo Programs and other examples use the full name, or at least a longer name. Thankfully PyCharm will show you the same documentation regardless which you use.
+
+This enables you to code much quicker once you are used to using the SDK. The Text Element, for example, has 3 different names `Text`, `Txt` or`T`. InputText can also be written `Input` or `In` .
+
+The shortcuts aren't limited to Elements. The `Window` method `Window.FindElement` can be written as `Window.Element` because it's such a commonly used function. BUT, even that has now been shortened to `window[key]`
+
+It's an ongoing thing. If you don't stay up to date and one of the newer shortcuts is used, you'll need to simply rename that shortcut in the code. For examples Replace sg.T with sg.Text if your version doesn't have sg.T in it.
+
+## Text Element | `T == Txt == Text`
+
+Basic Element. It displays text.
+
+```python
+layout = [
+ [sg.Text('This is what a Text Element looks like')],
+ ]
+```
+
+
+
+When creating a Text Element that you will later update, make sure you reserve enough characters for the new text. When a Text Element is created without a size parameter, it is created to exactly fit the characters provided.
+
+With proportional spaced fonts (normally the default) the pixel size of one set of characters will differ from the pixel size of a different set of characters even though the set is of the same number of characters. In other words, not all letters use the same number of pixels. Look at the text you're reading right now and you will see this. An "i" takes up a less space then an "A".
+
+---
+
+## `Window.FindElement(key)` shortened to `Window[key]`
+
+There's been a fantastic leap forward in making PySimpleGUI code more compact.
+
+Instead of writing:
+```python
+window.FindElement(key).update(new_value)
+ ```
+
+You can now write it as:
+
+```python
+window[key].update(new_value)
+ ```
+
+This change has been released to PyPI for PySimpleGUI
+
+MANY Thanks is owed to the nngogol that suggested and showed me how to do this. It's an incredible find as have been many of his suggestions.
+
+## `Element.update()` -> `Element()` shortcut
+
+This has to be one of the strangest syntactical contructs I've ever written.
+
+It is best used in combination with `FindElement` (see prior section on how to shortcut `FindElement`).
+
+Normally to change an element, you "find" it, then call its `update` method. The code usually looks like this, as you saw in the previous section:
+
+```python
+window[key].update(new_value)
+```
+
+The code can be further compressed by removing the `.update` characters, resulting in this very compact looking call:
+
+```python
+window[key](new_value)
+```
+
+Yes, that's a valid statement in Python.
+
+What's happening is that the element itself is being called. You can also writing it like this:
+
+```python
+elem = sg.Text('Some text', key='-TEXT-')
+elem('new text value')
+```
+
+Side note - you can also call your `window` variable directly. If you "call" it it will actually call `Window.read`.
+
+```python
+window = sg.Window(....)
+event, values = window()
+
+# is the same as
+window = sg.Window(....)
+event, values = window.read()
+```
+
+It is confusing looking however so when used, it might be a good idea to write a comment at the end of the statement to help out the poor beginner programmer coming along behind you.
+
+Because it's such a foreign construct that someone with 1 week of Python classes will not reconize, the demos will continue to use the `.update` method.
+
+It does not have to be used in conjuction with `FindElement`. The call works on any previously made Element. Sometimes elements are created, stored into a variable and then that variable is used in the layout. For example.
+
+```python
+graph_element = sg.Graph(...... lots of parms ......)
+
+layout = [[graph_element]]
+.
+.
+.
+graph_element(background_color='blue') # this calls Graph.update for the previously defined element
+```
+
+Hopefully this isn't too confusing. Note that the methods these shortcuts replace will not be removed. You can continue to use the old constructs without changes.
+
+---
+
+### Fonts
+
+Already discussed in the common parameters section. Either string or a tuple.
+
+### Color in PySimpleGUI are in one of two formats - color name or RGB value.
+
+Individual colors are specified using either the color names as defined in tkinter or an RGB string of this format:
+
+ "#RRGGBB" or "darkblue"
+
+### `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.
+
+`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(size=(15,1), key='-TXTOUT-)` creates a `Text` Element that can hold 15 characters.
+
+### Chortcut functions
+The shorthand functions for `Text` are `Txt` and `T`
+
+### Events `enable_events`
+
+If you set the parameter `enable_events` then you will get an event if the user clicks on the Text.
+
+## Multiline Element
+This Element doubles as both an input and output Element.
+
+```python
+layout = [[sg.Multiline('This is what a Multi-line Text Element looks like', size=(45,5))]]
+```
+
+
+
+## Text Input Element | `InputText == Input == In`
+
+```python
+layout = [[sg.InputText('Default text')]]
+```
+
+
+
+---
+
+#### Note about the `do_not_clear` parameter
+
+This used to really trip people up, but don't think so anymore. The `do_not_clear` parameter is initialized when creating the InputText Element. If set to False, then the input field's contents will be erased after every `Window.Read()` call. Use this setting for when your window is an "Input Form" type of window where you want all of the fields to be erased and start over again every time.
+
+## Combo Element | `Combo == InputCombo == DropDown == Drop`
+Also known as a drop-down list. Only required parameter is the list of choices. The return value is a string matching what's visible on the GUI.
+
+```python
+layout = [[sg.Combo(['choice 1', 'choice 2'])]]
+```
+
+
+
+## Listbox Element
+The standard listbox like you'll find in most GUIs. Note that the return values from this element will be a ***list of results, not a single result***. This is because the user can select more than 1 item from the list (if you set the right mode).
+
+```python
+layout = [[sg.Listbox(values=['Listbox 1', 'Listbox 2', 'Listbox 3'], size=(30, 6))]]
+```
+
+
+
+---
+
+ListBoxes can cause a window to return from a Read call. If the flag `enable_events` is set, then when a user makes a selection, the Read immediately returns.
+
+Another way ListBoxes can cause Reads to return is if the flag bind_return_key is set. If True, then if the user presses the return key while an entry is selected, then the Read returns. Also, if this flag is set, if the user double-clicks an entry it will return from the Read.
+
+## Slider Element
+
+Sliders have a couple of slider-specific settings as well as appearance settings. Examples include the `orientation` and `range` settings.
+
+```python
+layout = [[sg.Slider(range=(1,500),
+ default_value=222,
+ size=(20,15),
+ orientation='horizontal',
+ font=('Helvetica', 12))]]
+```
+
+
+
+### Qt Sliders
+
+There is an important difference between Qt and tkinter sliders. On Qt, the slider values must be integer, not float. If you want your slider to go from 0.1 to 1.0, then make your slider go from 1 to 10 and divide by 10. It's an easy math thing to do and not a big deal. Just deal with it.... you're writing software after all. Presumably you know how to do these things. ;-)
+
+## Radio Button Element
+
+Creates one radio button that is assigned to a group of radio buttons. Only 1 of the buttons in the group can be selected at any one time.
+
+```python
+layout = [
+ [sg.Radio('My first Radio!', "RADIO1", default=True),
+ sg.Radio('My second radio!', "RADIO1")]
+]
+```
+
+
+
+## Checkbox Element | `CBox == CB == Check`
+Checkbox elements are like Radio Button elements. They return a bool indicating whether or not they are checked.
+
+```python
+layout = [[sg.Checkbox('My first Checkbox!', default=True), sg.Checkbox('My second Checkbox!')]]
+```
+
+
+## Spin Element
+An up/down spinner control. The valid values are passed in as a list.
+
+```python
+layout = [[sg.Spin([i for i in range(1,11)], initial_value=1), sg.Text('Volume level')]]
+```
+
+
+
+## Image Element
+
+Images can be placed in your window provide they are in PNG, GIF, PPM/PGM format. JPGs cannot be shown because tkinter does not naively support JPGs. You can use the Python Imaging Library (PIL) package to convert your image to PNG prior to calling PySimpleGUI if your images are in JPG format.
+
+```python
+layout = [
+ [sg.Image(r'C:\PySimpleGUI\Logos\PySimpleGUI_Logo_320.png')],
+ ]
+```
+
+
+
+You can specify an animated GIF as an image and can animate the GIF by calling `UpdateAnimation`. Exciting stuff!
+
+
+
+You can call the method without setting the `time_between_frames` value and it will show a frame and immediately move on to the next frame. This enables you to do the inter-frame timing.
+
+## Button Element
+
+Buttons are the most important element of all! They cause the majority of the action to happen. After all, it's a button press that will get you out of a window, whether it be Submit or Cancel, one way or another a button is involved in all windows. The only exception is to this is when the user closes the window using the "X" in the upper corner which means no button was involved.
+
+The Types of buttons include:
+* Folder Browse
+* File Browse
+* Files Browse
+* File SaveAs
+* File Save
+* Close window (normal button)
+* Read window
+* Realtime
+* Calendar Chooser
+* Color Chooser
+
+Close window - Normal buttons like Submit, Cancel, Yes, No, do NOT close the window... they used to. Now to close a window you need to use a CloseButton / CButton.
+
+Folder Browse - When clicked a folder browse dialog box is opened. The results of the Folder Browse dialog box are written into one of the input fields of the window.
+
+File Browse - Same as the Folder Browse except rather than choosing a folder, a single file is chosen.
+
+Calendar Chooser - Opens a graphical calendar to select a date.
+
+Color Chooser - Opens a color chooser dialog
+
+Read window - This is a window button that will read a snapshot of all of the input fields, but does not close the window after it's clicked.
+
+Realtime - This is another async window button. Normal button clicks occur after a button's click is released. Realtime buttons report a click the entire time the button is held down.
+
+Most programs will use a combination of shortcut button calls (Submit, Cancel, etc), normal Buttons which leave the windows open and CloseButtons that close the window when clicked.
+
+Sometimes there are multiple names for the same function. This is simply to make the job of the programmer quicker and easier. Or they are old names that are no longer used but kept around so that existing programs don't break.
+
+The 4 primary windows of PySimpleGUI buttons and their names are:
+
+1. `Button`= `ReadButton` = `RButton` = `ReadFormButton` (Use `Button`, others are old methods)
+2. `CloseButton` = `CButton`
+3. `RealtimeButton`
+4. `DummyButton`
+
+You will find the long-form names in the older programs. ReadButton for example.
+
+In Oct 2018, the definition of Button changed. Previously Button would CLOSE the window when clicked. It has been changed so the Button calls will leave the window open in exactly the same way as a ReadButton. They are the same calls now. To enables windows to be closed using buttons, a new button was added... `CloseButton` or `CButton`.
+
+Your PySimpleGUI program is most likely going to contain only `Button` calls. The others are generally not foundin user code.
+
+The most basic Button element call to use is `Button`
+
+```python
+layout = [[sg.Button('Ok'), sg.Button('Cancel')]]
+```
+
+
+
+You will rarely see these 2 buttons in particular written this way. Recall that PySimpleGUI is focused on YOU (which generally directly means.... less typing). As a result, the code for the above window is normally written using shortcuts found in the next section.
+
+You will typically see this instead of calls to `Button`:
+
+```python
+layout = [[sg.Ok(), sg.Cancel()]]
+```
+
+In reality `Button` is in fact being called on your behalf. Behind the scenes, `sg.Ok` and `sg.Cancel` call `Button` with the text set to `Ok` and `Cancel` and returning the results that then go into the layout. If you were to print the layout it will look identical to the first layout shown that has `Button` shown specifically in the layout.
+
+### TTK Buttons & Macs
+
+In 2019 support for ttk Buttons was added. This gets around the problem of not being able to change button colors on a Mac. There are a number of places you can control whether or not ttk buttons are used, be it on MAc or other platform.
+
+TTK Buttons and TK Buttons operate slightly differently. Button highlighting is one different. How images and text are displayed at the same time is another. You've got options now that weren't there previously. It's nice to see that Mac users can finally use the color themes.
+
+### Button Element Shortcuts
+These Pre-made buttons are some of the most important elements of all because they are used so much. They all basically do the same thing, **set the button text to match the function name and set the parameters to commonly used values**. If you find yourself needing to create a custom button often because it's not on this list, please post a request on GitHub. . They include:
+
+- OK
+- Ok
+- Submit
+- Cancel
+- Yes
+- No
+- Exit
+- Quit
+- Help
+- Save
+- SaveAs
+- Open
+
+### "Chooser" Buttons
+
+These buttons are used to show dialog boxes that choose something like a filename, date, color, etc. that are filled into an `InputText` Element (or some other "target".... see below regarding targets)
+
+- CalendarButton
+- ColorChooserButton
+- FileBrowse
+- FilesBrowse
+- FileSaveAs
+- FolderBrowse
+
+**IMPORT NOTE ABOUT SHORTCUT BUTTONS**
+Prior to release 3.11.0, these buttons closed the window. Starting with 3.11 they will not close the window. They act like RButtons (return the button text and do not close the window)
+
+If you are having trouble with these buttons closing your window, please check your installed version of PySimpleGUI by typing `pip list` at a command prompt. Prior to 3.11 these buttons close your window.
+
+Using older versions, if you want a Submit() button that does not close the window, then you would instead use RButton('Submit'). Using the new version, if you want a Submit button that closes the window like the sold Submit() call did, you would write that as `CloseButton('Submit')` or `CButton('Submit')`
+
+### Button targets
+
+The `FileBrowse`, `FolderBrowse`, `FileSaveAs` , `FilesSaveAs`, `CalendarButton`, `ColorChooserButton` buttons all fill-in values into another element located on the window. The target can be a Text Element or an InputText Element or the button itself. The location of the element is specified by the `target` variable in the function call.
+
+The Target comes in two forms.
+1. Key
+2. (row, column)
+
+Targets that are specified using a key will find its target element by using the target's key value. This is the "preferred" method.
+
+If the Target is specified using (row, column) then it utilizes a grid system. The rows in your GUI are numbered starting with 0. The target can be specified as a hard coded grid item or it can be relative to the button.
+
+The (row, col) targeting can only target elements that are in the same "container". Containers are the Window, Column and Frame Elements. A File Browse button located inside of a Column is unable to target elements outside of that Column.
+
+The default value for `target` is `(ThisRow, -1)`. `ThisRow` is a special value that tells the GUI to use the same row as the button. The Y-value of -1 means the field one value to the left of the button. For a File or Folder Browse button, the field that it fills are generally to the left of the button is most cases. (ThisRow, -1) means the Element to the left of the button, on the same row.
+
+If a value of `(None, None)` is chosen for the target, then the button itself will hold the information. Later the button can be queried for the value by using the button's key.
+
+Let's examine this window as an example:
+
+
+
+The `InputText` element is located at (1,0)... row 1, column 0. The `Browse` button is located at position (2,0). The Target for the button could be any of these values:
+
+ Target = (1,0)
+ Target = (-1,0)
+
+The code for the entire window could be:
+
+```python
+layout = [[sg.T('Source Folder')],
+ [sg.In()],
+ [sg.FolderBrowse(target=(-1, 0)), sg.OK()]]
+```
+
+or if using keys, then the code would be:
+
+```python
+layout = [[sg.T('Source Folder')],
+ [sg.In(key='input')],
+ [sg.FolderBrowse(target='input'), sg.OK()]]
+```
+
+See how much easier the key method is?
+
+#### Invisible Targets
+
+One very handy trick is to make your target invisible. This will remove the ability to edit the chosen value like you normally would be able to with an Input Element. It's a way of making things look cleaner, less cluttered too perhaps.
+
+### Save & Open Buttons
+
+There are 4 different types of File/Folder open dialog box available. If you are looking for a file to open, the `FileBrowse` is what you want. If you want to save a file, `SaveAs` is the button. If you want to get a folder name, then `FolderBrowse` is the button to use. To open several files at once, use the `FilesBrowse` button. It will create a list of files that are separated by ';'
+
+
+
+
+
+
+
+### Calendar Buttons
+
+These buttons pop up a calendar chooser window. The chosen date is returned as a string.
+
+
+
+### Color Chooser Buttons
+
+These buttons pop up a standard color chooser window. The result is returned as a tuple. One of the returned values is an RGB hex representation.
+
+
+
+### Custom Buttons
+Not all buttons are created equal. A button that closes a window is different that a button that returns from the window without closing it. If you want to define your own button, you will generally do this with the Button Element `Button`, which closes the window when clicked.
+
+```python
+layout = [[sg.Button('My Button')]]
+```
+
+
+
+All buttons can have their text changed by changing the `button_text` parameter in the button call. It is this text that is returned when a window is read. This text will be what tells you which button was clicked. However, you can also use keys on your buttons so that they will be unique. If only the text were used, you would never be able to have 2 buttons in the same window with the same text.
+
+```python
+layout = [[sg.Button('My Button', key='_BUTTON_KEY_')]]
+```
+
+With this layout, the event that is returned from a `Window.Read()` call when the button is clicked will be "`_BUTTON_KEY_`"
+
+### Button Images
+
+Now this is an exciting feature not found in many simplified packages.... images on buttons! You can make a pretty spiffy user interface with the help of a few button images.
+
+Your button images need to be in PNG or GIF format. When you make a button with an image, set the button background to the same color as the background. There's a button color TRANSPARENT_BUTTON that you can set your button color to in order for it to blend into the background. Note that this value is currently the same as the color as the default system background on Windows. If you want to set the button background color to the current system default, use the value COLOR_SYSTEM_DEFAULT as the background color.
+
+This example comes from the `Demo Media Player.py` example program. Because it's a non-blocking button, it's defined as `RButton`. You also put images on blocking buttons by using `Button`.
+
+```python
+sg.Button('Restart Song', button_color=sg.TRANSPARENT_BUTTON,
+ image_filename=image_restart, image_size=(50, 50), image_subsample=2, border_width=0)
+```
+Three parameters are used for button images.
+
+```
+image_filename - Filename. Can be a relative path
+image_size - Size of image file in pixels
+image_subsample - Amount to divide the size by. 2 means your image will be 1/2 the size. 3 means 1/3
+```
+
+Here's an example window made with button images.
+
+
+
+You'll find the source code in the file Demo Media Player. Here is what the button calls look like to create media player window
+ ```python
+sg.Button('Pause', button_color=sg.TRANSPARENT_BUTTON,
+ image_filename=image_pause,
+ image_size=(50, 50),
+ image_subsample=2,
+ border_width=0)
+```
+
+Experimentation is sometimes required for these concepts to really sink in.
+
+### Realtime Buttons
+
+Normally buttons are considered "clicked" when the mouse button is let UP after a downward click on the button. What about times when you need to read the raw up/down button values. A classic example for this is a robotic remote control. Building a remote control using a GUI is easy enough. One button for each of the directions is a start. Perhaps something like this:
+
+
+
+This window has 2 button types. There's the normal "Read Button" (Quit) and 4 "Realtime Buttons".
+
+Here is the code to make, show and get results from this window:
+
+```python
+import PySimpleGUI as sg
+
+gui_rows = [[sg.Text('Robotics Remote Control')],
+ [sg.T(' ' * 10), sg.RealtimeButton('Forward')],
+ [sg.RealtimeButton('Left'), sg.T(' ' * 15), sg.RealtimeButton('Right')],
+ [sg.T(' ' * 10), sg.RealtimeButton('Reverse')],
+ [sg.T('')],
+ [sg.Quit(button_color=('black', 'orange'))]
+ ]
+
+window = sg.Window('Robotics Remote Control', gui_rows)
+
+#
+# Some place later in your code...
+# You need to perform a Read or Refresh call on your window every now and then or
+# else it will apprear as if the program has locked up.
+#
+# your program's main loop
+while (True):
+ # This is the code that reads and updates your window
+ event, values = window.Read(timeout=50)
+ print(event)
+ if event in ('Quit', None):
+ break
+
+window.Close() # Don't forget to close your window!
+```
+
+This loop will read button values and print them. When one of the Realtime buttons is clicked, the call to `window.Read` will return a button name matching the name on the button that was depressed or the key if there was a key assigned to the button. It will continue to return values as long as the button remains depressed. Once released, the Read will return timeout events until a button is again clicked.
+
+**File Types**
+The `FileBrowse` & `SaveAs` buttons have an additional setting named `file_types`. This variable is used to filter the files shown in the file dialog box. The default value for this setting is
+
+ FileTypes=(("ALL Files", "*.*"),)
+
+This code produces a window where the Browse button only shows files of type .TXT
+
+ layout = [[sg.In() ,sg.FileBrowse(file_types=(("Text Files", "*.txt"),))]]
+
+NOTE - Mac users will not be able to use the file_types parameter. tkinter has a bug on Macs that will crash the program is a file_type is attempted so that feature had to be removed. Sorry about that!
+
+ ***The ENTER key***
+ The ENTER key is an important part of data entry for windows. There's a long tradition of the enter key being used to quickly submit windows. PySimpleGUI implements this by tying the ENTER key to the first button that closes or reads a window.
+
+The Enter Key can be "bound" to a particular button so that when the key is pressed, it causes the window to return as if the button was clicked. This is done using the `bind_return_key` parameter in the button calls.
+If there are more than 1 button on a window, the FIRST button that is of type Close window or Read window is used. First is determined by scanning the window, top to bottom and left to right.
+
+## ButtonMenu Element
+
+The ButtonMenu element produces a unique kind of effect. It's a button, that when clicked, shows you a menu. It's like clicking one of the top-level menu items on a MenuBar. As a result, the menu definition take the format of a single menu entry from a normal menu definition. A normal menu definition is a list of lists. This definition is one of those lists.
+
+```python
+ ['Menu', ['&Pause Graph', 'Menu item::optional_key']]
+```
+
+The very first string normally specifies what is shown on the menu bar. In this case, the value is **not used**. You set the text for the button using a different parameter, the `button_text` parm.
+
+One use of this element is to make a "fake menu bar" that has a colored background. Normal menu bars cannot have their background color changed. Not so with ButtonMenus.
+
+
+
+Return values for ButtonMenus are sent via the return values dictionary. If a selection is made, then an event is generated that will equal the ButtonMenu's key value. Use that key value to look up the value selected by the user. This is the same mechanism as the Menu Bar Element, but differs from the pop-up (right click) menu.
+
+## VerticalSeparator Element
+
+This element has limited usefulness and is being included more for completeness than anything else. It will draw a line between elements.
+
+It works best when placed between columns or elements that span multiple rows. If on a "normal" row with elements that are only 1 row high, then it will only span that one row.
+
+```python
+VerticalSeparator(pad=None)
+```
+
+
+
+## HorizontalSeparator Element
+
+In PySimpleGUI, the tkinter port, there is no `HorizontalSeparator` Element. One will be added as a "stub" so that code is portable. It will likely do nothing just like the `Stretch` Element.
+
+An easy way to get a horizontal line in PySimpleGUI is to use a `Text` Element that contains a line of underscores
+
+```python
+sg.Text('_'*30) # make a horizontal line stretching 30 characters
+```
+
+## ProgressBar Element
+The `ProgressBar` element is used to build custom Progress Bar windows. It is HIGHLY recommended that you use OneLineProgressMeter that provides a complete progress meter solution for you. Progress Meters are not easy to work with because the windows have to be non-blocking and they are tricky to debug.
+
+The **easiest** way to get progress meters into your code is to use the `OneLineProgressMeter` API. This consists of a pair of functions, `OneLineProgressMeter` and `OneLineProgressMeterCancel`. You can easily cancel any progress meter by calling it with the current value = max value. This will mark the meter as expired and close the window.
+You've already seen OneLineProgressMeter calls presented earlier in this readme.
+
+```python
+sg.OneLineProgressMeter('My Meter', i+1, 1000, 'key', 'Optional message')
+```
+
+The return value for `OneLineProgressMeter` is:
+`True` if meter updated correctly
+`False` if user clicked the Cancel button, closed the window, or vale reached the max value.
+
+#### Progress Meter in Your window
+Another way of using a Progress Meter with PySimpleGUI is to build a custom window with a `ProgressBar` Element in the window. You will need to run your window as a non-blocking window. When you are ready to update your progress bar, you call the `UpdateBar` method for the `ProgressBar` element itself.
+
+```python
+import PySimpleGUI as sg
+
+# layout the window
+layout = [[sg.Text('A custom progress meter')],
+ [sg.ProgressBar(1000, orientation='h', size=(20, 20), key='progressbar')],
+ [sg.Cancel()]]
+
+# create the window`
+window = sg.Window('Custom Progress Meter', layout)
+progress_bar = window['progressbar']
+# loop that would normally do something useful
+for i in range(1000):
+ # check to see if the cancel button was clicked and exit loop if clicked
+ event, values = window.read(timeout=10)
+ if event == 'Cancel' or event is None:
+ break
+ # update bar with loop value +1 so that bar eventually reaches the maximum
+ progress_bar.UpdateBar(i + 1)
+# done with loop... need to destroy the window as it's still open
+window.close()
+```
+
+
+
+## Output Element
+
+The Output Element is a re-direction of Stdout.
+
+If you are looking for a way to quickly add the ability to show scrolling text within your window, then adding an `Output` Element is about as quick and easy as it gets.
+
+**Anything "printed" will be displayed in this element.** This is the "trivial" way to show scrolling text in your window. It's as easy as dropping an Output Element into your window and then calling print as much as you want. The user will see a scrolling area of text inside their window.
+
+***IMPORTANT*** You will NOT see what you `print` until you call either `window.Read` or `window.Refresh`. If you want to immediately see what was printed, call `window.Refresh()` immediately after your print statement.
+
+```python
+Output(size=(80,20))
+```
+
+
+
+----
+
+Here's a complete solution for a chat-window using an Output Element. To display data that's received, you would to simply "print" it and it will show up in the output area. You'll find this technique used in several Demo Programs including the HowDoI application.
+
+```python
+import PySimpleGUI as sg
+
+def ChatBot():
+ layout = [[(sg.Text('This is where standard out is being routed', size=[40, 1]))],
+ [sg.Output(size=(80, 20))],
+ [sg.Multiline(size=(70, 5), enter_submits=True),
+ sg.Button('SEND', button_color=(sg.YELLOWS[0], sg.BLUES[0])),
+ sg.Button('EXIT', button_color=(sg.YELLOWS[0], sg.GREENS[0]))]]
+
+ window = sg.Window('Chat Window', layout, default_element_size=(30, 2))
+
+ # ---===--- Loop taking in user input and using it to query HowDoI web oracle --- #
+ while True:
+ event, value = window.read()
+ if event == 'SEND':
+ print(value)
+ else:
+ break
+ window.close()
+ChatBot()
+```
+
+## Column Element & Frame, Tab "Container" Elements
+
+Columns and Frames and Tabs are all "Container Elements" and behave similarly. This section focuses on Columns but can be applied elsewhere.
+
+Starting in version 2.9 you'll be able to do more complex layouts by using the Column Element. Think of a Column as a window within a window. And, yes, you can have a Column within a Column if you want.
+
+Columns are specified, like all "container elements", in exactly the same way as a window, as a list of lists.
+
+Columns are needed when you want to specify more than 1 element in a single row.
+
+For example, this layout has a single slider element that spans several rows followed by 7 `Text` and `Input` elements on the same row.
+
+
+
+Without a Column Element you can't create a layout like this. But with it, you should be able to closely match any layout created using tkinter only.
+
+```python
+
+import PySimpleGUI as sg
+
+# Demo of how columns work
+# window has on row 1 a vertical slider followed by a COLUMN with 7 rows
+# Prior to the Column element, this layout was not possible
+# Columns layouts look identical to window layouts, they are a list of lists of elements.
+
+window = sg.Window('Columns') # blank window
+
+# Column layout
+col = [[sg.Text('col Row 1')],
+ [sg.Text('col Row 2'), sg.Input('col input 1')],
+ [sg.Text('col Row 3'), sg.Input('col input 2')],
+ [sg.Text('col Row 4'), sg.Input('col input 3')],
+ [sg.Text('col Row 5'), sg.Input('col input 4')],
+ [sg.Text('col Row 6'), sg.Input('col input 5')],
+ [sg.Text('col Row 7'), sg.Input('col input 6')]]
+
+layout = [[sg.Slider(range=(1,100), default_value=10, orientation='v', size=(8,20)), sg.Column(col)],
+ [sg.In('Last input')],
+ [sg.OK()]]
+
+# Display the window and get values
+
+window = sg.Window('Compact 1-line window with column', layout)
+event, values = window.read()
+window.Close()
+
+sg.Popup(event, values, line_width=200)
+
+```
+
+### Column, Frame, Tab, Window element_justification
+
+Beginning in Release 4.3 you can set the justification for any container element. This is done through the `element_justification` parameter. This will greatly help anyone that wants to center all of their content in a window. Previously it was difficult to do these kinds of layouts, if not impossible.
+
+justify the `Column` element's row by setting the `Column`'s `justification` parameter.
+
+You can also justify the entire contents within a `Column` by using the Column's `element_justification` parameter.
+
+With these parameter's it is possible to create windows that have their contents centered. Previously this was very difficult to do.
+
+This is currently only available in the primary PySimpleGUI port.
+
+They can also be used to justify a group of elements in a particular way.
+
+Placing `Column` elements inside `Columns` elements make it possible to create a multitude of
+
+## Sizer Element
+
+New in 4.3 is the `Sizer` Element. This element is used to help create a container of a particular size. It can be placed inside of these PySimpleGUI items:
+
+* Column
+* Frame
+* Tab
+* Window
+
+The implementation of a `Sizer` is quite simple. It returns an empty `Column` element that has a pad value set to the values passed into the `Sizer`. Thus isn't not a class but rather a "Shortcut function" similar to the pre-defined Buttons.
+
+This feature is only available in the tkinter port of PySimpleGUI at the moment. A cross port is needed.
+
+----
+
+## Frame Element (Labelled Frames, Frames with a title)
+
+Frames work exactly the same way as Columns. You create layout that is then used to initialize the Frame. Like a Column element, it's a "Container Element" that holds one or more elements inside.
+
+
+
+Notice how the Frame layout looks identical to a window layout. A window works exactly the same way as a Column and a Frame. They all are "container elements" - elements that contain other elements.
+
+*These container Elements can be nested as deep as you want.* That's a pretty spiffy feature, right? Took a lot of work so be appreciative. Recursive code isn't trivial.
+
+This code creates a window with a Frame and 2 buttons.
+
+```python
+frame_layout = [
+ [sg.T('Text inside of a frame')],
+ [sg.CB('Check 1'), sg.CB('Check 2')],
+ ]
+layout = [
+ [sg.Frame('My Frame Title', frame_layout, font='Any 12', title_color='blue')],
+ [sg.Submit(), sg.Cancel()]
+ ]
+
+window = sg.Window('Frame with buttons', layout, font=("Helvetica", 12))
+```
+
+## Canvas Element
+
+In my opinion, the tkinter Canvas Widget is the most powerful of the tkinter widget. While I try my best to completely isolate the user from anything that is tkinter related, the Canvas Element is the one exception. It enables integration with a number of other packages, often with spectacular results.
+
+However, there's another way to get that power and that's through the Graph Element, an even MORE powerful Element as it uses a Canvas that you can directly access if needed. The Graph Element has a large number of drawing methods that the Canvas Element does not have. Plus, if you need to, you can access the Graph Element's "Canvas" through a member variable.
+
+### Matplotlib, Pyplot Integration
+
+**NOTE - The newest version of Matplotlib (3.1.0) no longer works with this technique. ** You must install 3.0.3 in order to use the Demo Matplotlib programs provided in the Demo Programs section.
+
+One such integration is with Matploplib and Pyplot. There is a Demo program written that you can use as a design pattern to get an understanding of how to use the Canvas Widget once you get it.
+
+ def Canvas(canvas - a tkinter canvasf if you created one. Normally not set
+ background_color - canvas color
+ size - size in pixels
+ pad - element padding for packing
+ key - key used to lookup element
+ tooltip - tooltip text)
+
+The order of operations to obtain a tkinter Canvas Widget is:
+```python
+
+ figure_x, figure_y, figure_w, figure_h = fig.bbox.bounds
+ # define the window layout
+ layout = [[sg.Text('Plot test')],
+ [sg.Canvas(size=(figure_w, figure_h), key='canvas')],
+ [sg.OK(pad=((figure_w / 2, 0), 3), size=(4, 2))]]
+
+ # create the window and show it without the plot
+ window = sg.Window('Demo Application - Embedding Matplotlib In PySimpleGUI', layout).Finalize()
+
+ # add the plot to the window
+ fig_photo = draw_figure(window['canvas'].TKCanvas, fig)
+
+ # show it all again and get buttons
+ event, values = window.read()
+```
+
+To get a tkinter Canvas Widget from PySimpleGUI, follow these steps:
+* Add Canvas Element to your window
+* Layout your window
+* Call `window.Finalize()` - this is a critical step you must not forget
+* Find the Canvas Element by looking up using key
+* Your Canvas Widget Object will be the found_element.TKCanvas
+* Draw on your canvas to your heart's content
+* Call `window.read()` - Nothing will appear on your canvas until you call Read
+
+See `Demo_Matplotlib.py` for a Recipe you can copy.
+
+### Methods & Properties
+
+TKCanvas - not a method but a property. Returns the tkinter Canvas Widget
+
+## Graph Element
+
+All you math fans will enjoy this Element... and all you non-math fans will enjoy it even more.
+
+I've found nothing to be less fun than dealing with a graphic's coordinate system from a GUI Framework. It's always upside down from what I want. (0,0) is in the upper left hand corner.... sometimes... or was it in the lower left? In short, it's a **pain in the ass**.
+
+How about the ability to get your own location of (0,0) and then using those coordinates instead of what tkinter provides? This results in a very powerful capability - working in your own units, and then displaying them in an area defined in pixels.
+
+If you've ever been frustrated with where (0,0) is located on some surface you draw on, then fear not, your frustration ends right here. You get to draw using whatever coordinate system you want. Place (0,0) anywhere you want, including not anywhere on your Graph. You could define a Graph that's all negative numbers between -2.1 and -3.5 in the X axis and -3 to -8.2 in the Y axis
+
+There are 3 values you'll need to supply the Graph Element. They are:
+
+- Size of the canvas in pixels
+- The lower left (x,y) coordinate of your coordinate system
+- The upper right (x,y) coordinate of your coordinate system
+
+After you supply those values you can scribble all of over your graph by creating Graph Figures. Graph Figures are created, and a Figure ID is obtained by calling:
+
+- DrawCircle
+- DrawLine
+- DrawPoint
+- DrawRectangle
+- DrawOval
+- DrawImage
+
+You can move your figures around on the canvas by supplying the Figure ID the **x,y delta** to move. It does not move to an absolute position, but rather an offset from where the figure is now. (Use Relocate to move to a specific location)
+
+ graph.MoveFigure(my_circle, 10, 10)
+
+You'll also use this ID to delete individual figures you've drawn:
+```python
+graph.DeleteFigure(my_circle)
+```
+
+### Mouse Events Inside Graph Elements
+
+If you have eneabled events for your Graph Element, then you can receive mouse click events. If you additionally enable `drag_submits` in your creation of the Graph Element, then you will also get events when you "DRAG" inside of a window. A "Drag" is defined as a left button down and then the mouse is moved.
+
+When a drag event happens, the event will be the Graph Element's key. The `value` returned in the values dictionary is a tuple of the (x,y) location of the mouse currently.
+
+This means you'll get a "stream" of events. If the mouse moves, you'll get at LEAST 1 and likely a lot more than 1 event.
+
+### Mouse Up Event for Drags
+
+When you've got `drag_submits` enabled, there's a sticky situation that arises.... what happens when you're done dragging and you've let go of the mouse button? How is the "Mouse Up" event relayed back to your code.
+
+The "Mouse Up" will generate an event to you with the value: `Graph_key` + `'+UP'`. Thus, if your Graph Element has a key of `'_GRAPH_'`, then the event you will receive when the mouse button is released is: `'_GRAPH_+UP'`
+
+Yea, it's a little weird, but it works. It's SIMPLE too. I recommend using the `.startswith` and `.endswith` built-ins when dealing with these kinds of string values.
+
+Here is an example of the `events` and the `values dictionary` that was generated by clicking and dragging inside of a Graph Element with the key == 'graph':
+
+```
+graph {'graph': (159, 256)}
+graph {'graph': (157, 256)}
+graph {'graph': (157, 256)}
+graph {'graph': (157, 254)}
+graph {'graph': (157, 254)}
+graph {'graph': (154, 254)}
+graph {'graph': (154, 254)}
+graph+UP {'graph': (154, 254)}
+```
+
+## Table Element
+
+Table and Tree Elements are of the most complex in PySimpleGUI. They have a lot of options and a lot of unusual characteristics.
+
+### `window.read()` return values from Table Element
+
+The values returned from a `Window.Read` call for the Table Element are a list of row numbers that are currently highlighted.
+
+### The Qt `Table.Get()` call
+
+New in **PySimpleGUIQt** is the addition of the `Table` method `Get`. This method returns the table that is currently being shown in the GUI. This method was required in order to obtain any edits the user may have made to the table.
+
+For the tkinter port, it will return the same values that was passed in when the table was created because tkinter Tables cannot be modified by the user (please file an Issue if you know a way).
+
+### Known `Table` visualization problem....
+
+There has been an elusive problem where clicking on or near the table's header caused tkinter to go crazy and resize the columns continuously as you moved the mouse.
+
+This problem has existed since the first release of the `Table` element. It was fixed in release 4.3.
+
+### Known table colors in Python 3.7.3, 3.7.4, 3.8, ?
+
+The tkinter that's been released in the past several releases of Python has a bug. Table colors of all types are not working, at all. The background of the rows never change. If that's important to you, you'll need to **downgrade** your Python version. 3.6 works really well with PySimpleGUI and tkinter.
+
+### Empty Tables
+
+If you wish to start your table as being an empty one, you will need to specify an empty table. This list comprehension will create an empty table with 15 rows and 6 columns.
+
+```python
+data = [['' for row in range(15)]for col in range(6)]
+```
+
+### Events from Tables
+
+There are two ways to get events generated from Table Element.
+`change_submits` event generated as soon as a row is clicked on
+`bind_return_key` event generate when a row is double clicked or the return key is press while on a row.
+
+## Tree Element
+
+The Tree Element and Table Element are close cousins. Many of the parameters found in the Table Element apply to Tree Elements. In particular the heading information, column widths, etc.
+
+Unlike Tables there is no standard format for trees. Thus the data structure passed to the Tree Element must be constructed. This is done using the TreeData class. The process is as follows:
+
+- Get a TreeData Object
+- "Insert" data into the tree
+- Pass the filled in TreeData object to Tree Element
+
+#### TreeData format
+```python
+def TreeData()
+def Insert(self, parent, key, text, values, icon=None)
+```
+
+To "insert" data into the tree the TreeData method Insert is called.
+
+```python
+Insert(parent_key, key, display_text, values)
+```
+
+To indicate insertion at the head of the tree, use a parent key of "". So, every top-level node in the tree will have a parent node = ""
+
+This code creates a TreeData object and populates with 3 values
+```python
+treedata = sg.TreeData()
+
+treedata.Insert("", '_A_', 'A', [1,2,3])
+treedata.Insert("", '_B_', 'B', [4,5,6])
+treedata.Insert("_A_", '_A1_', 'A1', ['can','be','anything'])
+```
+
+Note that you ***can*** use the same values for display_text and keys. The only thing you have to watch for is that you cannot repeat keys.
+
+When Reading a window the Table Element will return a list of rows that are selected by the user. The list will be empty is no rows are selected.
+
+#### Icons on Tree Entries
+
+If you wish to show an icon next to a tree item, then you specify the icon in the call to `Insert`. You pass in a filename or a Base64 bytes string using the optional `icon` parameter.
+
+Here is the result of showing an icon with a tree entry.
+
+
+
+## Tab and Tab Group Elements
+
+Tabs are another of PySimpleGUI "Container Elements". It is capable of "containing" a layout just as a window contains a layout. Other container elements include the `Column` and `Frame` elements.
+
+Just like windows and the other container elements, the `Tab` Element has a layout consisting of any desired combination of Elements in any desired layouts. You can have Tabs inside of Tabs inside of Columns inside of Windows, etc.
+
+`Tab` layouts look exactly like Window layouts, that is they are **a list of lists of Elements**.
+
+*How you place a Tab element into a window is different than all other elements.* You cannot place a Tab directly into a Window's layout.
+
+Also, tabs cannot be made invisible at this time. They have a visibily parameter but calling update will not change it.
+
+Tabs are contained in TabGroups. They are **not** placed into other layouts. To get a Tab into your window, first place the `Tab` Element into a `TabGroup` Element and then place the `TabGroup` Element into the Window layout.
+
+Let's look at this Window as an example:
+
+
+
+View of second tab:
+
+
+
+```python
+tab1_layout = [[sg.T('This is inside tab 1')]]
+
+tab2_layout = [[sg.T('This is inside tab 2')],
+ [sg.In(key='in')]]
+
+```
+The layout for the entire window looks like this:
+
+```python
+layout = [[sg.TabGroup([[sg.Tab('Tab 1', tab1_layout), sg.Tab('Tab 2', tab2_layout)]])],
+ [sg.Button('Read')]]
+```
+
+The Window layout has the TabGroup and within the tab Group are the two Tab elements.
+
+One important thing to notice about all of these container Elements and Windows layouts... they all take a "list of lists" as the layout. They all have a layout that looks like this `[[ ]]`
+
+You will want to keep this `[[ ]]` construct in your head a you're debugging your tabbed windows. It's easy to overlook one or two necessary ['s
+
+As mentioned earlier, the old-style Tabs were limited to being at the Window-level only. In other words, the tabs were equal in size to the entire window. This is not the case with the "new-style" tabs. This is why you're not going to be upset when you discover your old code no longer works with the new PySimpleGUI release. It'll be worth the few moments it'll take to convert your code.
+
+Check out what's possible with the NEW Tabs!
+
+
+
+Check out Tabs 7 and 8. We've got a Window with a Column containing Tabs 5 and 6. On Tab 6 are... Tabs 7 and 8.
+
+As of Release 3.8.0, not all of *options* shown in the API definitions of the Tab and TabGroup Elements are working. They are there as placeholders.
+
+First we have the Tab layout definitions. They mirror what you see in the screen shots. Tab 1 has 1 Text Element in it. Tab 2 has a Text and an Input Element.
+
+### Reading Tab Groups
+
+Tab Groups now return a value when a Read returns. They return which tab is currently selected. There is also a `enable_events` parameter that can be set that causes a Read to return if a Tab in that group is selected / changed. The key or title belonging to the Tab that was switched to will be returned as the value
+
+x## Pane Element
+
+New in version 3.20 is the Pane Element, a super-cool tkinter feature. You won't find this one in PySimpleGUIQt, only PySimpleGUI. It's difficult to describe one of these things. Think of them as "Tabs without labels" that you can slide.
+
+
+
+***Each "Pane" of a Pane Element must be a Column Element***. The parameter `pane_list` is a list of Column Elements.
+
+Calls can get a little hairy looking if you try to declare everything in-line as you can see in this example.
+
+```python
+sg.Pane([col5, sg.Column([[sg.Pane([col1, col2, col4], handle_size=15, orientation='v', background_color=None, show_handle=True, visible=True, key='_PANE_', border_width=0, relief=sg.RELIEF_GROOVE),]]),col3 ], orientation='h', background_color=None, size=(160,160), relief=sg.RELIEF_RAISED, border_width=0)
+```
+
+Combing these with *visibility* make for an interesting interface with entire panes being hidden from view until neded by the user. It's one way of producing "dynamic" windows.
+
+## Colors
+Starting in version 2.5 you can change the background colors for the window and the Elements.
+
+Your windows can go from this:
+
+
+
+to this... with one function call...
+
+
+
+While you can do it on an element by element or window level basis, the easier way is to use either the `theme` calls or `set_options`. These calls will set colors for all window that are created.
+
+Be aware that once you change these options they are changed for the rest of your program's execution. All of your windows will have that Theme, until you change it to something else.
+
+This call sets a number of the different color options.
+
+```python
+SetOptions(background_color='#9FB8AD',
+ text_element_background_color='#9FB8AD',
+ element_background_color='#9FB8AD',
+ scrollbar_color=None,
+ input_elements_background_color='#F7F3EC',
+ progress_meter_color = ('green', 'blue')
+ button_color=('white','#475841'))
+```
+
+# SystemTray
+
+In addition to running normal windows, it's now also possible to have an icon down in the system tray that you can read to get menu events. There is a new SystemTray object that is used much like a Window object. You first get one, then you perform Reads in order to get events.
+
+## Tkinter version
+
+While only PySimpleGUIQt and PySimpleGUIWx offer a true "system tray" feature, there is a simulated system tray feature that became available in 2020 for the tkinter version of PySimpleGUI. All of the same objects and method calls are the same and the effect is very similar to what you see with the Wx and Qt versions. The icon is placed in the bottom right corner of the window. Setting the location of it has not yet been exposed, but you can drag it to another location on your screen.
+
+The idea of supporting Wx, Qt, and tkinter with the exact same source code is very appealing and is one of the reasons a tkinter version was developed. You can switch frameworks by simply changing your import statement to any of those 3 ports.
+
+The balloons shown for the tkinter version is different than the message balloons shown by real system tray icons. Instead a nice semi-transparent window is shown. This window will fade in / out and is the same design as the one found in the [ptoaster package](https://github.com/PySimpleGUI/ptoaster).
+
+## SystemTray Object
+
+Here is the definition of the SystemTray object.
+
+```python
+SystemTray(menu=None, filename=None, data=None, data_base64=None, tooltip=None, metadata=None):
+ '''
+ SystemTray - create an icon in the system tray
+ :param menu: Menu definition
+ :param filename: filename for icon
+ :param data: in-ram image for icon
+ :param data_base64: basee-64 data for icon
+ :param tooltip: tooltip string
+ :param metadata: (Any) User metadata that can be set to ANYTHING
+'''
+```
+
+You'll notice that there are 3 different ways to specify the icon image. The base-64 parameter allows you to define a variable in your .py code that is the encoded image so that you do not need any additional files. Very handy feature.
+
+## System Tray Design Pattern
+
+Here is a design pattern you can use to get a jump-start.
+
+This program will create a system tray icon and perform a blocking Read. If the item "Open" is chosen from the system tray, then a popup is shown.
+
+The same code can be executed on any of the Desktop versions of PySimpleGUI (tkinter, Qt, WxPython)
+```python
+import PySimpleGUIQt as sg
+# import PySimpleGUIWx as sg
+# import PySimpleGUI as sg
+
+menu_def = ['BLANK', ['&Open', '---', '&Save', ['1', '2', ['a', 'b']], '&Properties', 'E&xit']]
+
+tray = sg.SystemTray(menu=menu_def, filename=r'default_icon.ico')
+
+while True: # The event loop
+ menu_item = tray.read()
+ print(menu_item)
+ if menu_item == 'Exit':
+ break
+ elif menu_item == 'Open':
+ sg.popup('Menu item chosen', menu_item)
+
+```
+The design pattern creates an icon that will display this menu:
+
+
+### Icons for System Trays
+
+System Tray Icons are in PNG & GIF format when running on PySimpleGUI (tkinter version). PNG, GIF, and ICO formats will work for the Wx and Qt ports.
+
+When specifying "icons", you can use 3 different formats.
+* `filename`- filename
+* `data_base64` - base64 byte string
+* '`data` - in-ram bitmap or other "raw" image
+
+You will find 3 parameters used to specify these 3 options on both the initialize statement and on the Update method.
+
+For testing you may find using the built-in PySimpleGUI icon is a good place to start to make sure you've got everything coded correctly before bringing in outside image assets. It'll tell you quickly if you've got a problem with your icon file. To run using the default icon, use something like this to create the System Tray:
+
+```python
+tray = sg.SystemTray(menu=menu_def, data_base64=sg.DEFAULT_BASE64_ICON)
+```
+
+## Menu Definition
+```python
+menu_def = ['BLANK', ['&Open', '&Save', ['1', '2', ['a', 'b']], '!&Properties', 'E&xit']]
+```
+
+A menu is defined using a list. A "Menu entry" is a string that specifies:
+* text shown
+* keyboard shortcut
+* key
+
+See section on Menu Keys for more information on using keys with menus.
+
+An entry without a key and keyboard shortcut is a simple string
+`'Menu Item'`
+
+If you want to make the "M" be a keyboard shortcut, place an `&` in front of the letter that is the shortcut.
+`'&Menu Item'`
+
+You can add "keys" to make menu items unique or as another way of identifying a menu item than the text shown. The key is added to the text portion by placing `::` after the text.
+
+`'Menu Item::key'`
+
+The first entry can be ignored.`'BLANK`' was chosen for this example. It's this way because normally you would specify these menus under some heading on a menu-bar. But here there is no heading so it's filled in with any value you want.
+
+**Separators**
+If you want a separator between 2 items, add the entry `'---'` and it will add a separator item at that place in your menu.
+
+**Disabled menu entries**
+
+If you want to disable a menu entry, place a `!` before the menu entry
+
+## SystemTray Methods
+
+### Read - Read the context menu or check for events
+
+```python
+def Read(timeout=None)
+ '''
+ Reads the context menu
+ :param timeout: Optional. Any value other than None indicates a non-blocking read
+ :return: String representing meny item chosen. None if nothing read.
+ '''
+```
+The `timeout` parameter specifies how long to wait for an event to take place. If nothing happens within the timeout period, then a "timeout event" is returned. These types of reads make it possible to run asynchronously. To run non-blocked, specify `timeout=0`on the Read call.
+
+Read returns the menu text, complete with key, for the menu item chosen. If you specified `Open::key` as the menu entry, and the user clicked on `Open`, then you will receive the string `Open::key` upon completion of the Read.
+
+#### Read special return values
+
+In addition to Menu Items, the Read call can return several special values. They include:
+
+EVENT_SYSTEM_TRAY_ICON_DOUBLE_CLICKED - Tray icon was double clicked
+EVENT_SYSTEM_TRAY_ICON_ACTIVATED - Tray icon was single clicked
+EVENT_SYSTEM_TRAY_MESSAGE_CLICKED - a message balloon was clicked
+TIMEOUT_KEY is returned if no events are available if the timeout value is set in the Read call
+
+### Hide
+
+Hides the icon. Note that no message balloons are shown while an icon is hidden.
+
+```python
+def Hide()
+```
+
+### Close
+
+Does the same thing as hide
+```python
+def Close()
+```
+
+### UnHide
+
+Shows a previously hidden icon
+
+```python
+def UnHide()
+```
+
+### ShowMessage
+
+Shows a balloon above the icon in the system tray area. You can specify your own icon to be shown in the balloon, or you can set `messageicon` to one of the preset values.
+
+This message has a custom icon.
+
+
+
+The preset `messageicon` values are:
+
+ SYSTEM_TRAY_MESSAGE_ICON_INFORMATION
+ SYSTEM_TRAY_MESSAGE_ICON_WARNING
+ SYSTEM_TRAY_MESSAGE_ICON_CRITICAL
+ SYSTEM_TRAY_MESSAGE_ICON_NOICON
+
+```python
+ShowMessage(title, message, filename=None, data=None, data_base64=None, messageicon=None, time=10000):
+'''
+ Shows a balloon above icon in system tray
+ :param title: Title shown in balloon
+ :param message: Message to be displayed
+ :param filename: Optional icon filename
+ :param data: Optional in-ram icon
+ :param data_base64: Optional base64 icon
+ :param time: How long to display message in milliseconds :return:
+ '''
+```
+Note, on windows it may be necessary to make a registry change to enable message balloons to be seen. To fix this, you must create the DWORD you see in this screenshot.
+
+
+
+### Update
+
+You can update any of these items within a SystemTray object
+* Menu definition
+* Icon
+* Tooltip
+
+ Change them all or just 1.
+
+### Notify Class Method
+
+In addition to being able to show messages via the system tray, the tkinter port has the added capability of being able to display the system tray messages without having a system tray object defined. You can simply show a notification window. This perhaps removes the need for using the ptoaster package?
+
+The method is a "class method" which means you can call it directly without first creating an instanciation of the object. To show a notification window, call `SystemTray.notify`.
+
+This line of code
+
+```python
+sg.SystemTray.notify('Notification Title', 'This is the notification message')
+```
+
+Will show this window, fading it in and out:
+
+
+
+This is a blocking call so expect it to take a few seconds if you're fading the window in and out. There are options to control the fade, how long things are displayed, the alpha channel, etc. See the call signature at the end of this document.
+
+# Global Settings
+
+There are multiple ways to customize PySimpleGUI. The call with the most granularity (allows access to specific and precise settings). The `ChangeLookAndFeel` call is in reality a single call to `SetOptions` where it changes 13 different settings.
+
+**Mac Users** - You can't call `ChangeLookAndFeel` but you can call `SetOptions` with any sets of values you want. Nothing is being blocked or filtered.
+
+**These settings apply to all windows that are created in the future.**
+
+ `SetOptions`. The options and Element options will take precedence over these settings. Settings can be thought of as levels of settings with the window-level being the highest and the Element-level the lowest. Thus the levels are:
+
+ - Global
+ - Window
+ - Element
+
+Each lower level overrides the settings of the higher level. Once settings have been changed, they remain changed for the duration of the program (unless changed again).
+
+# Persistent windows (Window stays open after button click)
+
+Early versions of PySimpleGUI did not have a concept of "persisent window". Once a user clicked a button, the window would close. After some time, the functionality was expanded so that windows remained open by default.
+
+## Input Fields that Auto-clear
+Note that `InputText` and `MultiLine` Elements can be **cleared** when performing a `read`. If you want your input field to be cleared after a `window.read` then you can set the `do_not_clear` parameter to False when creating those elements. The clear is turned on and off on an element by element basis.
+
+The reasoning behind this is that Persistent Windows are often "forms". When "submitting" a form you want to have all of the fields left blank so the next entry of data will start with a fresh window. Also, when implementing a "Chat Window" type of interface, after each read / send of the chat data, you want the input field cleared. Think of it as a Texting application. Would you want to have to clear your previous text if you want to send a second text?
+
+## Basic Persistent Window Design Pattern
+
+The design pattern for Persistent Windows was already shown to you earlier in the document... here it is for your convenience.
+
+```python
+import PySimpleGUI as sg
+
+layout = [[sg.Text('Persistent window')],
+ [sg.Input()],
+ [sg.Button('Read'), sg.Exit()]]
+
+window = sg.Window('Window that stays open', layout)
+
+while True:
+ event, values = window.read()
+ print(event, values)
+ if event in (None, 'Exit'):
+ break
+
+window.close()
+```
+
+## Read(timeout = t, timeout_key=TIMEOUT_KEY, close=False)
+
+Read with a timeout is a very good thing for your GUIs to use in a non-blocking read situation. If your device can wait for a little while, then use this kind of read. The longer you're able to add to the timeout value, the less CPU time you'll be taking.
+
+The idea to wait for some number of milliseconds before returning. It's a trivial way to make a window that runs on a periodic basis.
+
+One way of thinking of reads with timeouts:
+> During the timeout time, you are "yielding" the processor to do other tasks.
+
+But it gets better than just being a good citizen....**your GUI will be more responsive than if you used a non-blocking read**
+
+Let's say you had a device that you want to "poll" every 100ms. The "easy way out" and the only way out until recently was this:
+
+```python
+# YOU SHOULD NOT DO THIS....
+while True: # Event Loop
+ event, values = window.ReadNonBlocking() # DO NOT USE THIS CALL ANYMORE
+ read_my_hardware() # process my device here
+ time.sleep(.1) # sleep 1/10 second DO NOT PUT SLEEPS IN YOUR EVENT LOOP!
+```
+
+This program will quickly test for user input, then deal with the hardware. Then it'll sleep for 100ms, while your gui is non-responsive, then it'll check in with your GUI again.
+
+The better way using PySimpleGUI... using the Read Timeout mechanism, the sleep goes away.
+
+```python
+# This is the right way to poll for hardware
+while True: # Event Loop
+ event, values = window.read(timeout = 100)
+ read_my_hardware() # process my device here
+```
+
+This event loop will run every 100 ms. You're making a `read` call, so anything that the use does will return back to you immediately, and you're waiting up to 100ms for the user to do something. If the user doesn't do anything, then the read will timeout and execution will return to the program.
+
+## sg.TIMEOUT_KEY
+
+If you're using a read with a timeout value, then an event value of None signifies that the window was closed, just like a normal `window.read`. That leaves the question of what it is set to when not other events are happening. This value will be the value of `TIMEOUT_KEY`. If you did not specify a timeout_key value in your call to read, then it will be set to a default value of:
+`TIMEOUT_KEY = __timeout__`
+
+If you wanted to test for "no event" in your loop, it would be written like this:
+```python
+while True:
+ event, value = window.Read(timeout=10)
+ if event is None:
+ break # the use has closed the window
+ if event == sg.TIMEOUT_KEY:
+ print("Nothing happened")
+```
+
+Use async windows sparingly. It's possible to have a window that appears to be async, but it is not. **Please** try to find other methods before going to async windows. The reason for this plea is that async windows poll tkinter over and over. If you do not have a timeout in your Read and you've got nothing else your program will block on, then you will eat up 100% of the CPU time. It's important to be a good citizen. Don't chew up CPU cycles needlessly. Sometimes your mouse wants to move ya know?
+
+### `read(timeout=0)`
+
+You may find some PySimpleGUI programs that set the timeout value to zero. This is a very dangerous thing to do. If you do not pend on something else in your event loop, then your program will consume 100% of your CPU. Remember that today's CPUs are multi-cored. You may see only 7% of your CPU is busy when you're running with timeout of 0. This is because task manager is reporting a system-wide CPU usage. The single core your program is running on is likely at 100%.
+
+A true non-blocking (timeout=0) read is generally reserved as a "last resort". Too many times people use non-blocking reads when a blocking read will do just fine or a read with a timeout would work.
+
+It's valid to use a timeout value of zero if you're in need of every bit of CPU horsepower in your application. Maybe your loop is doing something super-CPU intensive and you can't afford for the GUI to use any CPU time. This is the kind of situation where a timeout of zero is appropriate.
+
+Be a good computing citizen. Run with a non-zero timeout so that other programs on your CPU will have time to run.
+
+### Small Timeout Values (under 10ms)
+
+***Do Not*** use a timeout of less than 10ms. Otherwise you will simply thrash, spending your time trying to do some GUI stuff, only to be interruped by a timeout timer before it can get anything done. The results are potentially disasterous.
+
+There is a hybrid approach... a read with a timeout. You'll score much higher points on the impressive meter if you're able to use a lot less CPU time by using this type of read.
+
+The most legit time to use a non-blocking window is when you're working directly with hardware. Maybe you're driving a serial bus. If you look at the Event Loop in the Demo_OpenCV_Webcam.py program, you'll see that the read is a non-blocking read. However, there is a place in the event loop where blocking occurs. The point in the loop where you will block is the call to read frames from the webcam. When a frame is available you want to quickly deliver it to the output device, so you don't want your GUI blocking. You want the read from the hardware to block.
+
+Another example can be found in the demo for controlling a robot on a Raspberry Pi. In that application you want to read the direction buttons, forward, backward, etc, and immediately take action. If you are using RealtimeButtons, your only option at the moment is to use non-blocking windows. You have to set the timeout to zero if you want the buttons to be real-time responsive.
+
+However, with these buttons, adding a sleep to your event loop will at least give other processes time to execute. It will, however, starve your GUI. The entire time you're sleeping, your GUI isn't executing.
+
+### Periodically Calling`Read`
+
+Let's say you do end up using non-blocking reads... then you've got some housekeeping to do. It's up to you to periodically "refresh" the visible GUI. The longer you wait between updates to your GUI the more sluggish your windows will feel. It is up to you to make these calls or your GUI will freeze.
+
+There are 2 methods of interacting with non-blocking windows.
+1. Read the window just as you would a normal window
+2. "Refresh" the window's values without reading the window. It's a quick operation meant to show the user the latest values
+
+ With asynchronous windows the window is shown, user input is read, but your code keeps right on chugging. YOUR responsibility is to call `PySimpleGUI.Read` on a periodic basis. Several times a second or more will produce a reasonably snappy GUI.
+
+ ## Exiting (Closing) a Persistent Window
+
+If your window has a special button that closes the window, then PySimpleGUI will automatically close the window for you. If all of your buttons are normal `Button` elements, then it'll be up to you to close the window when done.
+
+To close a window, call the `close` method.
+```python
+window.close()
+```
+
+Beginning in version 4.16.0 you can use a `close` parameter in the `window.read` call to indicate that the window should be closed before returning from the read. This capability to an excellent way to make a single line Window to quickly get information.
+
+This single line of code will display a window, get the user's input, close the window, and return the values as an event and a values dictionary.
+
+```python
+event, values = sg.Window('Login Window',
+ [[sg.T('Enter your Login ID'), sg.In(key='-ID-')],
+ [sg.B('OK'), sg.B('Cancel') ]]).read(close=True)
+
+login_id = values['-ID-']
+```
+
+You can also make a custom popup quite easily:
+
+```python
+long_string = '123456789 '* 40
+
+event, values = sg.Window('This is my customn popup',
+ [[sg.Text(long_string, size=(40,None))],
+ [sg.B('OK'), sg.B('Cancel') ]]).read(close=True)
+```
+
+Notice the height parameter of size is `None` in this case. For the tkinter port of PySimpleGUI this will cause the number of rows to "fit" the contents of the string to be displayed.
+
+## Persistent Window Example - Running timer that updates
+
+See the sample code on the GitHub named Demo Media Player for another example of Async windows. We're going to make a window and update one of the elements of that window every .01 seconds. Here's the entire code to do that.
+
+```python
+import PySimpleGUI as sg
+import time
+
+# ---------------- Create Form ----------------
+sg.ChangeLookAndFeel('Black')
+sg.SetOptions(element_padding=(0, 0))
+
+layout = [[sg.Text('')],
+ [sg.Text(size=(8, 2), font=('Helvetica', 20), justification='center', key='text')],
+ [sg.ReadButton('Pause', key='button', button_color=('white', '#001480')),
+ sg.ReadButton('Reset', button_color=('white', '#007339'), key='Reset'),
+ sg.Exit(button_color=('white', 'firebrick4'), key='Exit')]]
+
+window = sg.Window('Running Timer', layout, no_titlebar=True, auto_size_buttons=False, keep_on_top=True, grab_anywhere=True)
+
+# ---------------- main loop ----------------
+current_time = 0
+paused = False
+start_time = int(round(time.time() * 100))
+while (True):
+ # --------- Read and update window --------
+ event, values = window.Read(timeout=10)
+ current_time = int(round(time.time() * 100)) - start_time
+ # --------- Display timer in window --------
+ window['text'].update('{:02d}:{:02d}.{:02d}'.format((current_time // 100) // 60,
+ (current_time // 100) % 60,
+ current_time % 100))
+```
+
+Previously this program was implemented using a sleep in the loop to control the clock tick. This version uses the new timeout parameter. The result is a window that reacts quicker then the one with the sleep and the accuracy is just as good.
+
+## Instead of a Non-blocking Read --- Use `enable_events = True` or `return_keyboard_events = True`
+
+Any time you are thinking "I want an X Element to cause a Y Element to do something", then you want to use the `enable_events` option.
+
+***Instead of polling, try options that cause the window to return to you.*** By using non-blocking windows, you are *polling*. You can indeed create your application by polling. It will work. But you're going to be maxing out your processor and may even take longer to react to an event than if you used another technique.
+
+**Examples**
+
+One example is you have an input field that changes as you press buttons on an on-screen keypad.
+
+
+
+# Updating Elements (changing element's values in an active window)
+
+If you want to change an Element's settings in your window after the window has been created, then you will call the Element's Update method.
+
+**NOTE** a window **must be Read or Finalized** before any Update calls can be made. Also, not all settings available to you when you created the Element are available to you via its `update` method.
+
+Here is an example of updating a Text Element
+
+```python
+import PySimpleGUI as sg
+
+layout = [ [sg.Text('My layout', key='-TEXT-')],
+ [sg.Button('Read')]]
+
+window = sg.Window('My new window', layout)
+
+while True: # Event Loop
+ event, values = window.read()
+ if event is None:
+ break
+ window['-TEXT-'].update('My new text value')
+```
+
+Notice the placement of the Update call. If you wanted to Update the Text Element *prior* to the Read call, outside of the event loop, then you must call Finalize on the window first.
+
+In this example, the Update is done prior the Read. Because of this, the Finalize call is added to the Window creation.
+```python
+import PySimpleGUI as sg
+
+layout = [ [sg.Text('My layout', key='-TEXT-')],
+ [sg.Button('Read')]]
+
+window = sg.Window('My new window', layout, finalize=True)
+
+window['-TEXT-'].update('My new text value')
+
+while True: # Event Loop
+ event, values = window.read()
+ if event is None:
+ break
+```
+
+Persistent windows remain open and thus continue to interact with the user after the Read has returned. Often the program wishes to communicate results (output information) or change an Element's values (such as populating a List Element).
+
+You can use Update to do things like:
+* Have one Element (appear to) make a change to another Element
+* Disable a button, slider, input field, etc
+* Change a button's text
+* Change an Element's text or background color
+* Add text to a scrolling output window
+* Change the choices in a list
+* etc
+
+The way this is done is via an Update method that is available for nearly all of the Elements. Here is an example of a program that uses a persistent window that is updated.
+
+
+
+In some programs these updates happen in response to another Element. This program takes a Spinner and a Slider's input values and uses them to resize a Text Element. The Spinner and Slider are on the left, the Text element being changed is on the right.
+
+```python
+# Testing async window, see if can have a slider
+# that adjusts the size of text displayed
+
+import PySimpleGUI as sg
+fontSize = 12
+layout = [[sg.Spin([sz for sz in range(6, 172)], font=('Helvetica 20'), initial_value=fontSize, change_submits=True, key='spin'),
+ sg.Slider(range=(6,172), orientation='h', size=(10,20),
+ change_submits=True, key='slider', font=('Helvetica 20')),
+ sg.Text("Aa", size=(2, 1), font="Helvetica " + str(fontSize), key='text')]]
+
+sz = fontSize
+window = sg.Window("Font size selector", layout, grab_anywhere=False)
+# Event Loop
+while True:
+ event, values= window.read()
+ if event is None:
+ break
+ sz_spin = int(values['spin'])
+ sz_slider = int(values['slider'])
+ sz = sz_spin if sz_spin != fontSize else sz_slider
+ if sz != fontSize:
+ fontSize = sz
+ font = "Helvetica " + str(fontSize)
+ window['text'].update(font=font)
+ window['slider'].update(sz)
+ window['spin'].update(sz)
+
+print("Done.")
+```
+
+Inside the event loop we read the value of the Spinner and the Slider using those Elements' keys.
+For example, `values['slider']` is the value of the Slider Element.
+
+This program changes all 3 elements if either the Slider or the Spinner changes. This is done with these statements:
+
+```python
+window['text'].update(font=font)
+window['slider'].update(sz)
+window['spin'].update(sz)
+```
+
+Remember this design pattern because you will use it OFTEN if you use persistent windows.
+
+It works as follows. The expresion `window[key]` returns the Element object represented by the provided `key`. This element is then updated by calling it's `update` method. This is another example of Python's "chaining" feature. We could write this code using the long-form:
+
+ text_element = window['text']
+ text_element.update(font=font)
+
+The takeaway from this exercise is that keys are key in PySimpleGUI's design. They are used to both read the values of the window and also to identify elements. As already mentioned, they are used in a wide variety of places.
+
+### Locating Elements (FindElement == Element == Elem == [ ])
+
+The Window method call that's used to find an element is:
+`FindElement`
+or the shortened version
+`Element`
+or even shorter (version 4.1+)
+`Elem`
+
+And now it's finally shortened down to:
+window[key]
+
+You'll find the pattern - `window.Element(key)` in older code. All of code after about 4.0 uses the shortened `window[key]` notation.
+
+### ProgressBar / Progress Meters
+
+Note that to change a progress meter's progress, you call `update_bar`, not `update`. A change to this is being considered for a future release.
+
+# Keyboard & Mouse Capture
+
+NOTE - keyboard capture is currently formatted uniquely among the ports. For basic letters and numbers there is no great differences, but when you start adding Shift and Control or special keyus, they all behave slightly differently. Your best bet is to simply print what is being returned to you to determine what the format for the particular port is.
+
+Beginning in version 2.10 you can capture keyboard key presses and mouse scroll-wheel events. Keyboard keys can be used, for example, to detect the page-up and page-down keys for a PDF viewer. To use this feature, there's a boolean setting in the Window call `return_keyboard_events` that is set to True in order to get keys returned along with buttons.
+
+Keys and scroll-wheel events are returned in exactly the same way as buttons.
+
+For scroll-wheel events, if the mouse is scrolled up, then the `button` text will be `MouseWheel:Up`. For downward scrolling, the text returned is `MouseWheel:Down`
+
+Keyboard keys return 2 types of key events. For "normal" keys (a,b,c, etc), a single character is returned that represents that key. Modifier and special keys are returned as a string with 2 parts:
+
+ Key Sym:Key Code
+
+Key Sym is a string such as 'Control_L'. The Key Code is a numeric representation of that key. The left control key, when pressed will return the value 'Control_L:17'
+
+```python
+import PySimpleGUI as sg
+
+# Recipe for getting keys, one at a time as they are released
+# If want to use the space bar, then be sure and disable the "default focus"
+
+text_elem = sg.Text(size=(18, 1))
+
+layout = [[sg.Text("Press a key or scroll mouse")],
+ [text_elem],
+ [sg.Button("OK")]]
+
+window = sg.Window("Keyboard Test", layout, return_keyboard_events=True, use_default_focus=False)
+
+# ---===--- Loop taking in user input --- #
+while True:
+ event, value = window.read()
+
+ if event == "OK" or event is None:
+ print(event, "exiting")
+ break
+ text_elem.update(event)
+```
+
+You want to turn off the default focus so that there no buttons that will be selected should you press the spacebar.
+
+# Menus
+
+## MenuBar
+
+Beginning in version 3.01 you can add a MenuBar to your window. You specify the menus in much the same way as you do window layouts, with lists. Menu selections are returned as events and as of 3.17, also as in the values dictionary. The value returned will be the entire menu entry, including the key if you specified one.
+
+```python
+ menu_def = [['File', ['Open', 'Save', 'Exit',]],
+ ['Edit', ['Paste', ['Special', 'Normal',], 'Undo'],],
+ ['Help', 'About...'],]
+```
+
+
+
+Note the placement of ',' and of []. It's tricky to get the nested menus correct that implement cascading menus. See how paste has Special and Normal as a list after it. This means that Paste has a cascading menu with items Special and Normal.
+
+## Methods
+
+---
+
+To add a menu to a Window place the `Menu` or `MenuBar` element into your layout.
+
+ layout = [[sg.Menu(menu_def)]]
+
+It doesn't really matter where you place the Menu Element in your layout as it will always be located at the top of the window.
+
+When the user selects an item, it's returns as the event (along with the menu item's key if one was specified in the menu definition)
+
+## ButtonMenus
+
+Button menus were introduced in version 3.21, having been previously released in PySimpleGUIQt. They work exactly the same and are source code compatible between PySimpleGUI and PySimpleGUIQt. These types of menus take a single menu entry where a Menu Bar takes a list of menu entries.
+
+**Return values for ButtonMenus are different than Menu Bars.**
+
+You will get back the ButtonMenu's KEY as the event. To get the actual item selected, you will look it up in the values dictionary. This can be done with the expression `values[event]`
+
+## Right Click Menus
+
+Right Click Menus were introduced in version 3.21. Almost every element has a right_click_menu parameter and there is a window-level setting for rich click menu that will attach a right click menu to all elements in the window.
+
+The menu definition is the same as the button menu definition, a single menu entry.
+
+```python
+right_click_menu = ['&Right', ['Right', '!&Click', '&Menu', 'E&xit', 'Properties']]
+```
+The first string in a right click menu and a button menu is ***ignored***. It is not used. Normally you would put the string that is shown on the menu bar in that location.
+
+**Return values for right click menus are the same as MenuBars.** The value chosen is returned as the event.
+
+## Menu Shortcut keys
+You have used ALT-key in other Windows programs to navigate menus. For example Alt-F+X exits the program. The Alt-F pulls down the File menu. The X selects the entry marked Exit.
+
+The good news is that PySimpleGUI allows you to create the same kind of menus! Your program can play with the big-boys. And, it's trivial to do.
+
+All that's required is for your to add an "&" in front of the letter you want to appear with an underscore. When you hold the Alt key down you will see the menu with underlines that you marked.
+
+One other little bit of polish you can add are separators in your list. To add a line in your list of menu choices, create a menu entry that looks like this: ` '---'`
+
+This is an example Menu with underlines and a separator.
+
+```
+# ------ Menu Definition ------ #
+menu_def = [['&File', ['&Open', '&Save', '---', 'Properties', 'E&xit' ]],
+ ['&Edit', ['Paste', ['Special', 'Normal',], 'Undo'],],
+ ['&Help', '&About...'],]
+```
+ And this is the spiffy menu it produced:
+ 
+
+## Disabled Menu Entries
+
+If you want one of your menu items to be disabled, then place a '!' in front of the menu entry. To disable the Paste menu entry in the previous examples, the entry would be:
+`['!&Edit', ['Paste', ['Special', 'Normal',], 'Undo'],]`
+
+If your want to change the disabled menu item flag / character from '!' to something else, change the variable `MENU_DISABLED_CHARACTER`
+
+## Keys for Menus
+
+Beginning in version 3.17 you can add a `key` to your menu entries. The `key` value will be removed prior to be inserted into the menu. When you receive Menu events, the entire menu entry, including the `key` is returned. A key is indicated by adding `::` after a menu entry, followed by the key.
+
+To add the `key` `_MY_KEY_` to the Special menu entry, the code would be:
+
+`['&Edit', ['Paste', ['Special::_MY_KEY_', 'Normal',], 'Undo'],]`
+
+ If you want to change the characters that indicate a key follows from '::' to something else, change the variable `MENU_KEY_SEPARATOR`
+
+## The Menu Definitions
+
+Having read through the Menu section, you may have noticed that the right click menu and the button menu have a format that is a little odd as there is a part of it that is not utilized (the first very string). Perhaps the words "Not Used" should be in the examples.... But, there's a reason to retain words there that make sense.
+
+The reason for this is an architectural one, but it also has a convienence for the user. You can put the individual menu items (button and right click) into a list and you'll have a menu bar definition.
+
+This would work to make a menu bar from a series of these individual menu defintions:
+
+```python
+menu_bar = [right_click_menu_1, right_click_menu_2, button_menu_def ]
+```
+
+And, of course, the direction works the opposite too. You can take a Menu Bar definition and pull out an individual menu item to create a right click or button menu.
+
+# Running Multiple Windows
+
+This is where PySimpleGUI continues to be simple, but the problem space just went into the realm of "Complex".
+
+If you wish to run multiple windows in your event loop, then there are 2 methods for doing this.
+
+1. First window does not remain active while second window is visible
+2. First window remains active while second window is visible
+
+You will find the 2 design matters in 2 demo programs in the Demo Program area of the GitHub (http://www.PySimpleGUI.com)
+
+***Critically important***
+When creating a new window you must use a "fresh" layout every time. You cannot reuse a layout from a previous window. As a result you will see the layout for window 2 being defined inside of the larger event loop.
+
+If you have a window layout that you used with a window and you've closed the window, you cannot use the specific elements that were in that window. You must RE-CREATE your `layout` variable every time you create a new window. Read that phrase again.... You must RE-CREATE your `layout` variable every time you create a new window. That means you should have a statemenat that begins with `layout = `. Sorry to be stuck on this point, but so many people seem to have trouble following this simple instruction.
+
+## THE GOLDEN RULE OF WINDOW LAYOUTS
+
+***Thou shalt not re-use a windows's layout.... ever!***
+
+Or more explicitly put....
+
+> If you are calling `Window` then you should define your window layout in the statement just prior to the `Window` call.
+
+## Demo Programs For Multiple Windows
+
+There are several "Demo Programs" that will help you run multiple windows. Please download these programs and FOLLOW the example they have created for you.
+
+Here is ***some*** of the code patterns you'll find when looking through the demo programs.
+
+## Multi-Window Design Pattern 1 - both windows active
+
+```python
+import PySimpleGUI as sg
+
+# Design pattern 2 - First window remains active
+
+layout = [[ sg.Text('Window 1'),],
+ [sg.Input(do_not_clear=True)],
+ [sg.Text(size=(15,1), key='-OUTPUT-')],
+ [sg.Button('Launch 2'), sg.Button('Exit')]]
+
+win1 = sg.Window('Window 1', layout)
+
+win2_active = False
+while True:
+ ev1, vals1 = win1.Read(timeout=100)
+ win1['-OUTPUT-'].update(vals1[0])
+ if ev1 is None or ev1 == 'Exit':
+ break
+
+ if not win2_active and ev1 == 'Launch 2':
+ win2_active = True
+ layout2 = [[sg.Text('Window 2')],
+ [sg.Button('Exit')]]
+
+ win2 = sg.Window('Window 2', layout2)
+
+ if win2_active:
+ ev2, vals2 = win2.Read(timeout=100)
+ if ev2 is None or ev2 == 'Exit':
+ win2_active = False
+ win2.Close()
+```
+
+## Multi-Window Design Pattern 2 - only 1 active window
+
+```python
+import PySimpleGUIQt as sg
+
+# Design pattern 1 - First window does not remain active
+
+layout = [[ sg.Text('Window 1'),],
+ [sg.Input(do_not_clear=True)],
+ [sg.Text(size=(15,1), key='-OUTPUT-')],
+ [sg.Button('Launch 2')]]
+
+win1 = sg.Window('Window 1', layout)
+win2_active=False
+while True:
+ ev1, vals1 = win1.Read(timeout=100)
+ if ev1 is None:
+ break
+ win1.FindElement('-OUTPUT-').update(vals1[0])
+
+ if ev1 == 'Launch 2' and not win2_active:
+ win2_active = True
+ win1.Hide()
+ layout2 = [[sg.Text('Window 2')], # note must create a layout from scratch every time. No reuse
+ [sg.Button('Exit')]]
+
+ win2 = sg.Window('Window 2', layout2)
+ while True:
+ ev2, vals2 = win2.Read()
+ if ev2 is None or ev2 == 'Exit':
+ win2.Close()
+ win2_active = False
+ win1.UnHide()
+ break
+```
+
+---
+
+# The PySimpleGUI Debugger
+
+Listen up if you are
+* advanced programmers debugging some really hairy stuff
+* programmers from another era that like to debug this way
+* those that want to have "x-ray vision" into their code
+* asked to use debugger to gather information
+* running on a platform that lacks ANY debugger
+* debugging a problem that happens only outside of a debugger environment
+* finding yourself saying "but it works when running PyCharm"
+
+Starting on June 1, 2019, a built-in version of the debugger `imwatchingyou` has been shipping in every copy of PySimpleGUI. It's been largely downplayed to gauge whether or not the added code and the added feature and the use of a couple of keys, would mess up any users. Over 30,000 users have installed PySimpleGUI since then and there's not be a single Issue filed nor comment/complaint made, so seems safe enough to normal users... so far....
+
+So far no one has reported anything at all about the debugger. The assumption is that it is quietly lying dormant, waiting for you to press the `BREAK` or `CONTROL` + `BREAK` keys. It's odd no one has accidently done this and freaked out, logging an Issue.
+
+The plain PySimpleGUI module has a debugger builtin. For the other ports, please use the package `imwatchingyou`.
+
+## What is it? Why use it? What the heck? I already have an IDE.
+
+This debugger provides you with something unique to most typical Python developers, the ability to "see" and interact with your code, **while it is running**. You can change variable values while your code continues to run.
+
+Print statements are cool, but perhaps you're tired of seeing a printout of `event` and `values`:
+```
+Push Me {0: 'Input here'}
+Push Me {0: 'Input here'}
+Push Me {0: 'Input here'}
+```
+
+And would prefer to see this window updating continuously in the upper right corner of your display:
+
+
+
+Notice how easy it is, using this window alone, to get the location that your PySimpleGUI package is coming from ***for sure***, no guessing. Expect this window to be in your debugging future as it'll get asked for from time to time.
+
+## Preparing To Run the Debugger
+
+If your program is running with blocking `Read` calls, then you will want to add a timeout to your reads. This is because the debugger gets it's cycles by stealing a little bit of time from these async calls... but only when you have one of these debugger windows open so no bitching about wasted CPU time as there is none.
+
+Your event loop will be modified from this blocking:
+```python
+while True:
+ event, values = window.read()
+```
+
+To this non-blocking:
+```python
+while True:
+ event, values = window.Read(timeout=200)
+ if event == sg.TIMEOUT_KEY:
+ continue
+```
+
+These 3 lines will in no way change how your application looks and performs. You can do this to any PySimpleGUI app that uses a blocking read and you'll not notice a difference. The reason this is a NOP (No-operation) is that when a timeout happens, the envent will be set to `sg.TIMEOUT_KEY`. If a timeout is returned as the event, the code simply ignores it and restarts the loop by executing a `continue` statement.
+
+This timeout value of 200 means that your debugger GUI will be updated 5 times a second if nothing is happening. If this adds too much "drag" to your application, you can make the timeout larger. Try using 500 or 1000 instead of 100.
+
+### What happens if you don't add a timeout
+
+Let's say you're in a situation where a very intermettent bug has just happened and the debugger would really help you, but you don't have a timeout on your `windows.Read()` call. It's OK. Recall that the way the debugger gets its "cycles" is to borrow from your `Read` calls. What you need to do is alternate between using the debugger and then generating another pass through your event loop.
+
+Maybe it's an OK button that will cause your loop to execute again (without exiting). If so, you can use it to help move the debugger along.
+
+Yes, this is a major pain in the ass, but it's not THAT bad and compared to nothing in a time of crisis and this is potentially your "savior tool" that's going to save your ass, pressing that OK button a few times is going to look like nothing to you. You just want to dump out the value of a variable that holds an instance of your class!
+
+## A Sample Program For Us To Use
+
+Now that you understand how to add the debugger to your program, let's make a simple little program that you can use to follow these examples:
+
+```python
+import PySimpleGUI as sg
+
+window = sg.Window('Testing the Debugger', [[sg.Text('Debugger Tester'), sg.In('Input here'), sg.B('Push Me')]])
+
+while True:
+ event, values = window.Read(timeout=500)
+ if event == sg.TIMEOUT_KEY:
+ continue
+ if event is None:
+ break
+ print(event, values)
+window.Close()
+```
+
+## Debugger Windows
+
+### "Popout Debugger Window"
+
+There are 2 debugger windows. One is called the "Popout" debugger window. The Popout window displays as many currently in-scope local variables as possible. This window is not interactive. It is meant to be a frequently updated "dashboard" or "snapshot" of your variables.
+
+One "variable" shown in the popout window that is an often asked for piece of information when debugging Issues and that variable is `sg` (or whatever you named the PySimpleGUI pacakge when you did your import). The assumption is that your import is `import PySimpleGUI as sg`. If your import is different, then you'll see a different variable. The point is that it's shown here.
+
+Exiting this window is done via the little red X, **or using the rickt-click menu** which is also used as one way to launch the Main Debugger Window
+
+#### Ways of Launching the Popout Window
+
+There are 3 ways of opening the Popout window.
+
+1. Press the `BREAK` key on your keyboard.
+2. Call the function `show_debugger_popout_window(location=(x,y))`
+3. Add `Debug()` button to your layout - adds a little purple and yellow PySimpleGUI logo to your window
+
+#### When you are asked for the "Location of your PySimpleGUI package or PySimpleGUI.py file" do this
+
+If you wish to use the debugger to find the location of THIS running program's PySimpleGUI package / the PySimpleGUI.py file, then all you need to do is:
+* Press the `BREAK` key on your keyboard.
+ * This is sometimes labelled as the `Cancel` key
+ * May also have `Pause` printed on key
+ * On some US keyboards, it is located next to `Scroll Lock` and/or above `PageUp` key
+* This will open a window located in the upper right corner of your screen that looks something like this:
+
+* The information you are seeking is shown next to the `sg` in the window
+You don't need to modify your program to get this info using this technique.
+
+If your variable's value is too long and doesn't fit, then you'lll need to collect this information using the "Main Debugger Window"
+
+#### What's NOT Listed In The Popout Debugger Window
+
+The Popup window is a "Snapshot" of your local variables at the time the window was opened. This means **any variables that did not exist at the time the Popout was created will not be shown**. This window does **NOT** expand in size by adding new variables. Maybe in the future.
+
+### The "Main Debugger Window"
+
+Now we're talking serious Python debugging!
+
+Ever wish you had a `repl>>>` prompt that you could run while your program is running. Well, that's pretty much what you're getting with the PySimpleGUI debugger Main Window! Cool, huh? If you're not impressed, go get a cup of coffee and walk off that distraction in your head before carring on because we're in to some seriously cool shit here....
+
+You'll find that this window has 2 tabs, one is labelled `Variables` and the other is labelled `REPL & Watches`
+
+#### Ways of Opening the Main Debugger Window
+
+There are 3 ways to open the Main Debugger Window
+
+1. Press `Control` + `Break` on your PC keyboard
+2. From the Popout Debug Window, right click and choose `Debugger` from the right click menu
+3. From your code call `show_debugger_window(location=(x,y))`
+
+#### The "Variables" Tab of Main Debugger Window
+
+
+
+Notice the the "frame" surrounding this window is labelled "Auto Watches" in blue. Like the Popup window, this debugger window also "Watches" variables, which means continuously updates them as often as you call `Window.Read`.
+
+The maximum number of "watches" you can have any any one time is 9.
+
+##### Choosing variables to watch
+
+You can simply click "Show All Variable" button and the list of watched variables will be automatically populard by the first 9 variables it finds. Or you can click the "Choose Variables to Auto Watch" button where you can individually choose what variables, **and expressions** you wish to display.
+
+
+
+In this window we're checking checkboxes to display these variables:
+
+`event`, `sg`, `values`, `window`, `__file__`
+
+
+
+Additionally, you can see at the bottom of the window a "Custom Watch" has been defined. This can be any experession you want. Let's say you have a window with a LOT of values. Rather than looking through the `values` variable and finding the entry with the key you are looking for, the values variable's entry for a specific key is displayed.
+
+In this example the Custom Watch entered was `values[0]`. After clicking on the "OK" button, indicating the variables are chosen that we wish to watch, this is the Main window that is shown:
+
+
+
+We can see the variables we checked as well as the defined expression `values[0]`. If you leave this window open, these values with continuously be updated, on the fly, every time we call the line in our example code `window.Read(timeout=500)`. This means that the Main Debugger Window and these variables we defined will be updated every 500 milliseconds.
+
+#### The REPL & Watches Tab
+
+
+
+This tab is provided to you as a way to interact with your running program on a real-time basis.
+
+If you want to quickly look at the values of variables, nearly ANY variables, then type the information into one of the 3 spaces provided to "Watch" either variables or experessions. In this example, the variable window was typed into the first slow.
+
+***Immediately*** after typing the character 'w', the information to the right was displayed. No button needs to be clicked. You merely neeed to type in a valid experession and it will be displayed to you.... and it will be displayed on an on-going, constantly-refreshing-basis.
+
+
+
+If the area to the right of the input field is too small, then you can click on the "Detail" button and you will be shown a popup, scrolled window with all of the information displayed as if it were printed.
+
+I'm sure you've had the lovely experience of printing an object. When clicking the "Detail" button next to the `window` variable being shown, this window is shown:
+
+
+
+Oh, Python, -sigh-. I just want to see my `window` object printed.
+
+#### `Obj` Button to the Rescue!
+
+PySimpleGUI has a fun and very useful function that is discussed in the docs named `ObjToString` which takes an object and converts it's **contents** it into a nicely formatted string. This function is used to create the text output when you click the `Obj` button. The result is this instead of the tiny window shown previously:
+
+
+
+## The REPL Prompt
+
+While not **really** a Python REPL prompt, this window's `REPL >>>` prompt is meant to act as much like one as possible. Here you can enter experessions and code too.
+
+The uses for this prompt are so numerous and diverse that listing them all won't be attempted.
+
+### Your "XRay" and "Endoscope" into Your Program
+
+Think of this prompt as a way to get specific diagnostics information about your ***running*** program. It cannot be stressed enough that the power and the usefullness of this tool is in its ability to diagnose a running program, after you've already started it running.
+
+### Execute Code
+
+In addition to displaying information, getting paths to packages, finding version information, you can execute code from the PySimpleGUI Debugger's `REPL >>>` prompt. You can type in any expression as well as any **executable statement**.
+
+For example, want to see what `PopupError` looks like while you're running your program. From the REPL prompt, type:
+`sg.PopupError('This is an error popup')`
+
+The result is that you are shown a popup window with the text you supplied.
+
+### KNOW Answers to Questions About Your Program
+
+Using this runtime tool, you can be confident in the data you collect. Right?
+
+***There's no better way to find what version of a package that your program is using than to ask your program.*** This is so true. Think about it. Rather than go into PyCharm, look at your project's "Virtual Environment", follow some path to get to a window that lists packages installed for that project, get the verstion and your're done, right? Well, maybe. But are you CERTAIN your program is using THAT version of the package in question?
+
+SO MUCH time has been wasted in the past when people KNEW, for sure, what version they were running. Or, they had NO CLUE what version, or no clue to find out. There's nothing wrong with not knowing how to do something. We ALL start there. Geeez..
+
+A real world example.....
+
+## How To Use the Debugger to Find The Version Number of a Package
+
+Let's pull together everything we've learned to now and use the debugger to solve a problem that happens often and sometimes it's not at all obvious how to find the answer.
+
+We're using ***Matplotlib*** and want to find the "Version".
+
+For this example, the little 12-line program in the section "A Sample Program For Us To Use" is being used.
+
+That program does not import `matplotlib`. We have a couple of choices, we can change the code, we can can import the package from the debugger. Let's use the debgger.
+
+Pull up the Main Debugger Window by pressing `CONTROL+BREAK` keys. Then click the "REPL * Watches" tab. At the `>>>` prompt we'll first import the package by typing:
+`import matplotlib as m`
+
+The result returned from Python calls that don't return anything is the value None. You will see the command you entered in the output area followed by "None", indicating success.
+
+finally, type:
+`m.__version__`
+
+The entire set of operations is shown in this window:
+
+
+
+By convention you'll find many modules have a variable `__version__` that has the package's version number. PySimpleGUI has one. As you can see matplotlib has one. The `requests` module has this variable.
+
+For maximum compatibility, PySimpleGUI not only uses `__version__`, but also has the version contained in another variable `version` which has the version number because in some situations the `__version__` is not available but the `version` variable is avaiable.
+
+**It is recommended that you use the variable `version` to get the PySimpleGUI version** as it's so far been the most successful method.
+
+tkinter, however does NOT.... of course.... follow this convention. No, to get the tkinter version, you need to look at the variable:
+`TkVersion`
+
+Here's the output from the REPL in the debugger showing the tkinter version:
+
+```
+>>> import tkinter as t
+None
+>>> t.TkVersion
+8.6
+>>> t.__version__
+Exception module 'tkinter' has no attribute '__version__'
+```
+---
+
+# Extending PySimpleGUI
+
+PySimpleGUI doesn't and can't provide every single setting available in the underlying GUI framework. Not all tkinter options are available for a `Text` Element. Same with PySimpleGUIQt and the other ports.
+
+There are a few of reasons for this.
+
+1. Time & resource limits - The size of the PySimpleGUI development team is extremely small
+2. PySimpleGUI provides a "Unified API". This means the code is, in theory, portable across all of the PySimpleGUI ports without chaning the user's code (except for the import)
+3. PySimpleGUI is meant, by design, to be simple and cover 80% of the GUI problems.
+
+However, PySimpleGUI programs are ***not*** dead ends!! Writing PySimpleGUI code and then getting to a point where you really really feel like you need to extend the Listbox to include the ability to change the "Selected" color. Maybe that's super-critical to your project. And maybe you find out late that the base PySimpleGUI code doesn't expose that tkinter capability. Fear not! The road does continue!!
+
+## Widget Access
+
+Most of the user extensions / enhancements are at the "Element" level. You want some Element to do a trick that you cannot do using the existing PySimpleGUI APIs. It's just not possible. What to do?
+
+What you need is access to the underlying GUI framework's "Widget". The good news is that you HAVE that access ready and waiting for you, for all of the ports of PySimpleGUI, not just the tkinter one.
+
+### `Element.Widget` is The GUI Widget
+
+The class variable `Widget` contains the tkinter, Qt, WxPython, or Remi widget. With that variable you can modify that widget directly.
+
+***You must first `Read` or `Finalize` the window before accessing the `Widget` class variable***
+
+The reason for the Finalize requirement is that until a Window is Read or is Finalized it is not actually created and populated with GUI Widgets. The GUI Widgets are created when you do these 2 operations.
+
+Side note - You can stop using the `.Finalize()` call added onto your window creation and instead use the `finalize` parameter in the `Window` call.
+
+OLD WAY:
+```python
+window = sg.Window('Window Title', layout).Finalize()
+
+```
+
+THE NEW WAY:
+```python
+window = sg.Window('Window Title', layout, finalize=True)
+
+```
+
+It's cleaner and less confusing for beginners who aren't necessarily trained in how chaining calls work. Py**Simple**GUI.
+
+### Example Use of `Element.Widget`
+
+So far there have been 2 uses of this capability. One already mentioned is adding a new capability. The other way it's been used has been to fix a bug or make a workaround for a quirky behavior.
+
+A recent Issue posted was that focus was always being set on a button in a tab when you switch tabs in tkinter. The user didn't want this to happen as it was putting an ugly black line around their nicely made graphical button.
+
+There is no current way in PySimpleGUI to "disable focus" on an Element. That's essentially what was needed, the ability to tell tkinter that this widget should never get focus.
+
+There is a way to tell tkinter that a widget should not get focus. The downside is that if you use your tab key to navigate, that element will never get focus. So, it's not only blocking focus for this automatic problem, but blocking it for all uses. Of course you can still click on the button.
+
+The way through for this user was to modify the tkinter widget directly and tell it not to get focus. This was done in a single line of code:
+
+```python
+window[button_key].Widget.config(takefocus=0)
+```
+
+The absolute beauty to this solution is that tkinter does NOT need to be imported into the user's program for this statement to run. Python already know what kind of object `.Widget` is and can thus show you the various methods and class variables for that object. Most all tkinter options are strings so you don't need to import tkinter to get any enums.
+
+### Finding Your Element's Widget Type
+
+Of course, in order to call the methods or access the object's class variables, you need to know the type of the underlying Widget being used. This document could list them all, but the downside is the widget could change types (not a good thing for people using the .Widget already!). It also saves space and time in getting this documentation published and available to you.
+
+So, here's the way to get your element's widget's type:
+
+```python
+ print(type(window[your_element_key].Widget))
+```
+
+In the case of the button example above, what is printed is:
+
+``
+
+I don't think that could be any clearer. Your job at this point is to look at the tkinter documentation to see what the methods are for the tkinter `Button` widget.
+
+## Window Level Access
+
+For this one you'll need some specific variables for the time being as there is no `Window` class variable that holds the window's representation in the GUI library being used.
+
+For tkinter, at the moment, the window's root object is this:
+
+```python
+sg.Window.TKroot
+```
+
+The type will vary in PySimpleGUI. It will either be:
+`tkinter.Tk()`
+`tkinter.Toplevel()`
+
+Either way you'll access it using the same `Window` variable `sg.Window.TKroot`
+
+Watch this space in the future for the more standardized variable name for this object. It may be something like `Window.Widget` as the Elements use or something like `Window.GUIWindow`.
+
+## Binding tkiner "events"
+
+If you wish to receive events directly from tkinter, but do it in a PySimpleGUI way, then you can do that and get those events returned to you via your standard `Window.read()` call.
+
+Both the Elements and Window objects have a method called `bind`. You specify 2 parameters to this function. One is the string that is used to tell tkinter what events to bind. The other is a "key modifier" for Elements and a "key" for Windows.
+
+The `key_modifier` in the `Element.bind` call is something that is added to your key. If your key is a string, then this modifier will be appended to your key and the event will be a single string.
+
+If your element's key is not a string, then a tuple will be returned as the event
+(your_key, key_modifier)
+
+This will enable you to continue to use your weird, non-string keys. Just be aware that you'll be getting back a tuple instead of your key in these situations.
+
+The best example of when this can happen is in a Minesweeper game where each button is already a tuple of the (x,y) position of the button. Normal left clicks will return (x,y). A right click that was generated as a result of bind call will be ((x,y), key_modifier).
+
+It'll be tricky for the user to parse these events, but it's assumed you're an advanced user if you're using this capability and are also using non-string keys.
+
+There are 2 member variables that have also been added as shown in the documentation for the bind methods. This added variable contains the tkinter specific event information. In other words, the 'event' that tkinter normally sends back when a callback happens.
+
+Here is sample code that shows how to make these calls.
+
+Three events are being bound.
+
+1. Any button clicks in the window will return an event "Window Click" from window.read()
+2. Right clicking the "Go" buttons will return an event "Go+RIGHT CLICK+" from window.read()
+3. When the Input Element receives focus, an event "-IN-+FOCUS+" will be returned from window.read()
+
+```python
+import PySimpleGUI as sg
+
+sg.theme('Dark Green 2')
+
+layout = [ [sg.Text('My Window')],
+ [sg.Input(key='-IN-'), sg.Text(size=(15,1), key='-OUT-')],
+ [sg.Button('Go'), sg.Button('Exit')]
+ ]
+
+window = sg.Window('Window Title', layout, finalize=True)
+
+window['-IN-'].bind("", '+FOCUS+')
+window.bind("", 'Window Click')
+window['Go'].bind("", '+RIGHT CLICK+')
+
+while True: # Event Loop
+ event, values = window.read()
+ print(event, values)
+ if event in (None, 'Exit'):
+ break
+
+window.close(); del window
+```
+
+There is no way to "unbind" and event at this time. (sorry, didn't think of it before releasing)
+---
+
+------------------
+
+# ELEMENT AND FUNCTION CALL REFERENCE
+
+This reference section was previously intermixed with the text explanation, diagrams, code samples, etc. That was OK early on, but now that there are more Elements and more methods are being added on a fequent basis, it means that keeping this list updated is a difficult chore if it has a lot of text all around it.
+
+Hoping this is a change for the better and that users will be able to find the information they seek quicker.
+
+NOTE that this documentatiuopn section is created using the ***GitHUB released PySimpleGUI.py file***. Some of the calls may not be available to you or your port (Qt, Wx, Web). And some of the parameters may be different. We're working on adding docstrings to all the ports which will enable this kind of document to be available for each port.
+
+## Caution - Some functions / methods may be internal only yet exposed in this documenation
+
+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.
+
+Without further delay... here are all of the Elements and the Window class
+
+## Button Element
+
+ Button Element - Defines all possible buttons. The shortcuts such as Submit, FileBrowse, ... each create a Button
+
+```
+Button(button_text="",
+ button_type=7,
+ target=(None, None),
+ tooltip=None,
+ file_types=(('ALL Files', '*.*'),),
+ initial_folder=None,
+ disabled=False,
+ change_submits=False,
+ enable_events=False,
+ image_filename=None,
+ image_data=None,
+ image_size=(None, None),
+ image_subsample=None,
+ border_width=None,
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ disabled_button_color=None,
+ use_ttk_buttons=None,
+ font=None,
+ bind_return_key=False,
+ focus=False,
+ pad=None,
+ key=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | button_text | Text to be displayed on the button |
+| int | button_type | You should NOT be setting this directly. ONLY the shortcut functions set this |
+| Union[str, Tuple[int, int]] | target | key or (row,col) target for the button. Note that -1 for column means 1 element to the left of this one. The constant ThisRow is used to indicate the current row. The Button itself is a valid target for some types of button |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| Tuple[Tuple[str, str], ...] | file_types | the filetypes that will be used to match files. To indicate all files: (("ALL Files", "*.*"),). Note - NOT SUPPORTED ON MAC |
+| str | initial_folder | starting path for folders and files |
+| bool | disabled | If True button will be created disabled |
+| bool | click_submits | DO NOT USE. Only listed for backwards compat - Use enable_events instead |
+| bool | enable_events | Turns on the element specific events. If this button is a target, should it generate an event when filled in |
+| str | image_filename | image filename if there is a button image. GIFs and PNGs only. |
+| Union[bytes, str] | image_data | Raw or Base64 representation of the image to put on button. Choose either filename or data |
+| Tuple[int, int] | image_size | Size of the image in pixels (width, height) |
+| int | image_subsample | amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc |
+| int | border_width | width of border around button in pixels |
+| Tuple[int, int] | size | (width, height) of the button in characters wide, rows high |
+| bool | auto_size_button | if True the button size is sized to fit the text |
+| Tuple[str, str] | button_color | (text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green". |
+| Tuple[str, str] | disabled_button_color | colors to use when button is disabled (text, background). Use None for a color if don't want to change. Only ttk buttons support both text and background colors. tk buttons only support changing text color |
+| bool | use_ttk_buttons | True = use ttk buttons. False = do not use ttk buttons. None (Default) = use ttk buttons only if on a Mac and not with button images |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | bind_return_key | If True the return key will cause this button to be pressed |
+| bool | focus | if True, initial focus will be put on this button |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### Click
+
+Generates a click of the button as if the user clicked the button
+ Calls the tkinter invoke method for the button
+
+```python
+Click()
+```
+
+### GetText
+
+Returns the current text shown on a button
+
+`GetText()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | The text currently displayed on the button |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Button Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(text=None,
+ button_color=(None, None),
+ disabled=None,
+ image_data=None,
+ image_filename=None,
+ visible=None,
+ image_subsample=None,
+ disabled_button_color=(None, None),
+ image_size=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | text | sets button text |
+| Tuple[str, str] | button_color | (text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green" |
+| bool | disabled | disable or enable state of the element |
+| Union[bytes, str] | image_data | Raw or Base64 representation of the image to put on button. Choose either filename or data |
+| str | image_filename | image filename if there is a button image. GIFs and PNGs only. |
+| Tuple[str, str] | disabled_button_color | colors to use when button is disabled (text, background). Use None for a color if don't want to change. Only ttk buttons support both text and background colors. tk buttons only support changing text color |
+| bool | visible | control visibility of element |
+| int | image_subsample | amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc |
+| Tuple[int, int] | image_size | Size of the image in pixels (width, height) |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### click
+
+Generates a click of the button as if the user clicked the button
+ Calls the tkinter invoke method for the button
+
+```python
+click()
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### get_text
+
+Returns the current text shown on a button
+
+`get_text()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | The text currently displayed on the button |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Button Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(text=None,
+ button_color=(None, None),
+ disabled=None,
+ image_data=None,
+ image_filename=None,
+ visible=None,
+ image_subsample=None,
+ disabled_button_color=(None, None),
+ image_size=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | text | sets button text |
+| Tuple[str, str] | button_color | (text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green" |
+| bool | disabled | disable or enable state of the element |
+| Union[bytes, str] | image_data | Raw or Base64 representation of the image to put on button. Choose either filename or data |
+| str | image_filename | image filename if there is a button image. GIFs and PNGs only. |
+| Tuple[str, str] | disabled_button_color | colors to use when button is disabled (text, background). Use None for a color if don't want to change. Only ttk buttons support both text and background colors. tk buttons only support changing text color |
+| bool | visible | control visibility of element |
+| int | image_subsample | amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc |
+| Tuple[int, int] | image_size | Size of the image in pixels (width, height) |
+
+## ButtonMenu Element
+
+ The Button Menu Element. Creates a button that when clicked will show a menu similar to right click menu
+
+```
+ButtonMenu(button_text,
+ menu_def,
+ tooltip=None,
+ disabled=False,
+ image_filename=None,
+ image_data=None,
+ image_size=(None, None),
+ image_subsample=None,
+ border_width=None,
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ font=None,
+ pad=None,
+ key=None,
+ tearoff=False,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | button_text | Text to be displayed on the button |
+| List[List[str]] | menu_def | A list of lists of Menu items to show when this element is clicked. See docs for format as they are the same for all menu types |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| bool | disabled | If True button will be created disabled |
+| str | image_filename | image filename if there is a button image. GIFs and PNGs only. |
+| Union[bytes, str] | image_data | Raw or Base64 representation of the image to put on button. Choose either filename or data |
+| Tuple[int, int] | image_size | Size of the image in pixels (width, height) |
+| int | image_subsample | amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc |
+| int | border_width | width of border around button in pixels |
+| Tuple[int, int] | size | (width, height) of the button in characters wide, rows high |
+| bool | auto_size_button | if True the button size is sized to fit the text |
+| Tuple[str, str] | button_color | (text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green" |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element |
+| bool | tearoff | Determines if menus should allow them to be torn off |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### Click
+
+Generates a click of the button as if the user clicked the button
+ Calls the tkinter invoke method for the button
+
+```python
+Click()
+```
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the ButtonMenu Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(menu_definition, visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[List] | menu_definition | (New menu definition (in menu definition format) |
+| bool | visible | control visibility of element |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the ButtonMenu Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(menu_definition, visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[List] | menu_definition | (New menu definition (in menu definition format) |
+| bool | visible | control visibility of element |
+
+## Canvas Element
+
+```
+Canvas(canvas=None,
+ background_color=None,
+ size=(None, None),
+ pad=None,
+ key=None,
+ tooltip=None,
+ right_click_menu=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| (tk.Canvas) | canvas | Your own tk.Canvas if you already created it. Leave blank to create a Canvas |
+| str | background_color | color of background |
+| Tuple[int,int] | size | (width in char, height in rows) size in pixels to make canvas |
+| int | pad | Amount of padding to put around element |
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| List[List[Union[List[str],str]]] | right_click_menu | A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### TKCanvas
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### tk_canvas
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+## Checkbox Element
+
+ Checkbox Element - Displays a checkbox and text next to it
+
+```
+Checkbox(text,
+ default=False,
+ size=(None, None),
+ auto_size_text=None,
+ font=None,
+ background_color=None,
+ text_color=None,
+ change_submits=False,
+ enable_events=False,
+ disabled=False,
+ key=None,
+ pad=None,
+ tooltip=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | text | Text to display next to checkbox |
+| bool | default | Set to True if you want this checkbox initially checked |
+| Tuple[int, int] | size | (width, height) width = characters-wide, height = rows-high |
+| bool | auto_size_text | if True will size the element to match the length of the text |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | change_submits | DO NOT USE. Only listed for backwards compat - Use enable_events instead |
+| bool | enable_events | Turns on the element specific events. Checkbox events happen when an item changes |
+| bool | disabled | set disable state |
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### Get
+
+Return the current state of this checkbox
+
+`Get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | Current state of checkbox |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Checkbox Element. Must call `Window.Read` or `Window.Finalize` prior.
+Note that changing visibility may cause element to change locations when made visible after invisible
+
+```
+Update(value=None,
+ background_color=None,
+ text_color=None,
+ disabled=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | value | if True checks the checkbox, False clears it |
+| str | background_color | color of background |
+| str | text_color | color of the text. Note this also changes the color of the checkmark |
+| bool | disabled | disable or enable element |
+| bool | visible | control visibility of element |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get
+
+Return the current state of this checkbox
+
+`get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | Current state of checkbox |
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Checkbox Element. Must call `Window.Read` or `Window.Finalize` prior.
+Note that changing visibility may cause element to change locations when made visible after invisible
+
+```
+update(value=None,
+ background_color=None,
+ text_color=None,
+ disabled=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | value | if True checks the checkbox, False clears it |
+| str | background_color | color of background |
+| str | text_color | color of the text. Note this also changes the color of the checkmark |
+| bool | disabled | disable or enable element |
+| bool | visible | control visibility of element |
+
+## Column Element
+
+ A container element that is used to create a layout within your window's layout
+
+```
+Column(layout,
+ background_color=None,
+ size=(None, None),
+ pad=None,
+ scrollable=False,
+ vertical_scroll_only=False,
+ right_click_menu=None,
+ key=None,
+ visible=True,
+ justification="left",
+ element_justification="left",
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[List[Element]] | layout | Layout that will be shown in the Column container |
+| str | background_color | color of background of entire Column |
+| Tuple[int, int] | size | (width, height) size in pixels (doesn't work quite right, sometimes only 1 dimension is set by tkinter |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| bool | scrollable | if True then scrollbars will be added to the column |
+| bool | vertical_scroll_only | if Truen then no horizontal scrollbar will be shown |
+| List[List[Union[List[str],str]]] | right_click_menu | A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. |
+| any | key | Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window |
+| bool | visible | set visibility state of the element |
+| str | justification | set justification for the Column itself. Note entire row containing the Column will be affected |
+| str | element_justification | All elements inside the Column will have this justification 'left', 'right', 'center' are valid values |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### AddRow
+
+Not recommended user call. Used to add rows of Elements to the Column Element.
+
+```
+AddRow(args=*<1 or N object>)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Element] | *args | The list of elements for this row |
+
+### Layout
+
+Can use like the Window.Layout method, but it's better to use the layout parameter when creating
+
+```
+Layout(rows)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[List[Element]] | rows | The rows of Elements |
+| (Column) | **RETURN** | Used for chaining
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Column Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | visible | control visibility of element |
+
+### add_row
+
+Not recommended user call. Used to add rows of Elements to the Column Element.
+
+```
+add_row(args=*<1 or N object>)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Element] | *args | The list of elements for this row |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### layout
+
+Can use like the Window.Layout method, but it's better to use the layout parameter when creating
+
+```
+layout(rows)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[List[Element]] | rows | The rows of Elements |
+| (Column) | **RETURN** | Used for chaining
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Column Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | visible | control visibility of element |
+
+## Combo Element
+
+ ComboBox Element - A combination of a single-line input and a drop-down menu. User can type in their own value or choose from list.
+
+```
+Combo(values,
+ default_value=None,
+ size=(None, None),
+ auto_size_text=None,
+ background_color=None,
+ text_color=None,
+ change_submits=False,
+ enable_events=False,
+ disabled=False,
+ key=None,
+ pad=None,
+ tooltip=None,
+ readonly=False,
+ font=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Any] | values | values to choose. While displayed as text, the items returned are what the caller supplied, not text |
+| Any | default_value | Choice to be displayed as initial value. Must match one of values variable contents |
+| Tuple[int, int] (width, height) | size | width = characters-wide, height = rows-high |
+| bool | auto_size_text | True if element should be the same size as the contents |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | change_submits | DEPRICATED DO NOT USE. Use `enable_events` instead |
+| bool | enable_events | Turns on the element specific events. Combo event is when a choice is made |
+| bool | disabled | set disable state for element |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### Get
+
+Returns the current (right now) value of the Combo. DO NOT USE THIS AS THE NORMAL WAY OF READING A COMBO!
+You should be using values from your call to window.Read instead. Know what you're doing if you use it.
+
+`Get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | Returns the value of what is currently chosen |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Combo Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(value=None,
+ values=None,
+ set_to_index=None,
+ disabled=None,
+ readonly=None,
+ font=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | value | change which value is current selected hased on new list of previous list of choices |
+| List[Any] | values | change list of choices |
+| int | set_to_index | change selection to a particular choice starting with index = 0 |
+| bool | disabled | disable or enable state of the element |
+| bool | readonly | if True make element readonly (user cannot change any choices) |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | visible | control visibility of element |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get
+
+Returns the current (right now) value of the Combo. DO NOT USE THIS AS THE NORMAL WAY OF READING A COMBO!
+You should be using values from your call to window.Read instead. Know what you're doing if you use it.
+
+`get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | Returns the value of what is currently chosen |
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Combo Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(value=None,
+ values=None,
+ set_to_index=None,
+ disabled=None,
+ readonly=None,
+ font=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | value | change which value is current selected hased on new list of previous list of choices |
+| List[Any] | values | change list of choices |
+| int | set_to_index | change selection to a particular choice starting with index = 0 |
+| bool | disabled | disable or enable state of the element |
+| bool | readonly | if True make element readonly (user cannot change any choices) |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | visible | control visibility of element |
+
+## Frame Element
+
+ A Frame Element that contains other Elements. Encloses with a line around elements and a text label.
+
+```
+Frame(title,
+ layout,
+ title_color=None,
+ background_color=None,
+ title_location=None,
+ relief="groove",
+ size=(None, None),
+ font=None,
+ pad=None,
+ border_width=None,
+ key=None,
+ tooltip=None,
+ right_click_menu=None,
+ visible=True,
+ element_justification="left",
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | title | text that is displayed as the Frame's "label" or title |
+| List[List[Elements]] | layout | The layout to put inside the Frame |
+| str | title_color | color of the title text |
+| str | background_color | background color of the Frame |
+| enum | title_location | location to place the text title. Choices include: TITLE_LOCATION_TOP TITLE_LOCATION_BOTTOM TITLE_LOCATION_LEFT TITLE_LOCATION_RIGHT TITLE_LOCATION_TOP_LEFT TITLE_LOCATION_TOP_RIGHT TITLE_LOCATION_BOTTOM_LEFT TITLE_LOCATION_BOTTOM_RIGHT |
+| enum | relief | relief style. Values are same as other elements with reliefs. Choices include RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID |
+| Tuple[int, int] | size | (width, height) (note this parameter may not always work) |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| int | border_width | width of border around element in pixels |
+| any | key | Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| List[List[Union[List[str],str]]] | right_click_menu | A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. |
+| bool | visible | set visibility state of the element |
+| str | element_justification | All elements inside the Frame will have this justification 'left', 'right', 'center' are valid values |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### AddRow
+
+Not recommended user call. Used to add rows of Elements to the Frame Element.
+
+```
+AddRow(args=*<1 or N object>)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Element] | *args | The list of elements for this row |
+
+### Layout
+
+Can use like the Window.Layout method, but it's better to use the layout parameter when creating
+
+```
+Layout(rows)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[List[Element]] | rows | The rows of Elements |
+| (Frame) | **RETURN** | Used for chaining
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Frame Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(value=None, visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | value | New text value to show on frame |
+| bool | visible | control visibility of element |
+
+### add_row
+
+Not recommended user call. Used to add rows of Elements to the Frame Element.
+
+```
+add_row(args=*<1 or N object>)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Element] | *args | The list of elements for this row |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### layout
+
+Can use like the Window.Layout method, but it's better to use the layout parameter when creating
+
+```
+layout(rows)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[List[Element]] | rows | The rows of Elements |
+| (Frame) | **RETURN** | Used for chaining
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Frame Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(value=None, visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | value | New text value to show on frame |
+| bool | visible | control visibility of element |
+
+## Graph Element
+
+ Creates an area for you to draw on. The MAGICAL property this Element has is that you interact
+ with the element using your own coordinate system. This is an important point!! YOU define where the location
+ is for (0,0). Want (0,0) to be in the middle of the graph like a math 4-quadrant graph? No problem! Set your
+ lower left corner to be (-100,-100) and your upper right to be (100,100) and you've got yourself a graph with
+ (0,0) at the center.
+ One of THE coolest of the Elements.
+ You can also use float values. To do so, be sure and set the float_values parameter.
+ Mouse click and drag events are possible and return the (x,y) coordinates of the mouse
+ Drawing primitives return an "id" that is referenced when you want to operation on that item (e.g. to erase it)
+
+```
+Graph(canvas_size,
+ graph_bottom_left,
+ graph_top_right,
+ background_color=None,
+ pad=None,
+ change_submits=False,
+ drag_submits=False,
+ enable_events=False,
+ key=None,
+ tooltip=None,
+ right_click_menu=None,
+ visible=True,
+ float_values=False,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | canvas_size | (width, height) size of the canvas area in pixels |
+| Tuple[int, int] | graph_bottom_left | (x,y) The bottoms left corner of your coordinate system |
+| Tuple[int, int] | graph_top_right | (x,y) The top right corner of your coordinate system |
+| str | background_color | background color of the drawing area |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| bool | change_submits | * DEPRICATED DO NOT USE! Same as enable_events |
+| bool | drag_submits | if True and Events are enabled for the Graph, will report Events any time the mouse moves while button down |
+| bool | enable_events | If True then clicks on the Graph are immediately reported as an event. Use this instead of change_submits |
+| any | key | Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| List[List[Union[List[str],str]]] | right_click_menu | A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. |
+| bool | visible | set visibility state of the element (Default = True) |
+| bool | float_values | If True x,y coordinates are returned as floats, not ints |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### BringFigureToFront
+
+Changes Z-order of figures on the Graph. Brings the indicated figure to the front of all other drawn figures
+
+```
+BringFigureToFront(figure)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| int | figure | value returned by tkinter when creating the figure / drawing |
+
+### DeleteFigure
+
+Remove from the Graph the figure represented by id. The id is given to you anytime you call a drawing primitive
+
+```
+DeleteFigure(id)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| int | id | the id returned to you when calling one of the drawing methods |
+
+### DrawArc
+
+Draws different types of arcs. Uses a "bounding box" to define location
+
+```
+DrawArc(top_left,
+ bottom_right,
+ extent,
+ start_angle,
+ style=None,
+ arc_color="black",
+ line_width=1)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[Tuple[int, int], Tuple[float, float]] | top_left | the top left point of bounding rectangle |
+| Union[Tuple[int, int], Tuple[float, float]] | bottom_right | the bottom right point of bounding rectangle |
+| float | extent | Andle to end drawing. Used in conjunction with start_angle |
+| float | start_angle | Angle to begin drawing. Used in conjunction with extent |
+| str | style | Valid choices are One of these Style strings- 'pieslice', 'chord', 'arc', 'first', 'last', 'butt', 'projecting', 'round', 'bevel', 'miter' |
+| str | arc_color | color to draw arc with |
+| Union[int, None] | **RETURN** | id returned from tkinter that you'll need if you want to manipulate the arc
+
+### DrawCircle
+
+Draws a circle, cenetered at the location provided. Can set the fill and outline colors
+
+```
+DrawCircle(center_location,
+ radius,
+ fill_color=None,
+ line_color="black",
+ line_width=1)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union [Tuple[int, int], Tuple[float, float]] | center_location | Center location using USER'S coordinate system |
+| Union[int, float] | radius | Radius in user's coordinate values. |
+| str | fill_color | color of the point to draw |
+| str | line_color | color of the outer line that goes around the circle (sorry, can't set thickness) |
+| int | line_width | width of the line around the circle, the outline, in pixels |
+| Union[int, None] | **RETURN** | id returned from tkinter that you'll need if you want to manipulate the circle
+
+### DrawImage
+
+Places an image onto your canvas. It's a really important method for this element as it enables so much
+
+```
+DrawImage(filename=None,
+ data=None,
+ location=(None, None),
+ color="black",
+ font=None,
+ angle=0)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | filename | if image is in a file, path and filename for the image. (GIF and PNG only!) |
+| Union[str, bytes] | data | if image is in Base64 format or raw? format then use instead of filename |
+| Union[Tuple[int, int], Tuple[float, float]] | location | the (x,y) location to place image's top left corner |
+| str | color | text color |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| float | angle | Angle 0 to 360 to draw the text. Zero represents horizontal text |
+| Union[int, None] | **RETURN** | id returned from tkinter that you'll need if you want to manipulate the image
+
+### DrawLine
+
+Draws a line from one point to another point using USER'S coordinates. Can set the color and width of line
+
+```
+DrawLine(point_from,
+ point_to,
+ color="black",
+ width=1)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[Tuple[int, int], Tuple[float, float]] | point_from | Starting point for line |
+| Union[Tuple[int, int], Tuple[float, float]] | point_to | Ending point for line |
+| str | color | Color of the line |
+| int | width | width of line in pixels |
+| Union[int, None] | **RETURN** | id returned from tktiner or None if user closed the window. id is used when you
+
+### DrawOval
+
+Draws an oval based on coordinates in user coordinate system. Provide the location of a "bounding rectangle"
+
+```
+DrawOval(top_left,
+ bottom_right,
+ fill_color=None,
+ line_color=None,
+ line_width=1)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[Tuple[int, int], Tuple[float, float]] | top_left | the top left point of bounding rectangle |
+| Union[Tuple[int, int], Tuple[float, float]] | bottom_right | the bottom right point of bounding rectangle |
+| str | fill_color | color of the interrior |
+| str | line_color | color of outline of oval |
+| int | line_width | width of the line around the oval, the outline, in pixels |
+| Union[int, None] | **RETURN** | id returned from tkinter that you'll need if you want to manipulate the oval
+
+### DrawPoint
+
+Draws a "dot" at the point you specify using the USER'S coordinate system
+
+```
+DrawPoint(point,
+ size=2,
+ color="black")
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union [Tuple[int, int], Tuple[float, float]] | point | Center location using USER'S coordinate system |
+| Union[int, float] | size | Radius? (Or is it the diameter?) in user's coordinate values. |
+| str | color | color of the point to draw |
+| Union[int, None] | **RETURN** | id returned from tkinter that you'll need if you want to manipulate the point
+
+### DrawPolygon
+
+Draw a rectangle given 2 points. Can control the line and fill colors
+
+```
+DrawPolygon(points,
+ fill_color=None,
+ line_color=None,
+ line_width=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Union[Tuple[int, int], Tuple[float, float]]] | points | list of points that define the polygon |
+| str | fill_color | color of the interior |
+| str | line_color | color of outline |
+| int | line_width | width of the line in pixels |
+| Union[int, None] | **RETURN** | id returned from tkinter that you'll need if you want to manipulate the rectangle
+
+### DrawRectangle
+
+Draw a rectangle given 2 points. Can control the line and fill colors
+
+```
+DrawRectangle(top_left,
+ bottom_right,
+ fill_color=None,
+ line_color=None,
+ line_width=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[Tuple[int, int], Tuple[float, float]] | top_left | the top left point of rectangle |
+| Union[Tuple[int, int], Tuple[float, float]] | bottom_right | the bottom right point of rectangle |
+| str | fill_color | color of the interior |
+| str | line_color | color of outline |
+| int | line_width | width of the line in pixels |
+| Union[int, None] | **RETURN** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the rectangle
+
+### DrawText
+
+Draw some text on your graph. This is how you label graph number lines for example
+
+```
+DrawText(text,
+ location,
+ color="black",
+ font=None,
+ angle=0,
+ text_location="center")
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | text | text to display |
+| Union[Tuple[int, int], Tuple[float, float]] | location | location to place first letter |
+| str | color | text color |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| float | angle | Angle 0 to 360 to draw the text. Zero represents horizontal text |
+| enum | text_location | "anchor" location for the text. Values start with TEXT_LOCATION_ |
+| Union[int, None] | **RETURN** | id returned from tkinter that you'll need if you want to manipulate the text
+
+### Erase
+
+Erase the Graph - Removes all figures previously "drawn" using the Graph methods (e.g. DrawText)
+
+```python
+Erase()
+```
+
+### GetBoundingBox
+
+Given a figure, returns the upper left and lower right bounding box coordinates
+
+```
+GetBoundingBox(figure)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| object | figure | a previously drawing figure |
+| Union[Tuple[int, int, int, int], Tuple[float, float, float, float]] | **RETURN** | upper left x, upper left y, lower right x, lower right y
+
+### GetFiguresAtLocation
+
+Returns a list of figures located at a particular x,y location within the Graph
+
+```
+GetFiguresAtLocation(location)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[Tuple[int, int], Tuple[float, float]] | location | point to check |
+| List[int] | **RETURN** | a list of previously drawn "Figures" (returned from the drawing primitives)
+
+### Move
+
+Moves the entire drawing area (the canvas) by some delta from the current position. Units are indicated in your coordinate system indicated number of ticks in your coordinate system
+
+```
+Move(x_direction, y_direction)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[int, float] | x_direction | how far to move in the "X" direction in your coordinates |
+| Union[int, float] | y_direction | how far to move in the "Y" direction in your coordinates |
+
+### MoveFigure
+
+Moves a previously drawn figure using a "delta" from current position
+
+```
+MoveFigure(figure,
+ x_direction,
+ y_direction)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| id | figure | Previously obtained figure-id. These are returned from all Draw methods |
+| Union[int, float] | x_direction | delta to apply to position in the X direction |
+| Union[int, float] | y_direction | delta to apply to position in the Y direction |
+
+### RelocateFigure
+
+Move a previously made figure to an arbitrary (x,y) location. This differs from the Move methods because it
+uses absolute coordinates versus relative for Move
+
+```
+RelocateFigure(figure,
+ x,
+ y)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| id | figure | Previously obtained figure-id. These are returned from all Draw methods |
+| Union[int, float] | x | location on X axis (in user coords) to move the upper left corner of the figure |
+| Union[int, float] | y | location on Y axis (in user coords) to move the upper left corner of the figure |
+
+### SendFigureToBack
+
+Changes Z-order of figures on the Graph. Sends the indicated figure to the back of all other drawn figures
+
+```
+SendFigureToBack(figure)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| int | figure | value returned by tkinter when creating the figure / drawing |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### TKCanvas
+
+### Update
+
+Changes some of the settings for the Graph Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(background_color=None, visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| ??? | background_color | color of background |
+| bool | visible | control visibility of element |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### bring_figure_to_front
+
+Changes Z-order of figures on the Graph. Brings the indicated figure to the front of all other drawn figures
+
+```
+bring_figure_to_front(figure)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| int | figure | value returned by tkinter when creating the figure / drawing |
+
+### change_coordinates
+
+Changes the corrdinate system to a new one. The same 2 points in space are used to define the coorinate
+system - the bottom left and the top right values of your graph.
+
+```
+change_coordinates(graph_bottom_left, graph_top_right)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] (x,y) | graph_bottom_left | The bottoms left corner of your coordinate system |
+| Tuple[int, int] (x,y) | graph_top_right | The top right corner of your coordinate system |
+
+### delete_figure
+
+Remove from the Graph the figure represented by id. The id is given to you anytime you call a drawing primitive
+
+```
+delete_figure(id)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| int | id | the id returned to you when calling one of the drawing methods |
+
+### draw_arc
+
+Draws different types of arcs. Uses a "bounding box" to define location
+
+```
+draw_arc(top_left,
+ bottom_right,
+ extent,
+ start_angle,
+ style=None,
+ arc_color="black",
+ line_width=1)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[Tuple[int, int], Tuple[float, float]] | top_left | the top left point of bounding rectangle |
+| Union[Tuple[int, int], Tuple[float, float]] | bottom_right | the bottom right point of bounding rectangle |
+| float | extent | Andle to end drawing. Used in conjunction with start_angle |
+| float | start_angle | Angle to begin drawing. Used in conjunction with extent |
+| str | style | Valid choices are One of these Style strings- 'pieslice', 'chord', 'arc', 'first', 'last', 'butt', 'projecting', 'round', 'bevel', 'miter' |
+| str | arc_color | color to draw arc with |
+| Union[int, None] | **RETURN** | id returned from tkinter that you'll need if you want to manipulate the arc
+
+### draw_circle
+
+Draws a circle, cenetered at the location provided. Can set the fill and outline colors
+
+```
+draw_circle(center_location,
+ radius,
+ fill_color=None,
+ line_color="black",
+ line_width=1)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union [Tuple[int, int], Tuple[float, float]] | center_location | Center location using USER'S coordinate system |
+| Union[int, float] | radius | Radius in user's coordinate values. |
+| str | fill_color | color of the point to draw |
+| str | line_color | color of the outer line that goes around the circle (sorry, can't set thickness) |
+| int | line_width | width of the line around the circle, the outline, in pixels |
+| Union[int, None] | **RETURN** | id returned from tkinter that you'll need if you want to manipulate the circle
+
+### draw_image
+
+Places an image onto your canvas. It's a really important method for this element as it enables so much
+
+```
+draw_image(filename=None,
+ data=None,
+ location=(None, None),
+ color="black",
+ font=None,
+ angle=0)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | filename | if image is in a file, path and filename for the image. (GIF and PNG only!) |
+| Union[str, bytes] | data | if image is in Base64 format or raw? format then use instead of filename |
+| Union[Tuple[int, int], Tuple[float, float]] | location | the (x,y) location to place image's top left corner |
+| str | color | text color |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| float | angle | Angle 0 to 360 to draw the text. Zero represents horizontal text |
+| Union[int, None] | **RETURN** | id returned from tkinter that you'll need if you want to manipulate the image
+
+### draw_line
+
+Draws a line from one point to another point using USER'S coordinates. Can set the color and width of line
+
+```
+draw_line(point_from,
+ point_to,
+ color="black",
+ width=1)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[Tuple[int, int], Tuple[float, float]] | point_from | Starting point for line |
+| Union[Tuple[int, int], Tuple[float, float]] | point_to | Ending point for line |
+| str | color | Color of the line |
+| int | width | width of line in pixels |
+| Union[int, None] | **RETURN** | id returned from tktiner or None if user closed the window. id is used when you
+
+### draw_oval
+
+Draws an oval based on coordinates in user coordinate system. Provide the location of a "bounding rectangle"
+
+```
+draw_oval(top_left,
+ bottom_right,
+ fill_color=None,
+ line_color=None,
+ line_width=1)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[Tuple[int, int], Tuple[float, float]] | top_left | the top left point of bounding rectangle |
+| Union[Tuple[int, int], Tuple[float, float]] | bottom_right | the bottom right point of bounding rectangle |
+| str | fill_color | color of the interrior |
+| str | line_color | color of outline of oval |
+| int | line_width | width of the line around the oval, the outline, in pixels |
+| Union[int, None] | **RETURN** | id returned from tkinter that you'll need if you want to manipulate the oval
+
+### draw_point
+
+Draws a "dot" at the point you specify using the USER'S coordinate system
+
+```
+draw_point(point,
+ size=2,
+ color="black")
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union [Tuple[int, int], Tuple[float, float]] | point | Center location using USER'S coordinate system |
+| Union[int, float] | size | Radius? (Or is it the diameter?) in user's coordinate values. |
+| str | color | color of the point to draw |
+| Union[int, None] | **RETURN** | id returned from tkinter that you'll need if you want to manipulate the point
+
+### draw_polygon
+
+Draw a rectangle given 2 points. Can control the line and fill colors
+
+```
+draw_polygon(points,
+ fill_color=None,
+ line_color=None,
+ line_width=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Union[Tuple[int, int], Tuple[float, float]]] | points | list of points that define the polygon |
+| str | fill_color | color of the interior |
+| str | line_color | color of outline |
+| int | line_width | width of the line in pixels |
+| Union[int, None] | **RETURN** | id returned from tkinter that you'll need if you want to manipulate the rectangle
+
+### draw_rectangle
+
+Draw a rectangle given 2 points. Can control the line and fill colors
+
+```
+draw_rectangle(top_left,
+ bottom_right,
+ fill_color=None,
+ line_color=None,
+ line_width=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[Tuple[int, int], Tuple[float, float]] | top_left | the top left point of rectangle |
+| Union[Tuple[int, int], Tuple[float, float]] | bottom_right | the bottom right point of rectangle |
+| str | fill_color | color of the interior |
+| str | line_color | color of outline |
+| int | line_width | width of the line in pixels |
+| Union[int, None] | **RETURN** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the rectangle
+
+### draw_text
+
+Draw some text on your graph. This is how you label graph number lines for example
+
+```
+draw_text(text,
+ location,
+ color="black",
+ font=None,
+ angle=0,
+ text_location="center")
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | text | text to display |
+| Union[Tuple[int, int], Tuple[float, float]] | location | location to place first letter |
+| str | color | text color |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| float | angle | Angle 0 to 360 to draw the text. Zero represents horizontal text |
+| enum | text_location | "anchor" location for the text. Values start with TEXT_LOCATION_ |
+| Union[int, None] | **RETURN** | id returned from tkinter that you'll need if you want to manipulate the text
+
+### erase
+
+Erase the Graph - Removes all figures previously "drawn" using the Graph methods (e.g. DrawText)
+
+```python
+erase()
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_bounding_box
+
+Given a figure, returns the upper left and lower right bounding box coordinates
+
+```
+get_bounding_box(figure)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| object | figure | a previously drawing figure |
+| Union[Tuple[int, int, int, int], Tuple[float, float, float, float]] | **RETURN** | upper left x, upper left y, lower right x, lower right y
+
+### get_figures_at_location
+
+Returns a list of figures located at a particular x,y location within the Graph
+
+```
+get_figures_at_location(location)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[Tuple[int, int], Tuple[float, float]] | location | point to check |
+| List[int] | **RETURN** | a list of previously drawn "Figures" (returned from the drawing primitives)
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### move
+
+Moves the entire drawing area (the canvas) by some delta from the current position. Units are indicated in your coordinate system indicated number of ticks in your coordinate system
+
+```
+move(x_direction, y_direction)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[int, float] | x_direction | how far to move in the "X" direction in your coordinates |
+| Union[int, float] | y_direction | how far to move in the "Y" direction in your coordinates |
+
+### move_figure
+
+Moves a previously drawn figure using a "delta" from current position
+
+```
+move_figure(figure,
+ x_direction,
+ y_direction)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| id | figure | Previously obtained figure-id. These are returned from all Draw methods |
+| Union[int, float] | x_direction | delta to apply to position in the X direction |
+| Union[int, float] | y_direction | delta to apply to position in the Y direction |
+
+### relocate_figure
+
+Move a previously made figure to an arbitrary (x,y) location. This differs from the Move methods because it
+uses absolute coordinates versus relative for Move
+
+```
+relocate_figure(figure,
+ x,
+ y)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| id | figure | Previously obtained figure-id. These are returned from all Draw methods |
+| Union[int, float] | x | location on X axis (in user coords) to move the upper left corner of the figure |
+| Union[int, float] | y | location on Y axis (in user coords) to move the upper left corner of the figure |
+
+### send_figure_to_back
+
+Changes Z-order of figures on the Graph. Sends the indicated figure to the back of all other drawn figures
+
+```
+send_figure_to_back(figure)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| int | figure | value returned by tkinter when creating the figure / drawing |
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### tk_canvas
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Graph Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(background_color=None, visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| ??? | background_color | color of background |
+| bool | visible | control visibility of element |
+
+## Image Element
+
+ Image Element - show an image in the window. Should be a GIF or a PNG only
+
+```
+Image(filename=None,
+ data=None,
+ background_color=None,
+ size=(None, None),
+ pad=None,
+ key=None,
+ tooltip=None,
+ right_click_menu=None,
+ visible=True,
+ enable_events=False,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | filename | image filename if there is a button image. GIFs and PNGs only. |
+| Union[bytes, str] | data | Raw or Base64 representation of the image to put on button. Choose either filename or data |
+| | background_color | color of background |
+| Tuple[int, int] | size | (width, height) size of image in pixels |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| List[List[Union[List[str],str]]] | right_click_menu | A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. |
+| bool | visible | set visibility state of the element |
+| bool | enable_events | Turns on the element specific events. For an Image element, the event is "image clicked" |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Image Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(filename=None,
+ data=None,
+ size=(None, None),
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | filename | filename to the new image to display. |
+| Union[str, tkPhotoImage] | data | Base64 encoded string OR a tk.PhotoImage object |
+| Tuple[int,int] | size | size of a image (w,h) w=characters-wide, h=rows-high |
+| bool | visible | control visibility of element |
+
+### UpdateAnimation
+
+Show an Animated GIF. Call the function as often as you like. The function will determine when to show the next frame and will automatically advance to the next frame at the right time.
+NOTE - does NOT perform a sleep call to delay
+
+```
+UpdateAnimation(source, time_between_frames=0)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[str,bytes] | source | Filename or Base64 encoded string containing Animated GIF |
+| int | time_between_frames | Number of milliseconds to wait between showing frames |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Image Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(filename=None,
+ data=None,
+ size=(None, None),
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | filename | filename to the new image to display. |
+| Union[str, tkPhotoImage] | data | Base64 encoded string OR a tk.PhotoImage object |
+| Tuple[int,int] | size | size of a image (w,h) w=characters-wide, h=rows-high |
+| bool | visible | control visibility of element |
+
+### update_animation
+
+Show an Animated GIF. Call the function as often as you like. The function will determine when to show the next frame and will automatically advance to the next frame at the right time.
+NOTE - does NOT perform a sleep call to delay
+
+```
+update_animation(source, time_between_frames=0)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[str,bytes] | source | Filename or Base64 encoded string containing Animated GIF |
+| int | time_between_frames | Number of milliseconds to wait between showing frames |
+
+### update_animation_no_buffering
+
+Show an Animated GIF. Call the function as often as you like. The function will determine when to show the next frame and will automatically advance to the next frame at the right time.
+NOTE - does NOT perform a sleep call to delay
+
+```
+update_animation_no_buffering(source, time_between_frames=0)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[str,bytes] | source | Filename or Base64 encoded string containing Animated GIF |
+| int | time_between_frames | Number of milliseconds to wait between showing frames |
+
+## InputText Element
+
+ Display a single text input field. Based on the tkinter Widget `Entry`
+
+```
+InputText(default_text="",
+ size=(None, None),
+ disabled=False,
+ password_char="",
+ justification=None,
+ background_color=None,
+ text_color=None,
+ font=None,
+ tooltip=None,
+ change_submits=False,
+ enable_events=False,
+ do_not_clear=True,
+ key=None,
+ focus=False,
+ pad=None,
+ use_readonly_for_disable=True,
+ right_click_menu=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | default_text | Text initially shown in the input box as a default value(Default value = '') |
+| Tuple[int, int] (width, height) | size | w=characters-wide, h=rows-high |
+| bool | disabled | set disable state for element (Default = False) |
+| char | password_char | Password character if this is a password field (Default value = '') |
+| str | justification | justification for data display. Valid choices - left, right, center |
+| str | background_color | color of background in one of the color formats |
+| str | text_color | color of the text |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| bool | change_submits | * DEPRICATED DO NOT USE! Same as enable_events |
+| bool | enable_events | If True then changes to this element are immediately reported as an event. Use this instead of change_submits (Default = False) |
+| bool | do_not_clear | If False then the field will be set to blank after ANY event (button, any event) (Default = True) |
+| any | key | Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window |
+| bool | focus | Determines if initial focus should go to this element. |
+| (int, int) or ((int, int), (int, int)) Tuple(s) | pad | . Amount of padding to put around element. Normally (horizontal pixels, vertical pixels) but can be split apart further into ((horizontal left, horizontal right), (vertical above, vertical below)) |
+| bool | use_readonly_for_disable | If True (the default) tkinter state set to 'readonly'. Otherwise state set to 'disabled' |
+| List[List[Union[List[str],str]]] | right_click_menu | A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. |
+| bool | visible | set visibility state of the element (Default = True) |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### Get
+
+Read and return the current value of the input element. Must call `Window.Read` or `Window.Finalize` prior
+
+`Get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | current value of Input field or '' if error encountered |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Input Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(value=None,
+ disabled=None,
+ select=None,
+ visible=None,
+ text_color=None,
+ background_color=None,
+ move_cursor_to="end")
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | value | new text to display as default text in Input field |
+| bool | disabled | disable or enable state of the element (sets Entry Widget to readonly or normal) |
+| bool | select | if True, then the text will be selected |
+| bool | visible | change visibility of element |
+| str | text_color | change color of text being typed |
+| str | background_color | change color of the background |
+| Union[int, str] | move_cursor_to | Moves the cursor to a particular offset. Defaults to 'end' |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get
+
+Read and return the current value of the input element. Must call `Window.Read` or `Window.Finalize` prior
+
+`get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | current value of Input field or '' if error encountered |
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Input Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(value=None,
+ disabled=None,
+ select=None,
+ visible=None,
+ text_color=None,
+ background_color=None,
+ move_cursor_to="end")
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | value | new text to display as default text in Input field |
+| bool | disabled | disable or enable state of the element (sets Entry Widget to readonly or normal) |
+| bool | select | if True, then the text will be selected |
+| bool | visible | change visibility of element |
+| str | text_color | change color of text being typed |
+| str | background_color | change color of the background |
+| Union[int, str] | move_cursor_to | Moves the cursor to a particular offset. Defaults to 'end' |
+
+## Listbox Element
+
+ A List Box. Provide a list of values for the user to choose one or more of. Returns a list of selected rows
+ when a window.Read() is executed.
+
+```
+Listbox(values,
+ default_values=None,
+ select_mode=None,
+ change_submits=False,
+ enable_events=False,
+ bind_return_key=False,
+ size=(None, None),
+ disabled=False,
+ auto_size_text=None,
+ font=None,
+ no_scrollbar=False,
+ background_color=None,
+ text_color=None,
+ key=None,
+ pad=None,
+ tooltip=None,
+ right_click_menu=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Any] | values | list of values to display. Can be any type including mixed types as long as they have __str__ method |
+| List[Any] | default_values | which values should be initially selected |
+| [enum] | select_mode | Select modes are used to determine if only 1 item can be selected or multiple and how they can be selected. Valid choices begin with "LISTBOX_SELECT_MODE_" and include: LISTBOX_SELECT_MODE_SINGLE LISTBOX_SELECT_MODE_MULTIPLE LISTBOX_SELECT_MODE_BROWSE LISTBOX_SELECT_MODE_EXTENDED |
+| bool | change_submits | DO NOT USE. Only listed for backwards compat - Use enable_events instead |
+| bool | enable_events | Turns on the element specific events. Listbox generates events when an item is clicked |
+| bool | bind_return_key | If True, then the return key will cause a the Listbox to generate an event |
+| Tuple(int, int) (width, height) | size | width = characters-wide, height = rows-high |
+| bool | disabled | set disable state for element |
+| bool | auto_size_text | True if element should be the same size as the contents |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| List[List[Union[List[str],str]]] | right_click_menu | A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### GetIndexes
+
+Returns the items currently selected as a list of indexes
+
+`GetIndexes()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | A list of offsets into values that is currently selected |
+
+### GetListValues
+
+Returns list of Values provided by the user in the user's format
+
+`GetListValues()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | List of values. Can be any / mixed types -> [] |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### SetValue
+
+Set listbox highlighted choices
+
+```
+SetValue(values)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Any] | values | new values to choose based on previously set values |
+
+### Update
+
+Changes some of the settings for the Listbox Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(values=None,
+ disabled=None,
+ set_to_index=None,
+ scroll_to_index=None,
+ select_mode=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Any] | values | new list of choices to be shown to user |
+| bool | disabled | disable or enable state of the element |
+| Union[int, list, tuple] | set_to_index | highlights the item(s) indicated. If parm is an int one entry will be set. If is a list, then each entry in list is highlighted |
+| int | scroll_to_index | scroll the listbox so that this index is the first shown |
+| str | mode | changes the select mode according to tkinter's listbox widget |
+| bool | visible | control visibility of element |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get
+
+Returns the list of items currently selected in this listbox. It should be identical
+to the value you would receive when performing a window.read() call.
+
+`get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | The list of currently selected items. The actual items are returned, not the indexes |
+
+### get_indexes
+
+Returns the items currently selected as a list of indexes
+
+`get_indexes()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | A list of offsets into values that is currently selected |
+
+### get_list_values
+
+Returns list of Values provided by the user in the user's format
+
+`get_list_values()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | List of values. Can be any / mixed types -> [] |
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### set_value
+
+Set listbox highlighted choices
+
+```
+set_value(values)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Any] | values | new values to choose based on previously set values |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Listbox Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(values=None,
+ disabled=None,
+ set_to_index=None,
+ scroll_to_index=None,
+ select_mode=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Any] | values | new list of choices to be shown to user |
+| bool | disabled | disable or enable state of the element |
+| Union[int, list, tuple] | set_to_index | highlights the item(s) indicated. If parm is an int one entry will be set. If is a list, then each entry in list is highlighted |
+| int | scroll_to_index | scroll the listbox so that this index is the first shown |
+| str | mode | changes the select mode according to tkinter's listbox widget |
+| bool | visible | control visibility of element |
+
+## Menu Element
+
+ Menu Element is the Element that provides a Menu Bar that goes across the top of the window, just below titlebar.
+ Here is an example layout. The "&" are shortcut keys ALT+key.
+ Is a List of - "Item String" + List
+ Where Item String is what will be displayed on the Menubar itself.
+ The List that follows the item represents the items that are shown then Menu item is clicked
+ Notice how an "entry" in a mennu can be a list which means it branches out and shows another menu, etc. (resursive)
+ menu_def = [['&File', ['!&Open', '&Save::savekey', '---', '&Properties', 'E&xit']],
+ ['!&Edit', ['!&Paste', ['Special', 'Normal', ], 'Undo'], ],
+ ['&Debugger', ['Popout', 'Launch Debugger']],
+ ['&Toolbar', ['Command &1', 'Command &2', 'Command &3', 'Command &4']],
+ ['&Help', '&About...'], ]
+ Finally, "keys" can be added to entries so make them unique. The "Save" entry has a key associated with it. You
+ can see it has a "::" which signifies the beginning of a key. The user will not see the key portion when the
+ menu is shown. The key portion is returned as part of the event.
+
+```
+Menu(menu_definition,
+ background_color=None,
+ size=(None, None),
+ tearoff=False,
+ font=None,
+ pad=None,
+ key=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[List[Tuple[str, List[str]]] | menu_definition | ??? |
+| str | background_color | color of the background |
+| Tuple[int, int] | size | Not used in the tkinter port |
+| bool | tearoff | if True, then can tear the menu off from the window ans use as a floating window. Very cool effect |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| any | key | Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Update a menubar - can change the menu definition and visibility. The entire menu has to be specified
+
+```
+Update(menu_definition=None, visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[List[Tuple[str, List[str]]] | menu_definition | ??? |
+| bool | visible | control visibility of element |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Update a menubar - can change the menu definition and visibility. The entire menu has to be specified
+
+```
+update(menu_definition=None, visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[List[Tuple[str, List[str]]] | menu_definition | ??? |
+| bool | visible | control visibility of element |
+
+## Multiline Element
+
+ Multiline Element - Display and/or read multiple lines of text. This is both an input and output element.
+ Other PySimpleGUI ports have a separate MultilineInput and MultilineOutput elements. May want to split this
+ one up in the future too.
+
+```
+Multiline(default_text="",
+ enter_submits=False,
+ disabled=False,
+ autoscroll=False,
+ border_width=None,
+ size=(None, None),
+ auto_size_text=None,
+ background_color=None,
+ text_color=None,
+ change_submits=False,
+ enable_events=False,
+ do_not_clear=True,
+ key=None,
+ focus=False,
+ font=None,
+ pad=None,
+ tooltip=None,
+ right_click_menu=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | default_text | Initial text to show |
+| bool | enter_submits | if True, the Window.Read call will return is enter key is pressed in this element |
+| bool | disabled | set disable state |
+| bool | autoscroll | If True the contents of the element will automatically scroll as more data added to the end |
+| int | border_width | width of border around element in pixels |
+| Tuple[int, | size | int] (width, height) width = characters-wide, height = rows-high |
+| bool | auto_size_text | if True will size the element to match the length of the text |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | chfange_submits | DO NOT USE. Only listed for backwards compat - Use enable_events instead |
+| bool | enable_events | Turns on the element specific events. Spin events happen when an item changes |
+| bool | do_not_clear | if False the element will be cleared any time the Window.Read call returns |
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element |
+| bool | focus | if True initial focus will go to this element |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| List[List[Union[List[str],str]]] | right_click_menu | A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### Get
+
+Return current contents of the Multiline Element
+
+`Get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | current contents of the Multiline Element (used as an input type of Multiline |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Multiline Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(value=None,
+ disabled=None,
+ append=False,
+ font=None,
+ text_color=None,
+ background_color=None,
+ text_color_for_value=None,
+ background_color_for_value=None,
+ visible=None,
+ autoscroll=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | value | new text to display |
+| bool | disabled | disable or enable state of the element |
+| bool | append | if True then new value will be added onto the end of the current value. if False then contents will be replaced. |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| str | text_color | color of the text |
+| str | background_color | color of background |
+| bool | visible | set visibility state of the element |
+| bool | autoscroll | if True then contents of element are scrolled down when new text is added to the end |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get
+
+Return current contents of the Multiline Element
+
+`get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | current contents of the Multiline Element (used as an input type of Multiline |
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### print
+
+Print like Python normally prints except route the output to a multline element and also add colors if desired
+
+```
+print(args=*<1 or N object>,
+ end=None,
+ sep=None,
+ text_color=None,
+ background_color=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Any] | args | The arguments to print |
+| str | end | The end char to use just like print uses |
+| str | sep | The separation character like print uses |
+| str | text_color | The color of the text |
+| str | background_color | The background color of the line |
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Multiline Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(value=None,
+ disabled=None,
+ append=False,
+ font=None,
+ text_color=None,
+ background_color=None,
+ text_color_for_value=None,
+ background_color_for_value=None,
+ visible=None,
+ autoscroll=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | value | new text to display |
+| bool | disabled | disable or enable state of the element |
+| bool | append | if True then new value will be added onto the end of the current value. if False then contents will be replaced. |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| str | text_color | color of the text |
+| str | background_color | color of background |
+| bool | visible | set visibility state of the element |
+| bool | autoscroll | if True then contents of element are scrolled down when new text is added to the end |
+
+## OptionMenu Element
+
+ Option Menu is an Element available ONLY on the tkinter port of PySimpleGUI. It's is a widget that is unique
+ to tkinter. However, it looks much like a ComboBox. Instead of an arrow to click to pull down the list of
+ choices, another little graphic is shown on the widget to indicate where you click. After clicking to activate,
+ it looks like a Combo Box that you scroll to select a choice.
+
+```
+OptionMenu(values,
+ default_value=None,
+ size=(None, None),
+ disabled=False,
+ auto_size_text=None,
+ background_color=None,
+ text_color=None,
+ key=None,
+ pad=None,
+ tooltip=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Any] | values | Values to be displayed |
+| Any | default_value | the value to choose by default |
+| Tuple[int, int] (width, height) | size | size in characters (wide) and rows (high) |
+| bool | disabled | control enabled / disabled |
+| bool | auto_size_text | True if size of Element should match the contents of the items |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| str | tooltip | (str) text that will appear when mouse hovers over this element |
+| bool | visible | (bool) set visibility state of the element |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the OptionMenu Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(value=None,
+ values=None,
+ disabled=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | value | the value to choose by default |
+| List[Any] | values | Values to be displayed |
+| bool | disabled | disable or enable state of the element |
+| bool | visible | control visibility of element |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the OptionMenu Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(value=None,
+ values=None,
+ disabled=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | value | the value to choose by default |
+| List[Any] | values | Values to be displayed |
+| bool | disabled | disable or enable state of the element |
+| bool | visible | control visibility of element |
+
+## Output Element
+
+ Output Element - a multi-lined text area where stdout and stderr are re-routed to.
+
+```
+Output(size=(None, None),
+ background_color=None,
+ text_color=None,
+ pad=None,
+ font=None,
+ tooltip=None,
+ key=None,
+ right_click_menu=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | (width, height) w=characters-wide, h=rows-high |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element |
+| List[List[Union[List[str],str]]] | right_click_menu | A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### Get
+
+Returns the current contents of the output. Similar to Get method other Elements
+
+`Get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | the current value of the output |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### TKOut
+
+### Update
+
+Changes some of the settings for the Output Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(value=None, visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | value | string that will replace current contents of the output area |
+| bool | visible | control visibility of element |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False, expand_y=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Bool | expand_x | If True Element will expand in the Horizontal directions |
+| Bool | expand_y | If True Element will expand in the Vertical directions |
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### tk_out
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Output Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(value=None, visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | value | string that will replace current contents of the output area |
+| bool | visible | control visibility of element |
+
+## Pane Element
+
+ A sliding Pane that is unique to tkinter. Uses Columns to create individual panes
+
+```
+Pane(pane_list,
+ background_color=None,
+ size=(None, None),
+ pad=None,
+ orientation="vertical",
+ show_handle=True,
+ relief="raised",
+ handle_size=None,
+ border_width=None,
+ key=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Column] | pane_list | Must be a list of Column Elements. Each Column supplied becomes one pane that's shown |
+| str | background_color | color of background |
+| Tuple[int, int] | size | (width, height) w=characters-wide, h=rows-high How much room to reserve for the Pane |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| str | orientation | 'horizontal' or 'vertical' or ('h' or 'v'). Direction the Pane should slide |
+| bool | show_handle | if True, the handle is drawn that makes it easier to grab and slide |
+| enum | relief | relief style. Values are same as other elements that use relief values. RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID |
+| int | handle_size | Size of the handle in pixels |
+| int | border_width | width of border around element in pixels |
+| any | key | Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Pane Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | visible | control visibility of element |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Pane Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | visible | control visibility of element |
+
+## ProgressBar Element
+
+ Progress Bar Element - Displays a colored bar that is shaded as progress of some operation is made
+
+```
+ProgressBar(max_value,
+ orientation=None,
+ size=(None, None),
+ auto_size_text=None,
+ bar_color=(None, None),
+ style=None,
+ border_width=None,
+ relief=None,
+ key=None,
+ pad=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| int | max_value | max value of progressbar |
+| str | orientation | 'horizontal' or 'vertical' |
+| Tuple[int, int] | size | Size of the bar. If horizontal (chars wide, pixels high), vert (pixels wide, rows high) |
+| bool | auto_size_text | Not sure why this is here |
+| Tuple[str, str] | bar_color | The 2 colors that make up a progress bar. One is the background, the other is the bar |
+| str | style | Progress bar style defined as one of these 'default', 'winnative', 'clam', 'alt', 'classic', 'vista', 'xpnative' |
+| int | border_width | The amount of pixels that go around the outside of the bar |
+| str | relief | relief style. Values are same as progress meter relief values. Can be a constant or a string: `RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID` (Default value = DEFAULT_PROGRESS_BAR_RELIEF) |
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the ProgressBar Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | visible | control visibility of element |
+
+### UpdateBar
+
+Change what the bar shows by changing the current count and optionally the max count
+
+```
+UpdateBar(current_count, max=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| int | current_count | sets the current value |
+| int | max | changes the max value |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the ProgressBar Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | visible | control visibility of element |
+
+### update_bar
+
+Change what the bar shows by changing the current count and optionally the max count
+
+```
+update_bar(current_count, max=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| int | current_count | sets the current value |
+| int | max | changes the max value |
+
+## Radio Element
+
+ Radio Button Element - Used in a group of other Radio Elements to provide user with ability to select only
+ 1 choice in a list of choices.
+
+```
+Radio(text,
+ group_id,
+ default=False,
+ disabled=False,
+ size=(None, None),
+ auto_size_text=None,
+ background_color=None,
+ text_color=None,
+ font=None,
+ key=None,
+ pad=None,
+ tooltip=None,
+ change_submits=False,
+ enable_events=False,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | text | Text to display next to button |
+| Any | group_id | Groups together multiple Radio Buttons. Any type works |
+| bool | default | Set to True for the one element of the group you want initially selected |
+| bool | disabled | set disable state |
+| Tuple[int, | size | int] (width, height) width = characters-wide, height = rows-high |
+| bool | auto_size_text | if True will size the element to match the length of the text |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| bool | change_submits | DO NOT USE. Only listed for backwards compat - Use enable_events instead |
+| bool | enable_events | Turns on the element specific events. Radio Button events happen when an item is selected |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### Get
+
+A snapshot of the value of Radio Button -> (bool)
+
+`Get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | True if this radio button is selected |
+
+### ResetGroup
+
+Sets all Radio Buttons in the group to not selected
+
+```python
+ResetGroup()
+```
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Radio Button Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(value=None,
+ disabled=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | value | if True change to selected and set others in group to unselected |
+| bool | disabled | disable or enable state of the element |
+| bool | visible | control visibility of element |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get
+
+A snapshot of the value of Radio Button -> (bool)
+
+`get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | True if this radio button is selected |
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### reset_group
+
+Sets all Radio Buttons in the group to not selected
+
+```python
+reset_group()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Radio Button Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(value=None,
+ disabled=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | value | if True change to selected and set others in group to unselected |
+| bool | disabled | disable or enable state of the element |
+| bool | visible | control visibility of element |
+
+## Slider Element
+
+ A slider, horizontal or vertical
+
+```
+Slider(range=(None, None),
+ default_value=None,
+ resolution=None,
+ tick_interval=None,
+ orientation=None,
+ disable_number_display=False,
+ border_width=None,
+ relief=None,
+ change_submits=False,
+ enable_events=False,
+ disabled=False,
+ size=(None, None),
+ font=None,
+ background_color=None,
+ text_color=None,
+ key=None,
+ pad=None,
+ tooltip=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[Tuple[int, int], Tuple[float, float]] | range | slider's range (min value, max value) |
+| Union[int, float] | default_value | starting value for the slider |
+| Union[int, float] | resolution | the smallest amount the slider can be moved |
+| Union[int, float] | tick_interval | how often a visible tick should be shown next to slider |
+| str | orientation | 'horizontal' or 'vertical' ('h' or 'v' also work) |
+| bool | disable_number_display | if True no number will be displayed by the Slider Element |
+| int | border_width | width of border around element in pixels |
+| enum | relief | relief style. RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID |
+| bool | change_submits | * DEPRICATED DO NOT USE! Same as enable_events |
+| bool | enable_events | If True then moving the slider will generate an Event |
+| bool | disabled | set disable state for element |
+| Tuple[int, int] | size | (w=characters-wide, h=rows-high) |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| str | background_color | color of slider's background |
+| str | text_color | color of the slider's text |
+| any | key | Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Slider Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(value=None,
+ range=(None, None),
+ disabled=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[int, float] | value | sets current slider value |
+| Union[Tuple[int, int], Tuple[float, float] | range | Sets a new range for slider |
+| bool | disabled | disable or enable state of the element |
+| bool | visible | control visibility of element |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Slider Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(value=None,
+ range=(None, None),
+ disabled=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[int, float] | value | sets current slider value |
+| Union[Tuple[int, int], Tuple[float, float] | range | Sets a new range for slider |
+| bool | disabled | disable or enable state of the element |
+| bool | visible | control visibility of element |
+
+## Spin Element
+
+ A spinner with up/down buttons and a single line of text. Choose 1 values from list
+
+```
+Spin(values,
+ initial_value=None,
+ disabled=False,
+ change_submits=False,
+ enable_events=False,
+ size=(None, None),
+ auto_size_text=None,
+ font=None,
+ background_color=None,
+ text_color=None,
+ key=None,
+ pad=None,
+ tooltip=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Any] | values | List of valid values |
+| Any | initial_value | Initial item to show in window. Choose from list of values supplied |
+| bool | disabled | set disable state |
+| bool | change_submits | DO NOT USE. Only listed for backwards compat - Use enable_events instead |
+| bool | enable_events | Turns on the element specific events. Spin events happen when an item changes |
+| Tuple[int, int] | size | (width, height) width = characters-wide, height = rows-high |
+| bool | auto_size_text | if True will size the element to match the length of the text |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### Get
+
+Return the current chosen value showing in spinbox.
+This value will be the same as what was provided as list of choices. If list items are ints, then the
+item returned will be an int (not a string)
+
+`Get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | The currently visible entry |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Spin Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(value=None,
+ values=None,
+ disabled=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | value | set the current value from list of choices |
+| List[Any] | values | set available choices |
+| bool | disabled | disable or enable state of the element |
+| bool | visible | control visibility of element |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get
+
+Return the current chosen value showing in spinbox.
+This value will be the same as what was provided as list of choices. If list items are ints, then the
+item returned will be an int (not a string)
+
+`get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | The currently visible entry |
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Spin Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(value=None,
+ values=None,
+ disabled=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | value | set the current value from list of choices |
+| List[Any] | values | set available choices |
+| bool | disabled | disable or enable state of the element |
+| bool | visible | control visibility of element |
+
+## StatusBar Element
+
+ A StatusBar Element creates the sunken text-filled strip at the bottom. Many Windows programs have this line
+
+```
+StatusBar(text,
+ size=(None, None),
+ auto_size_text=None,
+ click_submits=None,
+ enable_events=False,
+ relief="sunken",
+ font=None,
+ text_color=None,
+ background_color=None,
+ justification=None,
+ pad=None,
+ key=None,
+ tooltip=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | text | Text that is to be displayed in the widget |
+| Tuple[(int), (int)] | size | (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_text | True if size should fit the text length |
+| bool | click_submits | DO NOT USE. Only listed for backwards compat - Use enable_events instead |
+| bool | enable_events | Turns on the element specific events. StatusBar events occur when the bar is clicked |
+| enum | relief | relief style. Values are same as progress meter relief values. Can be a constant or a string: `RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID` |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| str | text_color | color of the text |
+| str | background_color | color of background |
+| str | justification | how string should be aligned within space provided by size. Valid choices = `left`, `right`, `center` |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Status Bar Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(value=None,
+ background_color=None,
+ text_color=None,
+ font=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | value | new text to show |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | visible | set visibility state of the element |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Status Bar Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(value=None,
+ background_color=None,
+ text_color=None,
+ font=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | value | new text to show |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | visible | set visibility state of the element |
+
+## SystemTray Element
+
+ A "Simulated System Tray" that duplicates the API calls available to PySimpleGUIWx and PySimpleGUIQt users.
+
+ All of the functionality works. The icon is displayed ABOVE the system tray rather than inside of it.
+
+SystemTray - create an icon in the system tray
+
+```
+SystemTray(menu=None,
+ filename=None,
+ data=None,
+ data_base64=None,
+ tooltip=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| ??? | menu | Menu definition |
+| ???? | filename | filename for icon |
+| ??? | data | in-ram image for icon |
+| ??? | data_base64 | basee-64 data for icon |
+| str | tooltip | tooltip string |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### Close
+
+Close the system tray window
+
+```python
+Close()
+```
+
+### Hide
+
+Hides the icon
+
+```python
+Hide()
+```
+
+### Read
+
+Reads the context menu
+
+```
+Read(timeout=None)
+```
+
+### ShowMessage
+
+Shows a balloon above icon in system tray
+
+```
+ShowMessage(title,
+ message,
+ filename=None,
+ data=None,
+ data_base64=None,
+ messageicon=None,
+ time=(1000, 3000))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| | title | Title shown in balloon |
+| | message | Message to be displayed |
+| | filename | Optional icon filename |
+| | data | Optional in-ram icon |
+| | data_base64 | Optional base64 icon |
+| Union[int, Tuple[int, int]] | time | Amount of time to display message in milliseconds. If tuple, first item is fade in/out duration |
+| (Any) | **RETURN** | The event that happened during the display such as user clicked on message
+
+### UnHide
+
+Restores a previously hidden icon
+
+```python
+UnHide()
+```
+
+### Update
+
+Updates the menu, tooltip or icon
+
+```
+Update(menu=None,
+ tooltip=None,
+ filename=None,
+ data=None,
+ data_base64=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| ??? | menu | menu defintion |
+| ??? | tooltip | string representing tooltip |
+| ??? | filename | icon filename |
+| ??? | data | icon raw image |
+| ??? | data_base64 | icon base 64 image |
+
+### close
+
+Close the system tray window
+
+```python
+close()
+```
+
+### hide
+
+Hides the icon
+
+```python
+hide()
+```
+
+### notify
+
+Displays a "notification window", usually in the bottom right corner of your display. Has an icon, a title, and a message
+The window will slowly fade in and out if desired. Clicking on the window will cause it to move through the end the current "phase". For example, if the window was fading in and it was clicked, then it would immediately stop fading in and instead be fully visible. It's a way for the user to quickly dismiss the window.
+
+```
+notify(title,
+ message,
+ icon=...,
+ display_duration_in_ms=3000,
+ fade_in_duration=1000,
+ alpha=0.9,
+ location=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | title | Text to be shown at the top of the window in a larger font |
+| str | message | Text message that makes up the majority of the window |
+| Union[bytes, str] | icon | A base64 encoded PNG/GIF image or PNG/GIF filename that will be displayed in the window |
+| int | display_duration_in_ms | Number of milliseconds to show the window |
+| int | fade_in_duration | Number of milliseconds to fade window in and out |
+| float | alpha | Alpha channel. 0 - invisible 1 - fully visible |
+| Tuple[int, int] | location | Location on the screen to display the window |
+| (int) | **RETURN** | (int) reason for returning
+
+### read
+
+Reads the context menu
+
+```
+read(timeout=None)
+```
+
+### show_message
+
+Shows a balloon above icon in system tray
+
+```
+show_message(title,
+ message,
+ filename=None,
+ data=None,
+ data_base64=None,
+ messageicon=None,
+ time=(1000, 3000))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| | title | Title shown in balloon |
+| | message | Message to be displayed |
+| | filename | Optional icon filename |
+| | data | Optional in-ram icon |
+| | data_base64 | Optional base64 icon |
+| Union[int, Tuple[int, int]] | time | Amount of time to display message in milliseconds. If tuple, first item is fade in/out duration |
+| (Any) | **RETURN** | The event that happened during the display such as user clicked on message
+
+### un_hide
+
+Restores a previously hidden icon
+
+```python
+un_hide()
+```
+
+### update
+
+Updates the menu, tooltip or icon
+
+```
+update(menu=None,
+ tooltip=None,
+ filename=None,
+ data=None,
+ data_base64=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| ??? | menu | menu defintion |
+| ??? | tooltip | string representing tooltip |
+| ??? | filename | icon filename |
+| ??? | data | icon raw image |
+| ??? | data_base64 | icon base 64 image |
+
+## Tab Element
+
+ Tab Element is another "Container" element that holds a layout and displays a tab with text. Used with TabGroup only
+ Tabs are never placed directly into a layout. They are always "Contained" in a TabGroup layout
+
+```
+Tab(title,
+ layout,
+ title_color=None,
+ background_color=None,
+ font=None,
+ pad=None,
+ disabled=False,
+ border_width=None,
+ key=None,
+ tooltip=None,
+ right_click_menu=None,
+ visible=True,
+ element_justification="left",
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | title | text to show on the tab |
+| List[List[Element]] | layout | The element layout that will be shown in the tab |
+| str | title_color | color of the tab text (note not currently working on tkinter) |
+| str | background_color | color of background of the entire layout |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| bool | disabled | If True button will be created disabled |
+| int | border_width | width of border around element in pixels |
+| any | key | Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| List[List[Union[List[str],str]]] | right_click_menu | A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. |
+| bool | visible | set visibility state of the element |
+| str | element_justification | All elements inside the Tab will have this justification 'left', 'right', 'center' are valid values |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### AddRow
+
+Not recommended use call. Used to add rows of Elements to the Frame Element.
+
+```
+AddRow(args=*<1 or N object>)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Element] | *args | The list of elements for this row |
+
+### Layout
+
+Not user callable. Use layout parameter instead. Creates the layout using the supplied rows of Elements
+
+```
+Layout(rows) -> (Tab) used for chaining
+```
+
+### Select
+
+Create a tkinter event that mimics user clicking on a tab. Must have called window.Finalize / Read first!
+
+```python
+Select()
+```
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Tab Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(disabled=None, visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | disabled | disable or enable state of the element |
+| bool | visible | control visibility of element |
+
+### add_row
+
+Not recommended use call. Used to add rows of Elements to the Frame Element.
+
+```
+add_row(args=*<1 or N object>)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[Element] | *args | The list of elements for this row |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### layout
+
+Not user callable. Use layout parameter instead. Creates the layout using the supplied rows of Elements
+
+```
+layout(rows) -> (Tab) used for chaining
+```
+
+### select
+
+Create a tkinter event that mimics user clicking on a tab. Must have called window.Finalize / Read first!
+
+```python
+select()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Tab Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(disabled=None, visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | disabled | disable or enable state of the element |
+| bool | visible | control visibility of element |
+
+## TabGroup Element
+
+ TabGroup Element groups together your tabs into the group of tabs you see displayed in your window
+
+```
+TabGroup(layout,
+ tab_location=None,
+ title_color=None,
+ tab_background_color=None,
+ selected_title_color=None,
+ selected_background_color=None,
+ background_color=None,
+ font=None,
+ change_submits=False,
+ enable_events=False,
+ pad=None,
+ border_width=None,
+ theme=None,
+ key=None,
+ tooltip=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[List[Tab]] | layout | Layout of Tabs. Different than normal layouts. ALL Tabs should be on first row |
+| str | tab_location | location that tabs will be displayed. Choices are left, right, top, bottom, lefttop, leftbottom, righttop, rightbottom, bottomleft, bottomright, topleft, topright |
+| str | title_color | color of text on tabs |
+| str | tab_background_color | color of all tabs that are not selected |
+| str | selected_title_color | color of tab text when it is selected |
+| str | selected_background_color | color of tab when it is selected |
+| str | background_color | color of background area that tabs are located on |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | change_submits | * DEPRICATED DO NOT USE! Same as enable_events |
+| bool | enable_events | If True then switching tabs will generate an Event |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| int | border_width | width of border around element in pixels |
+| enum | theme | DEPRICATED - You can only specify themes using set options or when window is created. It's not possible to do it on an element basis |
+| any | key | Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### FindKeyFromTabName
+
+Searches through the layout to find the key that matches the text on the tab. Implies names should be unique
+
+```
+FindKeyFromTabName(tab_name)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tab_name | name of a tab |
+| Union[key, None] | **RETURN** | Returns the key or None if no key found
+
+### Get
+
+Returns the current value for the Tab Group, which will be the currently selected tab's KEY or the text on
+the tab if no key is defined. Returns None if an error occurs.
+Note that this is exactly the same data that would be returned from a call to Window.Read. Are you sure you
+are using this method correctly?
+
+`Get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | The key of the currently selected tab or the tab's text if it has no key |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### find_key_from_tab_name
+
+Searches through the layout to find the key that matches the text on the tab. Implies names should be unique
+
+```
+find_key_from_tab_name(tab_name)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tab_name | name of a tab |
+| Union[key, None] | **RETURN** | Returns the key or None if no key found
+
+### get
+
+Returns the current value for the Tab Group, which will be the currently selected tab's KEY or the text on
+the tab if no key is defined. Returns None if an error occurs.
+Note that this is exactly the same data that would be returned from a call to Window.Read. Are you sure you
+are using this method correctly?
+
+`get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | The key of the currently selected tab or the tab's text if it has no key |
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+## Table Element
+
+```
+Table(values,
+ headings=None,
+ visible_column_map=None,
+ col_widths=None,
+ def_col_width=10,
+ auto_size_columns=True,
+ max_col_width=20,
+ select_mode=None,
+ display_row_numbers=False,
+ num_rows=None,
+ row_height=None,
+ font=None,
+ justification="right",
+ text_color=None,
+ background_color=None,
+ alternating_row_color=None,
+ header_text_color=None,
+ header_background_color=None,
+ header_font=None,
+ row_colors=None,
+ vertical_scroll_only=True,
+ hide_vertical_scroll=False,
+ size=(None, None),
+ change_submits=False,
+ enable_events=False,
+ bind_return_key=False,
+ pad=None,
+ key=None,
+ tooltip=None,
+ right_click_menu=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[List[Union[str, int, float]]] | values | ??? |
+| List[str] | headings | The headings to show on the top line |
+| List[bool] | visible_column_map | One entry for each column. False indicates the column is not shown |
+| List[int] | col_widths | Number of characters that each column will occupy |
+| int | def_col_width | Default column width in characters |
+| bool | auto_size_columns | if True columns will be sized automatically |
+| int | max_col_width | Maximum width for all columns in characters |
+| enum | select_mode | Select Mode. Valid values start with "TABLE_SELECT_MODE_". Valid values are: TABLE_SELECT_MODE_NONE TABLE_SELECT_MODE_BROWSE TABLE_SELECT_MODE_EXTENDED |
+| bool | display_row_numbers | if True, the first column of the table will be the row # |
+| int | num_rows | The number of rows of the table to display at a time |
+| int | row_height | height of a single row in pixels |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| str | justification | 'left', 'right', 'center' are valid choices |
+| str | text_color | color of the text |
+| str | background_color | color of background |
+| str | alternating_row_color | if set then every other row will have this color in the background. |
+| str | header_text_color | sets the text color for the header |
+| str | header_background_color | sets the background color for the header |
+| Union[str, Tuple[str, int]] | header_font | specifies the font family, size, etc |
+| List[Union[Tuple[int, str], Tuple[Int, str, str]] | row_colors | list of tuples of (row, background color) OR (row, foreground color, background color). Sets the colors of listed rows to the color(s) provided (note the optional foreground color) |
+| bool | vertical_scroll_only | if True only the vertical scrollbar will be visible |
+| bool | hide_vertical_scroll | if True vertical scrollbar will be hidden |
+| Tuple[int, int] | size | DO NOT USE! Use num_rows instead |
+| bool | change_submits | DO NOT USE. Only listed for backwards compat - Use enable_events instead |
+| bool | enable_events | Turns on the element specific events. Table events happen when row is clicked |
+| bool | bind_return_key | if True, pressing return key will cause event coming from Table, ALSO a left button double click will generate an event if this parameter is True |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| List[List[Union[List[str],str]]] | right_click_menu | A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### Get
+
+Dummy function for tkinter port. In the Qt port you can read back the values in the table in case they were
+edited. Don't know yet how to enable editing of a Tree in tkinter so just returning the values provided by
+user when Table was created or Updated.
+
+`Get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | the current table values (for now what was originally provided up updated) |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Table Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(values=None,
+ num_rows=None,
+ visible=None,
+ select_rows=None,
+ alternating_row_color=None,
+ row_colors=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[List[Union[str, int, float]]] | values | A new 2-dimensional table to show |
+| int | num_rows | How many rows to display at a time |
+| bool | visible | if True then will be visible |
+| List[int] | select_rows | List of rows to select as if user did |
+| str | alternating_row_color | the color to make every other row |
+| List[Union[Tuple[int, str], Tuple[Int, str, str]] | row_colors | list of tuples of (row, background color) OR (row, foreground color, background color). Changes the colors of listed rows to the color(s) provided (note the optional foreground color) |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get
+
+Dummy function for tkinter port. In the Qt port you can read back the values in the table in case they were
+edited. Don't know yet how to enable editing of a Tree in tkinter so just returning the values provided by
+user when Table was created or Updated.
+
+`get()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | the current table values (for now what was originally provided up updated) |
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Table Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(values=None,
+ num_rows=None,
+ visible=None,
+ select_rows=None,
+ alternating_row_color=None,
+ row_colors=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[List[Union[str, int, float]]] | values | A new 2-dimensional table to show |
+| int | num_rows | How many rows to display at a time |
+| bool | visible | if True then will be visible |
+| List[int] | select_rows | List of rows to select as if user did |
+| str | alternating_row_color | the color to make every other row |
+| List[Union[Tuple[int, str], Tuple[Int, str, str]] | row_colors | list of tuples of (row, background color) OR (row, foreground color, background color). Changes the colors of listed rows to the color(s) provided (note the optional foreground color) |
+
+## Text Element
+
+ Text - Display some text in the window. Usually this means a single line of text. However, the text can also be multiple lines. If multi-lined there are no scroll bars.
+
+```
+Text(text="",
+ size=(None, None),
+ auto_size_text=None,
+ click_submits=False,
+ enable_events=False,
+ relief=None,
+ font=None,
+ text_color=None,
+ background_color=None,
+ border_width=None,
+ justification=None,
+ pad=None,
+ key=None,
+ right_click_menu=None,
+ tooltip=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | text | The text to display. Can include /n to achieve multiple lines |
+| Tuple[int, int] | size | (width, height) width = characters-wide, height = rows-high |
+| bool | auto_size_text | if True size of the Text Element will be sized to fit the string provided in 'text' parm |
+| bool | click_submits | DO NOT USE. Only listed for backwards compat - Use enable_events instead |
+| bool | enable_events | Turns on the element specific events. Text events happen when the text is clicked |
+| (str/enum) | relief | relief style around the text. Values are same as progress meter relief values. Should be a constant that is defined at starting with "RELIEF_" - `RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID` |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| str | text_color | color of the text |
+| str | background_color | color of background |
+| int | border_width | number of pixels for the border (if using a relief) |
+| str | justification | how string should be aligned within space provided by size. Valid choices = `left`, `right`, `center` |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element |
+| List[List[Union[List[str],str]]] | right_click_menu | A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Text Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(value=None,
+ background_color=None,
+ text_color=None,
+ font=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | value | new text to show |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | visible | set visibility state of the element |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Text Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(value=None,
+ background_color=None,
+ text_color=None,
+ font=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | value | new text to show |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | visible | set visibility state of the element |
+
+## Tree Element
+
+ Tree Element - Presents data in a tree-like manner, much like a file/folder browser. Uses the TreeData class
+ to hold the user's data and pass to the element for display.
+
+```
+Tree(data=None,
+ headings=None,
+ visible_column_map=None,
+ col_widths=None,
+ col0_width=10,
+ def_col_width=10,
+ auto_size_columns=True,
+ max_col_width=20,
+ select_mode=None,
+ show_expanded=False,
+ change_submits=False,
+ enable_events=False,
+ font=None,
+ justification="right",
+ text_color=None,
+ background_color=None,
+ header_text_color=None,
+ header_background_color=None,
+ header_font=None,
+ num_rows=None,
+ row_height=None,
+ pad=None,
+ key=None,
+ tooltip=None,
+ right_click_menu=None,
+ visible=True,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| TreeData | data | The data represented using a PySimpleGUI provided TreeData class |
+| List[str] | headings | List of individual headings for each column |
+| List[bool] | visible_column_map | Determines if a column should be visible. If left empty, all columns will be shown |
+| List[int] | col_widths | List of column widths so that individual column widths can be controlled |
+| int | col0_width | Size of Column 0 which is where the row numbers will be optionally shown |
+| int | def_col_width | default column width |
+| bool | auto_size_columns | if True, the size of a column is determined using the contents of the column |
+| int | max_col_width | the maximum size a column can be |
+| enum | select_mode | Use same values as found on Table Element. Valid values include: TABLE_SELECT_MODE_NONE TABLE_SELECT_MODE_BROWSE TABLE_SELECT_MODE_EXTENDED |
+| bool | show_expanded | if True then the tree will be initially shown with all nodes completely expanded |
+| bool | change_submits | DO NOT USE. Only listed for backwards compat - Use enable_events instead |
+| bool | enable_events | Turns on the element specific events. Tree events happen when row is clicked |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| str | justification | 'left', 'right', 'center' are valid choices |
+| str | text_color | color of the text |
+| str | background_color | color of background |
+| str | header_text_color | sets the text color for the header |
+| str | header_background_color | sets the background color for the header |
+| Union[str, Tuple[str, int]] | header_font | specifies the font family, size, etc |
+| int | num_rows | The number of rows of the table to display at a time |
+| int | row_height | height of a single row in pixels |
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| List[List | right_click_menu | [Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. |
+| bool | visible | set visibility state of the element |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### Update
+
+Changes some of the settings for the Tree Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+Update(values=None,
+ key=None,
+ value=None,
+ text=None,
+ icon=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| TreeData | values | Representation of the tree |
+| Any | key | identifies a particular item in tree to update |
+| Any | value | sets the node identified by key to a particular value |
+| str | text | sets the node identified by ket to this string |
+| Union[bytes, str] | icon | can be either a base64 icon or a filename for the icon |
+| bool | visible | control visibility of element |
+
+### add_treeview_data
+
+Not a user function. Recursive method that inserts tree data into the tkinter treeview widget.
+
+```
+add_treeview_data(node)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| TreeData | node | The node to insert. Will insert all nodes from starting point downward, recursively |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+### update
+
+Changes some of the settings for the Tree Element. Must call `Window.Read` or `Window.Finalize` prior
+
+```
+update(values=None,
+ key=None,
+ value=None,
+ text=None,
+ icon=None,
+ visible=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| TreeData | values | Representation of the tree |
+| Any | key | identifies a particular item in tree to update |
+| Any | value | sets the node identified by key to a particular value |
+| str | text | sets the node identified by ket to this string |
+| Union[bytes, str] | icon | can be either a base64 icon or a filename for the icon |
+| bool | visible | control visibility of element |
+
+## TreeData Element
+
+ Class that user fills in to represent their tree data. It's a very simple tree representation with a root "Node"
+ with possibly one or more children "Nodes". Each Node contains a key, text to display, list of values to display
+ and an icon. The entire tree is built using a single method, Insert. Nothing else is required to make the tree.
+
+Instantiate the object, initializes the Tree Data, creates a root node for you
+
+```python
+TreeData()
+```
+
+### Insert
+
+Inserts a node into the tree. This is how user builds their tree, by Inserting Nodes
+This is the ONLY user callable method in the TreeData class
+
+```
+Insert(parent,
+ key,
+ text,
+ values,
+ icon=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Node | parent | the parent Node |
+| Any | key | Used to uniquely identify this node |
+| str | text | The text that is displayed at this node's location |
+| List[Any] | values | The list of values that are displayed at this node |
+| Union[str, bytes] | icon | icon |
+
+### Node
+
+Contains information about the individual node in the tree
+
+```
+Node(parent,
+ key,
+ text,
+ values,
+ icon=None)
+```
+
+### insert
+
+Inserts a node into the tree. This is how user builds their tree, by Inserting Nodes
+This is the ONLY user callable method in the TreeData class
+
+```
+insert(parent,
+ key,
+ text,
+ values,
+ icon=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Node | parent | the parent Node |
+| Any | key | Used to uniquely identify this node |
+| str | text | The text that is displayed at this node's location |
+| List[Any] | values | The list of values that are displayed at this node |
+| Union[str, bytes] | icon | icon |
+
+## VerticalSeparator Element
+
+ Vertical Separator Element draws a vertical line at the given location. It will span 1 "row". Usually paired with
+ Column Element if extra height is needed
+
+```
+VerticalSeparator(pad=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| (int, int) or ((int, int),(int,int)) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) |
+
+### SetFocus
+
+Sets the current focus to be on this element
+
+```
+SetFocus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### SetTooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+SetTooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### bind
+
+Used to add tkinter events to an Element.
+The tkinter specific data is in the Element's member variable user_bind_event
+
+```
+bind(bind_string, key_modifier)
+```
+
+### expand
+
+Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
+
+```
+expand(expand_x=False,
+ expand_y=False,
+ expand_row=True)
+```
+
+### get_size
+
+Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
+
+`get_size()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | width and height of the element |
+
+### hide_row
+
+Hide the entire row an Element is located on.
+ Use this if you must have all space removed when you are hiding an element, including the row container
+
+```python
+hide_row()
+```
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+### set_focus
+
+Sets the current focus to be on this element
+
+```
+set_focus(force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | force | if True will call focus_force otherwise calls focus_set |
+
+### set_size
+
+Changes the size of an element to a specific size.
+It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
+
+```
+set_size(size=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels |
+
+### set_tooltip
+
+Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
+
+```
+set_tooltip(tooltip_text)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | tooltip_text | the text to show in tooltip. |
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+### unhide_row
+
+Unhides (makes visible again) the row container that the Element is located on.
+ Note that it will re-appear at the bottom of the window / container, most likely.
+
+```python
+unhide_row()
+```
+
+## Window
+
+ Represents a single Window
+
+```
+Window(title,
+ layout=None,
+ default_element_size=(45, 1),
+ default_button_element_size=(None, None),
+ auto_size_text=None,
+ auto_size_buttons=None,
+ location=(None, None),
+ size=(None, None),
+ element_padding=None,
+ margins=(None, None),
+ button_color=None,
+ font=None,
+ progress_bar_color=(None, None),
+ background_color=None,
+ border_depth=None,
+ auto_close=False,
+ auto_close_duration=3,
+ icon=None,
+ force_toplevel=False,
+ alpha_channel=1,
+ return_keyboard_events=False,
+ use_default_focus=True,
+ text_justification=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ resizable=False,
+ disable_close=False,
+ disable_minimize=False,
+ right_click_menu=None,
+ transparent_color=None,
+ debugger_enabled=True,
+ finalize=False,
+ element_justification="left",
+ ttk_theme=None,
+ use_ttk_buttons=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | title | The title that will be displayed in the Titlebar and on the Taskbar |
+| List[List[Elements]] | layout | The layout for the window. Can also be specified in the Layout method |
+| Tuple[int, int] | default_element_size | (width, height) size in characters (wide) and rows (high) for all elements in this window |
+| Tuple[int, int] | default_button_element_size | (width, height) size in characters (wide) and rows (high) for all Button elements in this window |
+| bool | auto_size_text | True if Elements in Window should be sized to exactly fir the length of text |
+| bool | auto_size_buttons | True if Buttons in this Window should be sized to exactly fit the text on this. |
+| Tuple[int, int] | location | (x,y) location, in pixels, to locate the upper left corner of the window on the screen. Default is to center on screen. |
+| Tuple[int, int] | size | (width, height) size in pixels for this window. Normally the window is autosized to fit contents, not set to an absolute size by the user |
+| Tuple[int, int] or ((int, int),(int,int)) | element_padding | Default amount of padding to put around elements in window (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| Tuple[int, int] | margins | (left/right, top/bottom) Amount of pixels to leave inside the window's frame around the edges before your elements are shown. |
+| Tuple[str, str] | button_color | (text color, button color) Default button colors for all buttons in the window |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| Tuple[str, str] | progress_bar_color | (bar color, background color) Sets the default colors for all progress bars in the window |
+| str | background_color | color of background |
+| int | border_depth | Default border depth (width) for all elements in the window |
+| bool | auto_close | If True, the window will automatically close itself |
+| int | auto_close_duration | Number of seconds to wait before closing the window |
+| Union[str, str] | icon | Can be either a filename or Base64 value. For Windows if filename, it MUST be ICO format. For Linux, must NOT be ICO |
+| bool | force_toplevel | If True will cause this window to skip the normal use of a hidden master window |
+| float | alpha_channel | Sets the opacity of the window. 0 = invisible 1 = completely visible. Values bewteen 0 & 1 will produce semi-transparent windows in SOME environments (The Raspberry Pi always has this value at 1 and cannot change. |
+| bool | return_keyboard_events | if True key presses on the keyboard will be returned as Events from Read calls |
+| bool | use_default_focus | If True will use the default focus algorithm to set the focus to the "Correct" element |
+| str | text_justification | Union ['left', 'right', 'center'] Default text justification for all Text Elements in window |
+| bool | no_titlebar | If true, no titlebar nor frame will be shown on window. This means you cannot minimize the window and it will not show up on the taskbar |
+| bool | grab_anywhere | If True can use mouse to click and drag to move the window. Almost every location of the window will work except input fields on some systems |
+| bool | keep_on_top | If True, window will be created on top of all other windows on screen. It can be bumped down if another window created with this parm |
+| bool | resizable | If True, allows the user to resize the window. Note the not all Elements will change size or location when resizing. |
+| bool | disable_close | If True, the X button in the top right corner of the window will no work. Use with caution and always give a way out toyour users |
+| bool | disable_minimize | if True the user won't be able to minimize window. Good for taking over entire screen and staying that way. |
+| List[List[Union[List[str],str]]] | right_click_menu | A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. |
+| str | transparent_color | Any portion of the window that has this color will be completely transparent. You can even click through these spots to the window under this window. |
+| bool | debugger_enabled | If True then the internal debugger will be enabled |
+| bool | finalize | If True then the Finalize method will be called. Use this rather than chaining .Finalize for cleaner code |
+| str | element_justification | All elements in the Window itself will have this justification 'left', 'right', 'center' are valid values |
+| str | ttk_theme | Set the tkinter ttk "theme" of the window. Default = DEFAULT_TTK_THEME. Sets all ttk widgets to this theme as their default |
+| bool | use_ttk_buttons | Affects all buttons in window. True = use ttk buttons. False = do not use ttk buttons. None = use ttk buttons only if on a Mac |
+| Any | metadata | User metadata that can be set to ANYTHING |
+
+### AddRow
+
+Adds a single row of elements to a window's self.Rows variables.
+Generally speaking this is NOT how users should be building Window layouts.
+Users, create a single layout (a list of lists) and pass as a parameter to Window object, or call Window.Layout(layout)
+
+```
+AddRow(args=*<1 or N object>)
+```
+
+### AddRows
+
+Loops through a list of lists of elements and adds each row, list, to the layout.
+This is NOT the best way to go about creating a window. Sending the entire layout at one time and passing
+it as a parameter to the Window call is better.
+
+```
+AddRows(rows)
+```
+
+### AlphaChannel
+
+#### property: AlphaChannel
+
+A property that changes the current alpha channel value (internal value)
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | (float) the current alpha channel setting according to self, not read directly from tkinter |
+
+### BringToFront
+
+Brings this window to the top of all other windows (perhaps may not be brought before a window made to "stay
+ on top")
+
+```python
+BringToFront()
+```
+
+### Close
+
+Closes window. Users can safely call even if window has been destroyed. Should always call when done with
+ a window so that resources are properly freed up within your thread.
+
+```python
+Close()
+```
+
+### CurrentLocation
+
+Get the current location of the window's top left corner
+
+`CurrentLocation()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | The x and y location in tuple form (x,y) |
+
+### Disable
+
+Disables window from taking any input from the user
+
+```python
+Disable()
+```
+
+### DisableDebugger
+
+Disable the internal debugger. By default the debugger is ENABLED
+
+```python
+DisableDebugger()
+```
+
+### Disappear
+
+Causes a window to "disappear" from the screen, but remain on the taskbar. It does this by turning the alpha
+ channel to 0. NOTE that on some platforms alpha is not supported. The window will remain showing on these
+ platforms. The Raspberry Pi for example does not have an alpha setting
+
+```python
+Disappear()
+```
+
+### Elem
+
+Find element object associated with the provided key.
+THIS METHOD IS NO LONGER NEEDED to be called by the user
+
+You can perform the same operation by writing this statement:
+element = window[key]
+
+You can drop the entire "FindElement" function name and use [ ] instead.
+
+Typically used in combination with a call to element's Update method (or any other element method!):
+window[key].Update(new_value)
+
+Versus the "old way"
+window.FindElement(key).Update(new_value)
+
+This call can be abbreviated to any of these:
+FindElement == Element == Find
+Rememeber that this call will return None if no match is found which may cause your code to crash if not
+checked for.
+
+```
+Elem(key, silent_on_error=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element |
+| bool | silent_on_error | If True do not display popup nor print warning of key errors |
+| Union[Element, Error Element, None] | **RETURN** | Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
+
+### Element
+
+Find element object associated with the provided key.
+THIS METHOD IS NO LONGER NEEDED to be called by the user
+
+You can perform the same operation by writing this statement:
+element = window[key]
+
+You can drop the entire "FindElement" function name and use [ ] instead.
+
+Typically used in combination with a call to element's Update method (or any other element method!):
+window[key].Update(new_value)
+
+Versus the "old way"
+window.FindElement(key).Update(new_value)
+
+This call can be abbreviated to any of these:
+FindElement == Element == Find
+Rememeber that this call will return None if no match is found which may cause your code to crash if not
+checked for.
+
+```
+Element(key, silent_on_error=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element |
+| bool | silent_on_error | If True do not display popup nor print warning of key errors |
+| Union[Element, Error Element, None] | **RETURN** | Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
+
+### Enable
+
+Re-enables window to take user input after having it be Disabled previously
+
+```python
+Enable()
+```
+
+### EnableDebugger
+
+Enables the internal debugger. By default, the debugger IS enabled
+
+```python
+EnableDebugger()
+```
+
+### Fill
+
+Fill in elements that are input fields with data based on a 'values dictionary'
+
+```
+Fill(values_dict)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| (Dict[Any:Any]) | values_dict | {Element key : value} pairs |
+| (Window) | **RETURN** | returns self so can be chained with other methods
+
+### Finalize
+
+Use this method to cause your layout to built into a real tkinter window. In reality this method is like
+Read(timeout=0). It doesn't block and uses your layout to create tkinter widgets to represent the elements.
+Lots of action!
+
+`Finalize()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | Returns 'self' so that method "Chaining" can happen (read up about it as it's very cool!) |
+
+### Find
+
+Find element object associated with the provided key.
+THIS METHOD IS NO LONGER NEEDED to be called by the user
+
+You can perform the same operation by writing this statement:
+element = window[key]
+
+You can drop the entire "FindElement" function name and use [ ] instead.
+
+Typically used in combination with a call to element's Update method (or any other element method!):
+window[key].Update(new_value)
+
+Versus the "old way"
+window.FindElement(key).Update(new_value)
+
+This call can be abbreviated to any of these:
+FindElement == Element == Find
+Rememeber that this call will return None if no match is found which may cause your code to crash if not
+checked for.
+
+```
+Find(key, silent_on_error=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element |
+| bool | silent_on_error | If True do not display popup nor print warning of key errors |
+| Union[Element, Error Element, None] | **RETURN** | Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
+
+### FindElement
+
+Find element object associated with the provided key.
+THIS METHOD IS NO LONGER NEEDED to be called by the user
+
+You can perform the same operation by writing this statement:
+element = window[key]
+
+You can drop the entire "FindElement" function name and use [ ] instead.
+
+Typically used in combination with a call to element's Update method (or any other element method!):
+window[key].Update(new_value)
+
+Versus the "old way"
+window.FindElement(key).Update(new_value)
+
+This call can be abbreviated to any of these:
+FindElement == Element == Find
+Rememeber that this call will return None if no match is found which may cause your code to crash if not
+checked for.
+
+```
+FindElement(key, silent_on_error=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element |
+| bool | silent_on_error | If True do not display popup nor print warning of key errors |
+| Union[Element, Error Element, None] | **RETURN** | Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
+
+### FindElementWithFocus
+
+Returns the Element that currently has focus as reported by tkinter. If no element is found None is returned!
+
+`FindElementWithFocus()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | An Element if one has been found with focus or None if no element found |
+
+### GetScreenDimensions
+
+Get the screen dimensions. NOTE - you must have a window already open for this to work (blame tkinter not me)
+
+`GetScreenDimensions()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | Tuple containing width and height of screen in pixels |
+
+### GrabAnyWhereOff
+
+Turns off Grab Anywhere functionality AFTER a window has been created. Don't try on a window that's not yet
+ been Finalized or Read.
+
+```python
+GrabAnyWhereOff()
+```
+
+### GrabAnyWhereOn
+
+Turns on Grab Anywhere functionality AFTER a window has been created. Don't try on a window that's not yet
+ been Finalized or Read.
+
+```python
+GrabAnyWhereOn()
+```
+
+### Hide
+
+Hides the window from the screen and the task bar
+
+```python
+Hide()
+```
+
+### Layout
+
+Second of two preferred ways of telling a Window what its layout is. The other way is to pass the layout as
+a parameter to Window object. The parameter method is the currently preferred method. This call to Layout
+has been removed from examples contained in documents and in the Demo Programs. Trying to remove this call
+from history and replace with sending as a parameter to Window.
+
+```
+Layout(rows)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[List[Elements]] | rows | Your entire layout |
+| (Window) | **RETURN** | self so that you can chain method calls
+
+### LoadFromDisk
+
+Restore values from a previous call to SaveToDisk which saves the returned values dictionary in Pickle format
+
+```
+LoadFromDisk(filename)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | filename | Pickle Filename to load |
+
+### Maximize
+
+Maximize the window. This is done differently on a windows system versus a linux or mac one. For non-Windows
+ the root attribute '-fullscreen' is set to True. For Windows the "root" state is changed to "zoomed"
+ The reason for the difference is the title bar is removed in some cases when using fullscreen option
+
+```python
+Maximize()
+```
+
+### Minimize
+
+Minimize this window to the task bar
+
+```python
+Minimize()
+```
+
+### Move
+
+Move the upper left corner of this window to the x,y coordinates provided
+
+```
+Move(x, y)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| int | x | x coordinate in pixels |
+| int | y | y coordinate in pixels |
+
+### Normal
+
+Restore a window to a non-maximized state. Does different things depending on platform. See Maximize for more.
+
+```python
+Normal()
+```
+
+### Read
+
+THE biggest deal method in the Window class! This is how you get all of your data from your Window.
+Pass in a timeout (in milliseconds) to wait for a maximum of timeout milliseconds. Will return timeout_key
+if no other GUI events happen first.
+
+```
+Read(timeout=None,
+ timeout_key="__TIMEOUT__",
+ close=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| int | timeout | Milliseconds to wait until the Read will return IF no other GUI events happen first |
+| Any | timeout_key | The value that will be returned from the call if the timer expired |
+| bool | close | if True the window will be closed prior to returning |
+| Tuple[(Any), Union[Dict[Any:Any]], List[Any], None] | **RETURN** | (event, values)
+
+### Reappear
+
+Causes a window previously made to "Disappear" (using that method). Does this by restoring the alpha channel
+
+```python
+Reappear()
+```
+
+### Refresh
+
+Refreshes the window by calling tkroot.update(). Can sometimes get away with a refresh instead of a Read.
+Use this call when you want something to appear in your Window immediately (as soon as this function is called).
+Without this call your changes to a Window will not be visible to the user until the next Read call
+
+`Refresh()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | `self` so that method calls can be easily "chained" |
+
+### SaveToDisk
+
+Saves the values contained in each of the input areas of the form. Basically saves what would be returned
+from a call to Read. It takes these results and saves them to disk using pickle
+
+```
+SaveToDisk(filename)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | filename | Filename to save the values to in pickled form |
+
+### SendToBack
+
+Pushes this window to the bottom of the stack of windows. It is the opposite of BringToFront
+
+```python
+SendToBack()
+```
+
+### SetAlpha
+
+Sets the Alpha Channel for a window. Values are between 0 and 1 where 0 is completely transparent
+
+```
+SetAlpha(alpha)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| float | alpha | 0 to 1. 0 is completely transparent. 1 is completely visible and solid (can't see through) |
+
+### SetIcon
+
+Changes the icon that is shown on the title bar and on the task bar.
+NOTE - The file type is IMPORTANT and depends on the OS!
+Can pass in:
+* filename which must be a .ICO icon file for windows, PNG file for Linux
+* bytes object
+* BASE64 encoded file held in a variable
+
+```
+SetIcon(icon=None, pngbase64=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | icon | Filename or bytes object |
+| str | pngbase64 | Base64 encoded image |
+
+### SetTransparentColor
+
+Set the color that will be transparent in your window. Areas with this color will be SEE THROUGH.
+
+```
+SetTransparentColor(color)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | color | Color string that defines the transparent color |
+
+### Size
+
+#### property: Size
+
+Return the current size of the window in pixels
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | (width, height) of the window |
+
+### UnHide
+
+Used to bring back a window that was previously hidden using the Hide method
+
+```python
+UnHide()
+```
+
+### VisibilityChanged
+
+This is a completely dummy method that does nothing. It is here so that PySimpleGUIQt programs can make this
+call and then have that same source run on plain PySimpleGUI.
+
+`VisibilityChanged()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | |
+
+### add_row
+
+Adds a single row of elements to a window's self.Rows variables.
+Generally speaking this is NOT how users should be building Window layouts.
+Users, create a single layout (a list of lists) and pass as a parameter to Window object, or call Window.Layout(layout)
+
+```
+add_row(args=*<1 or N object>)
+```
+
+### add_rows
+
+Loops through a list of lists of elements and adds each row, list, to the layout.
+This is NOT the best way to go about creating a window. Sending the entire layout at one time and passing
+it as a parameter to the Window call is better.
+
+```
+add_rows(rows)
+```
+
+### alpha_channel
+
+#### property: alpha_channel
+
+A property that changes the current alpha channel value (internal value)
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | (float) the current alpha channel setting according to self, not read directly from tkinter |
+
+### bind
+
+Used to add tkinter events to a Window.
+The tkinter specific data is in the Window's member variable user_bind_event
+
+```
+bind(bind_string, key)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | bind_string | The string tkinter expected in its bind function |
+| Any | key | The event that will be generated when the tkinter event occurs |
+
+### bring_to_front
+
+Brings this window to the top of all other windows (perhaps may not be brought before a window made to "stay
+ on top")
+
+```python
+bring_to_front()
+```
+
+### close
+
+Closes window. Users can safely call even if window has been destroyed. Should always call when done with
+ a window so that resources are properly freed up within your thread.
+
+```python
+close()
+```
+
+### current_location
+
+Get the current location of the window's top left corner
+
+`current_location()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | The x and y location in tuple form (x,y) |
+
+### disable
+
+Disables window from taking any input from the user
+
+```python
+disable()
+```
+
+### disable_debugger
+
+Disable the internal debugger. By default the debugger is ENABLED
+
+```python
+disable_debugger()
+```
+
+### disappear
+
+Causes a window to "disappear" from the screen, but remain on the taskbar. It does this by turning the alpha
+ channel to 0. NOTE that on some platforms alpha is not supported. The window will remain showing on these
+ platforms. The Raspberry Pi for example does not have an alpha setting
+
+```python
+disappear()
+```
+
+### elem
+
+Find element object associated with the provided key.
+THIS METHOD IS NO LONGER NEEDED to be called by the user
+
+You can perform the same operation by writing this statement:
+element = window[key]
+
+You can drop the entire "FindElement" function name and use [ ] instead.
+
+Typically used in combination with a call to element's Update method (or any other element method!):
+window[key].Update(new_value)
+
+Versus the "old way"
+window.FindElement(key).Update(new_value)
+
+This call can be abbreviated to any of these:
+FindElement == Element == Find
+Rememeber that this call will return None if no match is found which may cause your code to crash if not
+checked for.
+
+```
+elem(key, silent_on_error=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element |
+| bool | silent_on_error | If True do not display popup nor print warning of key errors |
+| Union[Element, Error Element, None] | **RETURN** | Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
+
+### element
+
+Find element object associated with the provided key.
+THIS METHOD IS NO LONGER NEEDED to be called by the user
+
+You can perform the same operation by writing this statement:
+element = window[key]
+
+You can drop the entire "FindElement" function name and use [ ] instead.
+
+Typically used in combination with a call to element's Update method (or any other element method!):
+window[key].Update(new_value)
+
+Versus the "old way"
+window.FindElement(key).Update(new_value)
+
+This call can be abbreviated to any of these:
+FindElement == Element == Find
+Rememeber that this call will return None if no match is found which may cause your code to crash if not
+checked for.
+
+```
+element(key, silent_on_error=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element |
+| bool | silent_on_error | If True do not display popup nor print warning of key errors |
+| Union[Element, Error Element, None] | **RETURN** | Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
+
+### element_list
+
+Returns a list of all elements in the window
+
+`element_list()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | List of all elements in the window and container elements in the window |
+
+### enable
+
+Re-enables window to take user input after having it be Disabled previously
+
+```python
+enable()
+```
+
+### enable_debugger
+
+Enables the internal debugger. By default, the debugger IS enabled
+
+```python
+enable_debugger()
+```
+
+### extend_layout
+
+Adds new rows to an existing container element inside of this window
+
+```
+extend_layout(container, rows)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| (Union[Frame, Column, Tab]) | container | (Union[Frame, Column, Tab]) - The container Element the layout will be placed inside of |
+| (List[List[Element]]) | rows | (List[List[Element]]) - The layout to be added |
+| (Window) | **RETURN** | (Window) self so could be chained
+
+### fill
+
+Fill in elements that are input fields with data based on a 'values dictionary'
+
+```
+fill(values_dict)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| (Dict[Any:Any]) | values_dict | {Element key : value} pairs |
+| (Window) | **RETURN** | returns self so can be chained with other methods
+
+### finalize
+
+Use this method to cause your layout to built into a real tkinter window. In reality this method is like
+Read(timeout=0). It doesn't block and uses your layout to create tkinter widgets to represent the elements.
+Lots of action!
+
+`finalize()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | Returns 'self' so that method "Chaining" can happen (read up about it as it's very cool!) |
+
+### find
+
+Find element object associated with the provided key.
+THIS METHOD IS NO LONGER NEEDED to be called by the user
+
+You can perform the same operation by writing this statement:
+element = window[key]
+
+You can drop the entire "FindElement" function name and use [ ] instead.
+
+Typically used in combination with a call to element's Update method (or any other element method!):
+window[key].Update(new_value)
+
+Versus the "old way"
+window.FindElement(key).Update(new_value)
+
+This call can be abbreviated to any of these:
+FindElement == Element == Find
+Rememeber that this call will return None if no match is found which may cause your code to crash if not
+checked for.
+
+```
+find(key, silent_on_error=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element |
+| bool | silent_on_error | If True do not display popup nor print warning of key errors |
+| Union[Element, Error Element, None] | **RETURN** | Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
+
+### find_element
+
+Find element object associated with the provided key.
+THIS METHOD IS NO LONGER NEEDED to be called by the user
+
+You can perform the same operation by writing this statement:
+element = window[key]
+
+You can drop the entire "FindElement" function name and use [ ] instead.
+
+Typically used in combination with a call to element's Update method (or any other element method!):
+window[key].Update(new_value)
+
+Versus the "old way"
+window.FindElement(key).Update(new_value)
+
+This call can be abbreviated to any of these:
+FindElement == Element == Find
+Rememeber that this call will return None if no match is found which may cause your code to crash if not
+checked for.
+
+```
+find_element(key, silent_on_error=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | key | Used with window.FindElement and with return values to uniquely identify this element |
+| bool | silent_on_error | If True do not display popup nor print warning of key errors |
+| Union[Element, Error Element, None] | **RETURN** | Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
+
+### find_element_with_focus
+
+Returns the Element that currently has focus as reported by tkinter. If no element is found None is returned!
+
+`find_element_with_focus()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | An Element if one has been found with focus or None if no element found |
+
+### get_screen_dimensions
+
+Get the screen dimensions. NOTE - you must have a window already open for this to work (blame tkinter not me)
+
+`get_screen_dimensions()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | Tuple containing width and height of screen in pixels |
+
+### get_screen_size
+
+Returns the size of the "screen" as determined by tkinter. This can vary depending on your operating system and the number of monitors installed on your system. For Windows, the primary monitor's size is returns. On some multi-monitored Linux systems, the monitors are combined and the total size is reported as if one screen.
+
+```
+get_screen_size() -> Tuple[int, int] - Size of the screen in pixels as determined by tkinter
+```
+
+### grab_any_where_off
+
+Turns off Grab Anywhere functionality AFTER a window has been created. Don't try on a window that's not yet
+ been Finalized or Read.
+
+```python
+grab_any_where_off()
+```
+
+### grab_any_where_on
+
+Turns on Grab Anywhere functionality AFTER a window has been created. Don't try on a window that's not yet
+ been Finalized or Read.
+
+```python
+grab_any_where_on()
+```
+
+### hide
+
+Hides the window from the screen and the task bar
+
+```python
+hide()
+```
+
+### layout
+
+Second of two preferred ways of telling a Window what its layout is. The other way is to pass the layout as
+a parameter to Window object. The parameter method is the currently preferred method. This call to Layout
+has been removed from examples contained in documents and in the Demo Programs. Trying to remove this call
+from history and replace with sending as a parameter to Window.
+
+```
+layout(rows)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| List[List[Elements]] | rows | Your entire layout |
+| (Window) | **RETURN** | self so that you can chain method calls
+
+### load_from_disk
+
+Restore values from a previous call to SaveToDisk which saves the returned values dictionary in Pickle format
+
+```
+load_from_disk(filename)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | filename | Pickle Filename to load |
+
+### maximize
+
+Maximize the window. This is done differently on a windows system versus a linux or mac one. For non-Windows
+ the root attribute '-fullscreen' is set to True. For Windows the "root" state is changed to "zoomed"
+ The reason for the difference is the title bar is removed in some cases when using fullscreen option
+
+```python
+maximize()
+```
+
+### minimize
+
+Minimize this window to the task bar
+
+```python
+minimize()
+```
+
+### move
+
+Move the upper left corner of this window to the x,y coordinates provided
+
+```
+move(x, y)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| int | x | x coordinate in pixels |
+| int | y | y coordinate in pixels |
+
+### normal
+
+Restore a window to a non-maximized state. Does different things depending on platform. See Maximize for more.
+
+```python
+normal()
+```
+
+### read
+
+THE biggest deal method in the Window class! This is how you get all of your data from your Window.
+Pass in a timeout (in milliseconds) to wait for a maximum of timeout milliseconds. Will return timeout_key
+if no other GUI events happen first.
+
+```
+read(timeout=None,
+ timeout_key="__TIMEOUT__",
+ close=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| int | timeout | Milliseconds to wait until the Read will return IF no other GUI events happen first |
+| Any | timeout_key | The value that will be returned from the call if the timer expired |
+| bool | close | if True the window will be closed prior to returning |
+| Tuple[(Any), Union[Dict[Any:Any]], List[Any], None] | **RETURN** | (event, values)
+
+### reappear
+
+Causes a window previously made to "Disappear" (using that method). Does this by restoring the alpha channel
+
+```python
+reappear()
+```
+
+### refresh
+
+Refreshes the window by calling tkroot.update(). Can sometimes get away with a refresh instead of a Read.
+Use this call when you want something to appear in your Window immediately (as soon as this function is called).
+Without this call your changes to a Window will not be visible to the user until the next Read call
+
+`refresh()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | `self` so that method calls can be easily "chained" |
+
+### save_to_disk
+
+Saves the values contained in each of the input areas of the form. Basically saves what would be returned
+from a call to Read. It takes these results and saves them to disk using pickle
+
+```
+save_to_disk(filename)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | filename | Filename to save the values to in pickled form |
+
+### send_to_back
+
+Pushes this window to the bottom of the stack of windows. It is the opposite of BringToFront
+
+```python
+send_to_back()
+```
+
+### set_alpha
+
+Sets the Alpha Channel for a window. Values are between 0 and 1 where 0 is completely transparent
+
+```
+set_alpha(alpha)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| float | alpha | 0 to 1. 0 is completely transparent. 1 is completely visible and solid (can't see through) |
+
+### set_icon
+
+Changes the icon that is shown on the title bar and on the task bar.
+NOTE - The file type is IMPORTANT and depends on the OS!
+Can pass in:
+* filename which must be a .ICO icon file for windows, PNG file for Linux
+* bytes object
+* BASE64 encoded file held in a variable
+
+```
+set_icon(icon=None, pngbase64=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | icon | Filename or bytes object |
+| str | pngbase64 | Base64 encoded image |
+
+### set_transparent_color
+
+Set the color that will be transparent in your window. Areas with this color will be SEE THROUGH.
+
+```
+set_transparent_color(color)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | color | Color string that defines the transparent color |
+
+### size
+
+#### property: size
+
+Return the current size of the window in pixels
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | (width, height) of the window |
+
+### un_hide
+
+Used to bring back a window that was previously hidden using the Hide method
+
+```python
+un_hide()
+```
+
+### visibility_changed
+
+This is a completely dummy method that does nothing. It is here so that PySimpleGUIQt programs can make this
+call and then have that same source run on plain PySimpleGUI.
+
+`visibility_changed()`
+
+|Type|Name|Meaning|
+|---|---|---|
+|| **return** | |
+
+## Function Reference
+
+```
+CButton(button_text,
+ image_filename=None,
+ image_data=None,
+ image_size=(None, None),
+ image_subsample=None,
+ border_width=None,
+ tooltip=None,
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ font=None,
+ bind_return_key=False,
+ disabled=False,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | button_text | text in the button |
+| str | image_filename | image filename if there is a button image :param image_data: in-RAM image to be displayed on button :param image_size: size of button image in pixels :param image_subsample:amount to reduce the size of the image :param border_width: width of border around element :param tooltip: text, that will appear when mouse hovers over the element |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | bind_return_key | (Default = False) :param disabled: set disable state for element (Default = False) |
+| (int, int) or ((int,int),(int,int)) | focus | if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+```
+CalendarButton(button_text,
+ target=(None, None),
+ close_when_date_chosen=True,
+ default_date_m_d_y=(None, None, None),
+ image_filename=None,
+ image_data=None,
+ image_size=(None, None),
+ image_subsample=None,
+ tooltip=None,
+ border_width=None,
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ disabled=False,
+ font=None,
+ bind_return_key=False,
+ focus=False,
+ pad=None,
+ key=None,
+ locale=None,
+ format=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | button_text | text in the button |
+| str | target | :param close_when_date_chosen: (Default = True) :param default_date_m_d_y: (Default = (None)) :param image_filename: image filename if there is a button image :param image_data: in-RAM image to be displayed on button :param image_size: (Default = (None)) :param image_subsample:amount to reduce the size of the image :param tooltip: text, that will appear when mouse hovers over the element |
+| Tuple[int, int] | border_width | width of border around element :param size: (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | disabled | set disable state for element (Default = False) |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| (int, int) or ((int,int),(int,int)) | bind_return_key | (Default = False) :param focus: if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+```
+Cancel(button_text="Cancel",
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ disabled=False,
+ tooltip=None,
+ font=None,
+ bind_return_key=False,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | button_text | text in the button (Default value = 'Cancel') :param size: (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | disabled | set disable state for element (Default = False) |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| (int, int) or ((int,int),(int,int)) | bind_return_key | (Default = False) :param focus: if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+
+```
+CloseButton(button_text,
+ image_filename=None,
+ image_data=None,
+ image_size=(None, None),
+ image_subsample=None,
+ border_width=None,
+ tooltip=None,
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ font=None,
+ bind_return_key=False,
+ disabled=False,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | button_text | text in the button |
+| str | image_filename | image filename if there is a button image :param image_data: in-RAM image to be displayed on button :param image_size: size of button image in pixels :param image_subsample:amount to reduce the size of the image :param border_width: width of border around element :param tooltip: text, that will appear when mouse hovers over the element |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | bind_return_key | (Default = False) :param disabled: set disable state for element (Default = False) |
+| (int, int) or ((int,int),(int,int)) | focus | if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+```
+ColorChooserButton(button_text,
+ target=(None, None),
+ image_filename=None,
+ image_data=None,
+ image_size=(None, None),
+ image_subsample=None,
+ tooltip=None,
+ border_width=None,
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ disabled=False,
+ font=None,
+ bind_return_key=False,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | button_text | text in the button |
+| str | target | :param image_filename: image filename if there is a button image :param image_data: in-RAM image to be displayed on button :param image_size: (Default = (None)) :param image_subsample:amount to reduce the size of the image :param tooltip: text, that will appear when mouse hovers over the element |
+| Tuple[int, int] | border_width | width of border around element :param size: (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | disabled | set disable state for element (Default = False) |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| (int, int) or ((int,int),(int,int)) | bind_return_key | (Default = False) :param focus: if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+```
+Debug(button_text="",
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ disabled=False,
+ font=None,
+ tooltip=None,
+ bind_return_key=False,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | button_text | text in the button (Default value = '') :param size: (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | disabled | set disable state for element (Default = False) |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| (int, int) or ((int,int),(int,int)) | bind_return_key | (Default = False) :param focus: if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+```
+DummyButton(button_text,
+ image_filename=None,
+ image_data=None,
+ image_size=(None, None),
+ image_subsample=None,
+ border_width=None,
+ tooltip=None,
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ font=None,
+ disabled=False,
+ bind_return_key=False,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | button_text | text in the button |
+| str | image_filename | image filename if there is a button image :param image_data: in-RAM image to be displayed on button :param image_size: size of button image in pixels :param image_subsample:amount to reduce the size of the image :param border_width: width of border around element :param tooltip: text, that will appear when mouse hovers over the element |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | disabled | set disable state for element (Default = False) |
+| (int, int) or ((int,int),(int,int)) | bind_return_key | (Default = False) :param focus: if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+```
+Exit(button_text="Exit",
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ disabled=False,
+ tooltip=None,
+ font=None,
+ bind_return_key=False,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | button_text | text in the button (Default value = 'Exit') :param size: (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | disabled | set disable state for element (Default = False) |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| (int, int) or ((int,int),(int,int)) | bind_return_key | (Default = False) :param focus: if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+
+```
+FileBrowse(button_text="Browse",
+ target=(555666777, -1),
+ file_types=(('ALL Files', '*.*'),),
+ initial_folder=None,
+ tooltip=None,
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ change_submits=False,
+ enable_events=False,
+ font=None,
+ disabled=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | button_text | text in the button (Default value = 'Browse') :param target: key or (row,col) target for the button (Default value = (ThisRow, -1)) :param file_types: (Default value = (("ALL Files", "*.*"))) :param initial_folder: starting path for folders and files :param tooltip: text, that will appear when mouse hovers over the element |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| Union[str, Tuple[str, int]] | change_submits | If True, pressing Enter key submits window (Default = False) :param enable_events: Turns on the element specific events.(Default = False) :param font: specifies the font family, size, etc |
+| bool | disabled | set disable state for element (Default = False) |
+| (int, int) or ((int,int),(int,int)) | pad | Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+```
+FileSaveAs(button_text="Save As...",
+ target=(555666777, -1),
+ file_types=(('ALL Files', '*.*'),),
+ initial_folder=None,
+ disabled=False,
+ tooltip=None,
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ change_submits=False,
+ enable_events=False,
+ font=None,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | button_text | text in the button (Default value = 'Save As...') :param target: key or (row,col) target for the button (Default value = (ThisRow, -1)) :param file_types: (Default value = (("ALL Files", "*.*"))) :param initial_folder: starting path for folders and files :param disabled: set disable state for element (Default = False) |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| Union[str, Tuple[str, int]] | change_submits | If True, pressing Enter key submits window (Default = False) :param enable_events: Turns on the element specific events.(Default = False) :param font: specifies the font family, size, etc |
+| (int, int) or ((int,int),(int,int)) | pad | Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+Allows browsing of multiple files. File list is returned as a single list with the delimeter defined using the variable
+BROWSE_FILES_DELIMETER. This defaults to ';' but is changable by the user
+
+```
+FilesBrowse(button_text="Browse",
+ target=(555666777, -1),
+ file_types=(('ALL Files', '*.*'),),
+ disabled=False,
+ initial_folder=None,
+ tooltip=None,
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ change_submits=False,
+ enable_events=False,
+ font=None,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | button_text | text in the button (Default value = 'Browse') :param target: key or (row,col) target for the button (Default value = (ThisRow, -1)) :param file_types: (Default value = (("ALL Files", "*.*"))) :param disabled: set disable state for element (Default = False) |
+| str | initial_folder | starting path for folders and files :param tooltip: text, that will appear when mouse hovers over the element |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| Union[str, Tuple[str, int]] | change_submits | If True, pressing Enter key submits window (Default = False) :param enable_events: Turns on the element specific events.(Default = False) :param font: specifies the font family, size, etc |
+| (int, int) or ((int,int),(int,int)) | pad | Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+Fills a window with values provided in a values dictionary { element_key : new_value }
+
+```
+FillFormWithValues(window, values_dict)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Window | window | The window object to fill |
+| (Dict[Any:Any]) | values_dict | A dictionary with element keys as key and value is values parm for Update call |
+
+```
+FolderBrowse(button_text="Browse",
+ target=(555666777, -1),
+ initial_folder=None,
+ tooltip=None,
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ disabled=False,
+ change_submits=False,
+ enable_events=False,
+ font=None,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | button_text | text in the button (Default value = 'Browse') |
+| key or (row,col) | target | target for the button (Default value = (ThisRow, -1)) |
+| str | initial_folder | starting path for folders and files |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+
+```
+Help(button_text="Help",
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ disabled=False,
+ font=None,
+ tooltip=None,
+ bind_return_key=False,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | button_text | text in the button (Default value = 'Help') :param size: (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | disabled | set disable state for element (Default = False) |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| (int, int) or ((int,int),(int,int)) | bind_return_key | (Default = False) :param focus: if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+```
+No(button_text="No",
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ disabled=False,
+ tooltip=None,
+ font=None,
+ bind_return_key=False,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | button_text | text in the button (Default value = 'No') :param size: (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | disabled | set disable state for element (Default = False) |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| (int, int) or ((int,int),(int,int)) | bind_return_key | (Default = False) :param focus: if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+
+```
+OK(button_text="OK",
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ disabled=False,
+ bind_return_key=True,
+ tooltip=None,
+ font=None,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | button_text | text in the button (Default value = 'OK') :param size: (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | disabled | set disable state for element (Default = False) |
+| str | bind_return_key | (Default = True) :param tooltip: text, that will appear when mouse hovers over the element |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| (int, int) or ((int,int),(int,int)) | focus | if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+Dumps an Object's values as a formatted string. Very nicely done. Great way to display an object's member variables in human form
+
+```
+ObjToString(obj, extra=" ")
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | obj | The object to display |
+| str | extra | (Default value = ' ') |
+| (str) | **RETURN** | Formatted output of the object's values
+
+Dumps an Object's values as a formatted string. Very nicely done. Great way to display an object's member variables in human form
+Returns only the top-most object's variables instead of drilling down to dispolay more
+
+```
+ObjToStringSingleObj(obj)
+```
+
+```
+Ok(button_text="Ok",
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ disabled=False,
+ bind_return_key=True,
+ tooltip=None,
+ font=None,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | button_text | text in the button (Default value = 'Ok') :param size: (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | disabled | set disable state for element (Default = False) |
+| str | bind_return_key | (Default = True) :param tooltip: text, that will appear when mouse hovers over the element |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| (int, int) or ((int,int),(int,int)) | focus | if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+```
+Open(button_text="Open",
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ disabled=False,
+ bind_return_key=True,
+ tooltip=None,
+ font=None,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | button_text | text in the button (Default value = 'Open') :param size: (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | disabled | set disable state for element (Default = False) |
+| str | bind_return_key | (Default = True) :param tooltip: text, that will appear when mouse hovers over the element |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| (int, int) or ((int,int),(int,int)) | focus | if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+
+```
+Quit(button_text="Quit",
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ disabled=False,
+ tooltip=None,
+ font=None,
+ bind_return_key=False,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | button_text | text in the button (Default value = 'Quit') :param size: (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | disabled | set disable state for element (Default = False) |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| (int, int) or ((int,int),(int,int)) | bind_return_key | (Default = False) :param focus: if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+```
+RButton(button_text,
+ image_filename=None,
+ image_data=None,
+ image_size=(None, None),
+ image_subsample=None,
+ border_width=None,
+ tooltip=None,
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ font=None,
+ bind_return_key=False,
+ disabled=False,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | button_text | text in the button |
+| str | image_filename | image filename if there is a button image :param image_data: in-RAM image to be displayed on button :param image_size: size of button image in pixels :param image_subsample:amount to reduce the size of the image :param border_width: width of border around element :param tooltip: text, that will appear when mouse hovers over the element |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | bind_return_key | (Default = False) :param disabled: set disable state for element (Default = False) |
+| (int, int) or ((int,int),(int,int)) | focus | if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+
+```
+ReadButton(button_text,
+ image_filename=None,
+ image_data=None,
+ image_size=(None, None),
+ image_subsample=None,
+ border_width=None,
+ tooltip=None,
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ font=None,
+ bind_return_key=False,
+ disabled=False,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | button_text | text in the button |
+| str | image_filename | image filename if there is a button image :param image_data: in-RAM image to be displayed on button :param image_size: size of button image in pixels :param image_subsample:amount to reduce the size of the image :param border_width: width of border around element :param tooltip: text, that will appear when mouse hovers over the element |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | bind_return_key | (Default = False) :param disabled: set disable state for element (Default = False) |
+| (int, int) or ((int,int),(int,int)) | focus | if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+
+```
+RealtimeButton(button_text,
+ image_filename=None,
+ image_data=None,
+ image_size=(None, None),
+ image_subsample=None,
+ border_width=None,
+ tooltip=None,
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ font=None,
+ disabled=False,
+ bind_return_key=False,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | button_text | text in the button |
+| str | image_filename | image filename if there is a button image :param image_data: in-RAM image to be displayed on button :param image_size: size of button image in pixels :param image_subsample:amount to reduce the size of the image :param border_width: width of border around element :param tooltip: text, that will appear when mouse hovers over the element |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | disabled | set disable state for element (Default = False) |
+| (int, int) or ((int,int),(int,int)) | bind_return_key | (Default = False) :param focus: if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+
+```
+Save(button_text="Save",
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ bind_return_key=True,
+ disabled=False,
+ tooltip=None,
+ font=None,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | button_text | text in the button (Default value = 'Save') :param size: (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | bind_return_key | (Default = True) :param disabled: set disable state for element (Default = False) |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| (int, int) or ((int,int),(int,int)) | focus | if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+```
+SaveAs(button_text="Save As...",
+ target=(555666777, -1),
+ file_types=(('ALL Files', '*.*'),),
+ initial_folder=None,
+ disabled=False,
+ tooltip=None,
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ change_submits=False,
+ enable_events=False,
+ font=None,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| bool | button_text | text in the button (Default value = 'Save As...') :param target: key or (row,col) target for the button (Default value = (ThisRow, -1)) :param file_types: (Default value = (("ALL Files", "*.*"))) :param initial_folder: starting path for folders and files :param disabled: set disable state for element (Default = False) |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| Union[str, Tuple[str, int]] | change_submits | If True, pressing Enter key submits window (Default = False) :param enable_events: Turns on the element specific events.(Default = False) :param font: specifies the font family, size, etc |
+| (int, int) or ((int,int),(int,int)) | pad | Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+Show a scrolled Popup window containing the user's text that was supplied. Use with as many items to print as you
+want, just like a print statement.
+
+```
+ScrolledTextBox(args=*<1 or N object>,
+ title=None,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ yes_no=False,
+ auto_close=False,
+ auto_close_duration=None,
+ size=(None, None),
+ location=(None, None),
+ non_blocking=False,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ font=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | yes_no | If True, displays Yes and No buttons instead of Ok |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| Tuple[int, int] | location | Location on the screen to place the upper left corner of the window |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[str, None, TIMEOUT_KEY] | **RETURN** | Returns text of the button that was pressed. None will be returned if user closed window with X
+
+Sets the icon which will be used any time a window is created if an icon is not provided when the
+window is created.
+
+```
+SetGlobalIcon(icon)
+```
+
+```
+SetOptions(icon=None,
+ button_color=None,
+ element_size=(None, None),
+ button_element_size=(None, None),
+ margins=(None, None),
+ element_padding=(None, None),
+ auto_size_text=None,
+ auto_size_buttons=None,
+ font=None,
+ border_width=None,
+ slider_border_width=None,
+ slider_relief=None,
+ slider_orientation=None,
+ autoclose_time=None,
+ message_box_line_width=None,
+ progress_meter_border_depth=None,
+ progress_meter_style=None,
+ progress_meter_relief=None,
+ progress_meter_color=None,
+ progress_meter_size=None,
+ text_justification=None,
+ background_color=None,
+ element_background_color=None,
+ text_element_background_color=None,
+ input_elements_background_color=None,
+ input_text_color=None,
+ scrollbar_color=None,
+ text_color=None,
+ element_text_color=None,
+ debug_win_size=(None, None),
+ window_location=(None, None),
+ error_button_color=(None, None),
+ tooltip_time=None,
+ use_ttk_buttons=None,
+ ttk_theme=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| Tuple[str, str] | button_color | Color of the button (text, background) |
+| Tuple[int, int] | element_size | element size (width, height) in characters |
+| Tuple[int, int] | button_element_size | Size of button |
+| Tuple[int, int] | margins | (left/right, top/bottom) tkinter margins around outsize. Amount of pixels to leave inside the window's frame around the edges before your elements are shown. |
+| Tuple[int, int] or ((int, int),(int,int)) | element_padding | Default amount of padding to put around elements in window (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| bool | auto_size_text | True if the Widget should be shrunk to exactly fit the number of chars to show |
+| bool | auto_size_buttons | True if Buttons in this Window should be sized to exactly fit the text on this. |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| int | border_width | width of border around element |
+| ??? | slider_border_width | ??? |
+| ??? | slider_relief | ??? |
+| ??? | slider_orientation | ??? |
+| ??? | autoclose_time | ??? |
+| ??? | message_box_line_width | ??? |
+| ??? | progress_meter_border_depth | ??? |
+| --- | progress_meter_style | You can no longer set a progress bar style. All ttk styles must be the same for the window |
+| str | progress_meter_relief | :param progress_meter_color: :param progress_meter_size: :param text_justification: Union ['left', 'right', 'center'] Default text justification for all Text Elements in window |
+| str | background_color | color of background |
+| str | element_background_color | element background color |
+| str | text_element_background_color | text element background color |
+| str | input_elements_background_color | :param input_text_color: :param scrollbar_color: :param text_color: color of the text |
+| ??? | element_text_color | ??? |
+| Tuple[int, int] | debug_win_size | (Default = (None)) |
+| ??? | window_location | (Default = (None)) |
+| ??? | error_button_color | (Default = (None)) |
+| int | tooltip_time | time in milliseconds to wait before showing a tooltip. Default is 400ms |
+| bool | use_ttk_buttons | if True will cause all buttons to be ttk buttons |
+| str | ttk_theme | (str) Theme to use with ttk widgets. Choices (on Windows) include - 'default', 'winnative', 'clam', 'alt', 'classic', 'vista', 'xpnative' |
+
+```
+Submit(button_text="Submit",
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ disabled=False,
+ bind_return_key=True,
+ tooltip=None,
+ font=None,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | button_text | text in the button (Default value = 'Submit') :param size: (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | disabled | set disable state for element (Default = False) |
+| str | bind_return_key | (Default = True) :param tooltip: text, that will appear when mouse hovers over the element |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| (int, int) or ((int,int),(int,int)) | focus | if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+```
+Yes(button_text="Yes",
+ size=(None, None),
+ auto_size_button=None,
+ button_color=None,
+ disabled=False,
+ tooltip=None,
+ font=None,
+ bind_return_key=True,
+ focus=False,
+ pad=None,
+ key=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | button_text | text in the button (Default value = 'Yes') :param size: (w,h) w=characters-wide, h=rows-high |
+| bool | auto_size_button | True if button size is determined by button text |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | disabled | set disable state for element (Default = False) |
+| str | tooltip | text, that will appear when mouse hovers over the element |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| (int, int) or ((int,int),(int,int)) | bind_return_key | (Default = True) :param focus: if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) |
+| Union[str, int, tuple] | key | key for uniquely identify this element (for window.FindElement) |
+| (Button) | **RETURN** | returns a button
+
+## Debug Window Output
+
+```
+easy_print(args=*<1 or N object>,
+ size=(None, None),
+ end=None,
+ sep=None,
+ location=(None, None),
+ font=None,
+ no_titlebar=False,
+ no_button=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ do_not_reroute_stdout=True,
+ text_color=None,
+ background_color=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | stuff to output |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| str | sep | end character |
+| str | sep | separator character |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | no_button | don't show button |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| bool | do_not_reroute_stdout | do not reroute stdout |
+
+```
+eprint(args=*<1 or N object>,
+ size=(None, None),
+ end=None,
+ sep=None,
+ location=(None, None),
+ font=None,
+ no_titlebar=False,
+ no_button=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ do_not_reroute_stdout=True,
+ text_color=None,
+ background_color=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | stuff to output |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| str | sep | end character |
+| str | sep | separator character |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | no_button | don't show button |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| bool | do_not_reroute_stdout | do not reroute stdout |
+
+```
+sgprint(args=*<1 or N object>,
+ size=(None, None),
+ end=None,
+ sep=None,
+ location=(None, None),
+ font=None,
+ no_titlebar=False,
+ no_button=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ do_not_reroute_stdout=True,
+ text_color=None,
+ background_color=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | stuff to output |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| str | sep | end character |
+| str | sep | separator character |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | no_button | don't show button |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| bool | do_not_reroute_stdout | do not reroute stdout |
+
+```
+EasyPrint(args=*<1 or N object>,
+ size=(None, None),
+ end=None,
+ sep=None,
+ location=(None, None),
+ font=None,
+ no_titlebar=False,
+ no_button=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ do_not_reroute_stdout=True,
+ text_color=None,
+ background_color=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | stuff to output |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| str | sep | end character |
+| str | sep | separator character |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | no_button | don't show button |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| bool | do_not_reroute_stdout | do not reroute stdout |
+
+```
+Print(args=*<1 or N object>,
+ size=(None, None),
+ end=None,
+ sep=None,
+ location=(None, None),
+ font=None,
+ no_titlebar=False,
+ no_button=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ do_not_reroute_stdout=True,
+ text_color=None,
+ background_color=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | stuff to output |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| str | sep | end character |
+| str | sep | separator character |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | no_button | don't show button |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| bool | do_not_reroute_stdout | do not reroute stdout |
+
+## OneLineProgressMeter
+
+```
+OneLineProgressMeter(title,
+ current_value,
+ max_value,
+ key,
+ args=*<1 or N object>,
+ orientation="v",
+ bar_color=(None, None),
+ button_color=None,
+ size=(20, 20),
+ border_width=None,
+ grab_anywhere=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | title | text to display in eleemnt |
+| int | current_value | current value |
+| int | max_value | max value of QuickMeter |
+| Union[str, int, tuple] | key | Used with window.FindElement and with return values to uniquely identify this element |
+| Any | *args | stuff to output |
+| str | orientation | 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical' / 'v') |
+| str | bar_color | color of a bar line |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE) |
+| int | border_width | width of border around element |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| (bool) | **RETURN** | True if updated successfully. False if user closed the meter with the X or Cancel button
+
+Cancels and closes a previously created One Line Progress Meter window
+
+```
+OneLineProgressMeterCancel(key)
+```
+
+```
+one_line_progress_meter(title,
+ current_value,
+ max_value,
+ key,
+ args=*<1 or N object>,
+ orientation="v",
+ bar_color=(None, None),
+ button_color=None,
+ size=(20, 20),
+ border_width=None,
+ grab_anywhere=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | title | text to display in eleemnt |
+| int | current_value | current value |
+| int | max_value | max value of QuickMeter |
+| Union[str, int, tuple] | key | Used with window.FindElement and with return values to uniquely identify this element |
+| Any | *args | stuff to output |
+| str | orientation | 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical' / 'v') |
+| str | bar_color | color of a bar line |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE) |
+| int | border_width | width of border around element |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| (bool) | **RETURN** | True if updated successfully. False if user closed the meter with the X or Cancel button
+
+Cancels and closes a previously created One Line Progress Meter window
+
+```
+one_line_progress_meter_cancel(key)
+```
+
+## Popup Functions
+
+Popup - Display a popup Window with as many parms as you wish to include. This is the GUI equivalent of the
+"print" statement. It's also great for "pausing" your program's flow until the user can read some error messages.
+
+```
+Popup(args=*<1 or N object>,
+ title=None,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ button_type=0,
+ auto_close=False,
+ auto_close_duration=None,
+ custom_text=(None, None),
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of your arguments. Load up the call with stuff to see! |
+| str | title | Optional title for the window. If none provided, the first arg will be used instead. |
+| Tuple[str, str] | button_color | Color of the buttons shown (text color, button color) |
+| str | background_color | Window's background color |
+| str | text_color | text color |
+| enum | button_type | NOT USER SET! Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). There are many Popup functions and they call Popup, changing this parameter to get the desired effect. |
+| bool | auto_close | If True the window will automatically close |
+| int | auto_close_duration | time in seconds to keep window open before closing it automatically |
+| Union[Tuple[str, str], str] | custom_text | A string or pair of strings that contain the text to display on the buttons |
+| bool | non_blocking | If True then will immediately return from the function without waiting for the user's input. |
+| Union[str, bytes] | icon | icon to display on the window. Same format as a Window call |
+| int | line_width | Width of lines in characters. Defaults to MESSAGE_BOX_LINE_WIDTH |
+| Union[str, tuple(font name, size, modifiers] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True will not show the frame around the window and the titlebar across the top |
+| bool | grab_anywhere | If True can grab anywhere to move the window. If no_titlebar is True, grab_anywhere should likely be enabled too |
+| Tuple[int, int] | location | Location on screen to display the top left corner of window. Defaults to window centered on screen |
+| Union[str, None] | **RETURN** | Returns text of the button that was pressed. None will be returned if user closed window with X
+
+Show animation one frame at a time. This function has its own internal clocking meaning you can call it at any frequency
+ and the rate the frames of video is shown remains constant. Maybe your frames update every 30 ms but your
+ event loop is running every 10 ms. You don't have to worry about delaying, just call it every time through the
+ loop.
+
+```
+PopupAnimated(image_source,
+ message=None,
+ background_color=None,
+ text_color=None,
+ font=None,
+ no_titlebar=True,
+ grab_anywhere=True,
+ keep_on_top=True,
+ location=(None, None),
+ alpha_channel=None,
+ time_between_frames=0,
+ transparent_color=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[str, bytes] | image_source | Either a filename or a base64 string. |
+| str | message | An optional message to be shown with the animation |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| Union[str, tuple] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True then the titlebar and window frame will not be shown |
+| bool | grab_anywhere | If True then you can move the window just clicking anywhere on window, hold and drag |
+| bool | keep_on_top | If True then Window will remain on top of all other windows currently shownn |
+| (int, int) | location | (x,y) location on the screen to place the top left corner of your window. Default is to center on screen |
+| float | alpha_channel | Window transparency 0 = invisible 1 = completely visible. Values between are see through |
+| int | time_between_frames | Amount of time in milliseconds between each frame |
+| str | transparent_color | This color will be completely see-through in your window. Can even click through |
+
+Display a Popup without a titlebar. Enables grab anywhere so you can move it
+
+```
+PopupAnnoying(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ grab_anywhere=True,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Popup that closes itself after some time period
+
+```
+PopupAutoClose(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=True,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Display Popup with "cancelled" button text
+
+```
+PopupCancel(args=*<1 or N object>,
+ title=None,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Popup with colored button and 'Error' as button text
+
+```
+PopupError(args=*<1 or N object>,
+ title=None,
+ button_color=(None, None),
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Display popup window with text entry field and browse button so that a file can be chosen by user.
+
+```
+PopupGetFile(message,
+ title=None,
+ default_path="",
+ default_extension="",
+ save_as=False,
+ multiple_files=False,
+ file_types=(('ALL Files', '*.*'),),
+ no_window=False,
+ size=(None, None),
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ icon=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None),
+ initial_folder=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | message | message displayed to user |
+| str | title | Window title |
+| str | default_path | path to display to user as starting point (filled into the input field) |
+| str | default_extension | If no extension entered by user, add this to filename (only used in saveas dialogs) |
+| bool | save_as | if True, the "save as" dialog is shown which will verify before overwriting |
+| bool | multiple_files | if True, then allows multiple files to be selected that are returned with ';' between each filename |
+| Tuple[Tuple[str,str]] | file_types | List of extensions to show using wildcards. All files (the default) = (("ALL Files", "*.*"),) |
+| bool | no_window | if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown |
+| Tuple[int, int] | size | (width, height) of the InputText Element |
+| Tuple[str, str] | button_color | Color of the button (text, background) |
+| str | background_color | background color of the entire window |
+| str | text_color | color of the text |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| str | initial_folder | location in filesystem to begin browsing |
+| Union[str, None] | **RETURN** | string representing the file(s) chosen, None if cancelled or window closed with X
+
+Display popup with text entry field and browse button so that a folder can be chosen.
+
+```
+PopupGetFolder(message,
+ title=None,
+ default_path="",
+ no_window=False,
+ size=(None, None),
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ icon=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None),
+ initial_folder=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | message | message displayed to user |
+| str | title | Window title |
+| str | default_path | path to display to user as starting point (filled into the input field) |
+| bool | no_window | if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown |
+| Tuple[int, int] | size | (width, height) of the InputText Element |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| str | initial_folder | location in filesystem to begin browsing |
+| Union[str, None] | **RETURN** | string representing the path chosen, None if cancelled or window closed with X
+
+Display Popup with text entry field. Returns the text entered or None if closed / cancelled
+
+```
+PopupGetText(message,
+ title=None,
+ default_text="",
+ password_char="",
+ size=(None, None),
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ icon=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | message | (str) message displayed to user |
+| str | title | (str) Window title |
+| str | default_text | (str) default value to put into input area |
+| str | password_char | (str) character to be shown instead of actually typed characters |
+| Tuple[int, int] | size | (width, height) of the InputText Element |
+| Tuple[str, str] | button_color | Color of the button (text, background) |
+| str | background_color | (str) background color of the entire window |
+| str | text_color | (str) color of the message text |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | (bool) If True no titlebar will be shown |
+| bool | grab_anywhere | (bool) If True can click and drag anywhere in the window to move the window |
+| bool | keep_on_top | (bool) If True the window will remain above all current windows |
+| Tuple[int, int] | location | (x,y) Location on screen to display the upper left corner of window |
+| Union[str, None] | **RETURN** | Text entered or None if window was closed or cancel button clicked
+
+Display a Popup without a titlebar. Enables grab anywhere so you can move it
+
+```
+PopupNoBorder(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ grab_anywhere=True,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Show a Popup but without any buttons
+
+```
+PopupNoButtons(args=*<1 or N object>,
+ title=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | If True then will immediately return from the function without waiting for the user's input. (Default = False) |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True, than can grab anywhere to move the window (Default = False) |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Display a Popup without a titlebar. Enables grab anywhere so you can move it
+
+```
+PopupNoFrame(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ grab_anywhere=True,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Display a Popup without a titlebar. Enables grab anywhere so you can move it
+
+```
+PopupNoTitlebar(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ grab_anywhere=True,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Show Popup window and immediately return (does not block)
+
+```
+PopupNoWait(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=True,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Show Popup window and immediately return (does not block)
+
+```
+PopupNonBlocking(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=True,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Display Popup with OK button only
+
+```
+PopupOK(args=*<1 or N object>,
+ title=None,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Display popup with OK and Cancel buttons
+
+```
+PopupOKCancel(args=*<1 or N object>,
+ title=None,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=...,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| Union["OK", "Cancel", None] | **RETURN** | clicked button
+
+Show Popup box that doesn't block and closes itself
+
+```
+PopupQuick(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=True,
+ auto_close_duration=2,
+ non_blocking=True,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Show Popup window with no titlebar, doesn't block, and auto closes itself.
+
+```
+PopupQuickMessage(args=*<1 or N object>,
+ title=None,
+ button_type=5,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=True,
+ auto_close_duration=2,
+ non_blocking=True,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=True,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Show a scrolled Popup window containing the user's text that was supplied. Use with as many items to print as you
+want, just like a print statement.
+
+```
+PopupScrolled(args=*<1 or N object>,
+ title=None,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ yes_no=False,
+ auto_close=False,
+ auto_close_duration=None,
+ size=(None, None),
+ location=(None, None),
+ non_blocking=False,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ font=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | yes_no | If True, displays Yes and No buttons instead of Ok |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| Tuple[int, int] | location | Location on the screen to place the upper left corner of the window |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[str, None, TIMEOUT_KEY] | **RETURN** | Returns text of the button that was pressed. None will be returned if user closed window with X
+
+Popup that closes itself after some time period
+
+```
+PopupTimed(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=True,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Display Popup with Yes and No buttons
+
+```
+PopupYesNo(args=*<1 or N object>,
+ title=None,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| Union["Yes", "No", None] | **RETURN** | clicked button
+
+## Popups PEP8 Versions
+
+Popup - Display a popup Window with as many parms as you wish to include. This is the GUI equivalent of the
+"print" statement. It's also great for "pausing" your program's flow until the user can read some error messages.
+
+```
+popup(args=*<1 or N object>,
+ title=None,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ button_type=0,
+ auto_close=False,
+ auto_close_duration=None,
+ custom_text=(None, None),
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of your arguments. Load up the call with stuff to see! |
+| str | title | Optional title for the window. If none provided, the first arg will be used instead. |
+| Tuple[str, str] | button_color | Color of the buttons shown (text color, button color) |
+| str | background_color | Window's background color |
+| str | text_color | text color |
+| enum | button_type | NOT USER SET! Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). There are many Popup functions and they call Popup, changing this parameter to get the desired effect. |
+| bool | auto_close | If True the window will automatically close |
+| int | auto_close_duration | time in seconds to keep window open before closing it automatically |
+| Union[Tuple[str, str], str] | custom_text | A string or pair of strings that contain the text to display on the buttons |
+| bool | non_blocking | If True then will immediately return from the function without waiting for the user's input. |
+| Union[str, bytes] | icon | icon to display on the window. Same format as a Window call |
+| int | line_width | Width of lines in characters. Defaults to MESSAGE_BOX_LINE_WIDTH |
+| Union[str, tuple(font name, size, modifiers] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True will not show the frame around the window and the titlebar across the top |
+| bool | grab_anywhere | If True can grab anywhere to move the window. If no_titlebar is True, grab_anywhere should likely be enabled too |
+| Tuple[int, int] | location | Location on screen to display the top left corner of window. Defaults to window centered on screen |
+| Union[str, None] | **RETURN** | Returns text of the button that was pressed. None will be returned if user closed window with X
+
+Show animation one frame at a time. This function has its own internal clocking meaning you can call it at any frequency
+ and the rate the frames of video is shown remains constant. Maybe your frames update every 30 ms but your
+ event loop is running every 10 ms. You don't have to worry about delaying, just call it every time through the
+ loop.
+
+```
+popup_animated(image_source,
+ message=None,
+ background_color=None,
+ text_color=None,
+ font=None,
+ no_titlebar=True,
+ grab_anywhere=True,
+ keep_on_top=True,
+ location=(None, None),
+ alpha_channel=None,
+ time_between_frames=0,
+ transparent_color=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[str, bytes] | image_source | Either a filename or a base64 string. |
+| str | message | An optional message to be shown with the animation |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| Union[str, tuple] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True then the titlebar and window frame will not be shown |
+| bool | grab_anywhere | If True then you can move the window just clicking anywhere on window, hold and drag |
+| bool | keep_on_top | If True then Window will remain on top of all other windows currently shownn |
+| (int, int) | location | (x,y) location on the screen to place the top left corner of your window. Default is to center on screen |
+| float | alpha_channel | Window transparency 0 = invisible 1 = completely visible. Values between are see through |
+| int | time_between_frames | Amount of time in milliseconds between each frame |
+| str | transparent_color | This color will be completely see-through in your window. Can even click through |
+
+Display a Popup without a titlebar. Enables grab anywhere so you can move it
+
+```
+popup_annoying(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ grab_anywhere=True,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Popup that closes itself after some time period
+
+```
+popup_auto_close(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=True,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Display Popup with "cancelled" button text
+
+```
+popup_cancel(args=*<1 or N object>,
+ title=None,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Popup with colored button and 'Error' as button text
+
+```
+popup_error(args=*<1 or N object>,
+ title=None,
+ button_color=(None, None),
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Display popup window with text entry field and browse button so that a file can be chosen by user.
+
+```
+popup_get_file(message,
+ title=None,
+ default_path="",
+ default_extension="",
+ save_as=False,
+ multiple_files=False,
+ file_types=(('ALL Files', '*.*'),),
+ no_window=False,
+ size=(None, None),
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ icon=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None),
+ initial_folder=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | message | message displayed to user |
+| str | title | Window title |
+| str | default_path | path to display to user as starting point (filled into the input field) |
+| str | default_extension | If no extension entered by user, add this to filename (only used in saveas dialogs) |
+| bool | save_as | if True, the "save as" dialog is shown which will verify before overwriting |
+| bool | multiple_files | if True, then allows multiple files to be selected that are returned with ';' between each filename |
+| Tuple[Tuple[str,str]] | file_types | List of extensions to show using wildcards. All files (the default) = (("ALL Files", "*.*"),) |
+| bool | no_window | if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown |
+| Tuple[int, int] | size | (width, height) of the InputText Element |
+| Tuple[str, str] | button_color | Color of the button (text, background) |
+| str | background_color | background color of the entire window |
+| str | text_color | color of the text |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| str | initial_folder | location in filesystem to begin browsing |
+| Union[str, None] | **RETURN** | string representing the file(s) chosen, None if cancelled or window closed with X
+
+Display popup with text entry field and browse button so that a folder can be chosen.
+
+```
+popup_get_folder(message,
+ title=None,
+ default_path="",
+ no_window=False,
+ size=(None, None),
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ icon=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None),
+ initial_folder=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | message | message displayed to user |
+| str | title | Window title |
+| str | default_path | path to display to user as starting point (filled into the input field) |
+| bool | no_window | if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown |
+| Tuple[int, int] | size | (width, height) of the InputText Element |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| str | initial_folder | location in filesystem to begin browsing |
+| Union[str, None] | **RETURN** | string representing the path chosen, None if cancelled or window closed with X
+
+Display Popup with text entry field. Returns the text entered or None if closed / cancelled
+
+```
+popup_get_text(message,
+ title=None,
+ default_text="",
+ password_char="",
+ size=(None, None),
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ icon=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | message | (str) message displayed to user |
+| str | title | (str) Window title |
+| str | default_text | (str) default value to put into input area |
+| str | password_char | (str) character to be shown instead of actually typed characters |
+| Tuple[int, int] | size | (width, height) of the InputText Element |
+| Tuple[str, str] | button_color | Color of the button (text, background) |
+| str | background_color | (str) background color of the entire window |
+| str | text_color | (str) color of the message text |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | (bool) If True no titlebar will be shown |
+| bool | grab_anywhere | (bool) If True can click and drag anywhere in the window to move the window |
+| bool | keep_on_top | (bool) If True the window will remain above all current windows |
+| Tuple[int, int] | location | (x,y) Location on screen to display the upper left corner of window |
+| Union[str, None] | **RETURN** | Text entered or None if window was closed or cancel button clicked
+
+Display a Popup without a titlebar. Enables grab anywhere so you can move it
+
+```
+popup_no_border(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ grab_anywhere=True,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Show a Popup but without any buttons
+
+```
+popup_no_buttons(args=*<1 or N object>,
+ title=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | If True then will immediately return from the function without waiting for the user's input. (Default = False) |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True, than can grab anywhere to move the window (Default = False) |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Display a Popup without a titlebar. Enables grab anywhere so you can move it
+
+```
+popup_no_frame(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ grab_anywhere=True,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Display a Popup without a titlebar. Enables grab anywhere so you can move it
+
+```
+popup_no_titlebar(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ grab_anywhere=True,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Show Popup window and immediately return (does not block)
+
+```
+popup_no_wait(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=True,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Show Popup window and immediately return (does not block)
+
+```
+popup_non_blocking(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=True,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Display Popup with OK button only
+
+```
+popup_ok(args=*<1 or N object>,
+ title=None,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Display popup with OK and Cancel buttons
+
+```
+popup_ok_cancel(args=*<1 or N object>,
+ title=None,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=...,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| Union["OK", "Cancel", None] | **RETURN** | clicked button
+
+Show Popup box that doesn't block and closes itself
+
+```
+popup_quick(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=True,
+ auto_close_duration=2,
+ non_blocking=True,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Show Popup window with no titlebar, doesn't block, and auto closes itself.
+
+```
+popup_quick_message(args=*<1 or N object>,
+ title=None,
+ button_type=5,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=True,
+ auto_close_duration=2,
+ non_blocking=True,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=True,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Show a scrolled Popup window containing the user's text that was supplied. Use with as many items to print as you
+want, just like a print statement.
+
+```
+popup_scrolled(args=*<1 or N object>,
+ title=None,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ yes_no=False,
+ auto_close=False,
+ auto_close_duration=None,
+ size=(None, None),
+ location=(None, None),
+ non_blocking=False,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ font=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | yes_no | If True, displays Yes and No buttons instead of Ok |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| Tuple[int, int] | location | Location on the screen to place the upper left corner of the window |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[str, None, TIMEOUT_KEY] | **RETURN** | Returns text of the button that was pressed. None will be returned if user closed window with X
+
+Popup that closes itself after some time period
+
+```
+popup_timed(args=*<1 or N object>,
+ title=None,
+ button_type=0,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=True,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| enum | button_type | Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+
+Display Popup with Yes and No buttons
+
+```
+popup_yes_no(args=*<1 or N object>,
+ title=None,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ auto_close=False,
+ auto_close_duration=None,
+ non_blocking=False,
+ icon=None,
+ line_width=None,
+ font=None,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ location=(None, None))
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| str | background_color | color of background |
+| str | text_color | color of the text |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| int | line_width | Width of lines in characters |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| bool | no_titlebar | If True no titlebar will be shown |
+| bool | grab_anywhere | If True: can grab anywhere to move the window (Default = False) |
+| bool | keep_on_top | If True the window will remain above all current windows |
+| Tuple[int, int] | location | Location of upper left corner of the window |
+| Union["Yes", "No", None] | **RETURN** | clicked button
+
+## PEP8 Function Bindings
+
+Fills a window with values provided in a values dictionary { element_key : new_value }
+
+```
+fill_form_with_values(window, values_dict)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Window | window | The window object to fill |
+| (Dict[Any:Any]) | values_dict | A dictionary with element keys as key and value is values parm for Update call |
+
+The PySimpleGUI "Test Harness". This is meant to be a super-quick test of the Elements.
+
+```
+main()
+```
+
+Dumps an Object's values as a formatted string. Very nicely done. Great way to display an object's member variables in human form
+
+```
+obj_to_string(obj, extra=" ")
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | obj | The object to display |
+| str | extra | (Default value = ' ') |
+| (str) | **RETURN** | Formatted output of the object's values
+
+Dumps an Object's values as a formatted string. Very nicely done. Great way to display an object's member variables in human form
+Returns only the top-most object's variables instead of drilling down to dispolay more
+
+```
+obj_to_string_single_obj(obj)
+```
+
+Sets the icon which will be used any time a window is created if an icon is not provided when the
+window is created.
+
+```
+set_global_icon(icon)
+```
+
+```
+set_options(icon=None,
+ button_color=None,
+ element_size=(None, None),
+ button_element_size=(None, None),
+ margins=(None, None),
+ element_padding=(None, None),
+ auto_size_text=None,
+ auto_size_buttons=None,
+ font=None,
+ border_width=None,
+ slider_border_width=None,
+ slider_relief=None,
+ slider_orientation=None,
+ autoclose_time=None,
+ message_box_line_width=None,
+ progress_meter_border_depth=None,
+ progress_meter_style=None,
+ progress_meter_relief=None,
+ progress_meter_color=None,
+ progress_meter_size=None,
+ text_justification=None,
+ background_color=None,
+ element_background_color=None,
+ text_element_background_color=None,
+ input_elements_background_color=None,
+ input_text_color=None,
+ scrollbar_color=None,
+ text_color=None,
+ element_text_color=None,
+ debug_win_size=(None, None),
+ window_location=(None, None),
+ error_button_color=(None, None),
+ tooltip_time=None,
+ use_ttk_buttons=None,
+ ttk_theme=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Union[bytes, str] | icon | filename or base64 string to be used for the window's icon |
+| Tuple[str, str] | button_color | Color of the button (text, background) |
+| Tuple[int, int] | element_size | element size (width, height) in characters |
+| Tuple[int, int] | button_element_size | Size of button |
+| Tuple[int, int] | margins | (left/right, top/bottom) tkinter margins around outsize. Amount of pixels to leave inside the window's frame around the edges before your elements are shown. |
+| Tuple[int, int] or ((int, int),(int,int)) | element_padding | Default amount of padding to put around elements in window (left/right, top/bottom) or ((left, right), (top, bottom)) |
+| bool | auto_size_text | True if the Widget should be shrunk to exactly fit the number of chars to show |
+| bool | auto_size_buttons | True if Buttons in this Window should be sized to exactly fit the text on this. |
+| Union[str, Tuple[str, int]] | font | specifies the font family, size, etc |
+| int | border_width | width of border around element |
+| ??? | slider_border_width | ??? |
+| ??? | slider_relief | ??? |
+| ??? | slider_orientation | ??? |
+| ??? | autoclose_time | ??? |
+| ??? | message_box_line_width | ??? |
+| ??? | progress_meter_border_depth | ??? |
+| --- | progress_meter_style | You can no longer set a progress bar style. All ttk styles must be the same for the window |
+| str | progress_meter_relief | :param progress_meter_color: :param progress_meter_size: :param text_justification: Union ['left', 'right', 'center'] Default text justification for all Text Elements in window |
+| str | background_color | color of background |
+| str | element_background_color | element background color |
+| str | text_element_background_color | text element background color |
+| str | input_elements_background_color | :param input_text_color: :param scrollbar_color: :param text_color: color of the text |
+| ??? | element_text_color | ??? |
+| Tuple[int, int] | debug_win_size | (Default = (None)) |
+| ??? | window_location | (Default = (None)) |
+| ??? | error_button_color | (Default = (None)) |
+| int | tooltip_time | time in milliseconds to wait before showing a tooltip. Default is 400ms |
+| bool | use_ttk_buttons | if True will cause all buttons to be ttk buttons |
+| str | ttk_theme | (str) Theme to use with ttk widgets. Choices (on Windows) include - 'default', 'winnative', 'clam', 'alt', 'classic', 'vista', 'xpnative' |
+
+Shows the smaller "popout" window. Default location is the upper right corner of your screen
+
+```
+show_debugger_popout_window(location=(None, None), args=*<1 or N object>)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Tuple[int, int] | location | Locations (x,y) on the screen to place upper left corner of the window |
+
+Shows the large main debugger window
+
+```
+show_debugger_window(location=(None, None), args=*<1 or N object>)
+```
+
+Show a scrolled Popup window containing the user's text that was supplied. Use with as many items to print as you
+want, just like a print statement.
+
+```
+sprint(args=*<1 or N object>,
+ title=None,
+ button_color=None,
+ background_color=None,
+ text_color=None,
+ yes_no=False,
+ auto_close=False,
+ auto_close_duration=None,
+ size=(None, None),
+ location=(None, None),
+ non_blocking=False,
+ no_titlebar=False,
+ grab_anywhere=False,
+ keep_on_top=False,
+ font=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| Any | *args | Variable number of items to display |
+| str | title | Title to display in the window. |
+| Tuple[str, str] | button_color | button color (foreground, background) |
+| bool | yes_no | If True, displays Yes and No buttons instead of Ok |
+| bool | auto_close | if True window will close itself |
+| Union[int, float] | auto_close_duration | Older versions only accept int. Time in seconds until window will close |
+| Tuple[int, int] | size | (w,h) w=characters-wide, h=rows-high |
+| Tuple[int, int] | location | Location on the screen to place the upper left corner of the window |
+| bool | non_blocking | if True the call will immediately return rather than waiting on user input |
+| Union[str, None, TIMEOUT_KEY] | **RETURN** | Returns text of the button that was pressed. None will be returned if user closed window with X
+
+The PySimpleGUI "Test Harness". This is meant to be a super-quick test of the Elements.
+
+```
+test()
+```
+
+## Themes
+
+Sets / Gets the current Theme. If none is specified then returns the current theme.
+This call replaces the ChangeLookAndFeel / change_look_and_feel call which only sets the theme.
+
+```
+theme(new_theme=None)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | new_theme | (str) the new theme name to use |
+
+Sets/Returns the background color currently in use
+Used for Windows and containers (Column, Frame, Tab) and tables
+
+```
+theme_background_color(color=None) -> (str) - color string of the background color currently in use
+```
+
+Sets/Returns the border width currently in use
+Used by non ttk elements at the moment
+
+```
+theme_border_width(border_width=None) -> (int) - border width currently in use
+```
+
+Sets/Returns the button color currently in use
+
+```
+theme_button_color(color=None) -> Tuple[str, str] - TUPLE with color strings of the button color currently in use (button text color, button background color)
+```
+
+Sets/Returns the background color currently in use for all elements except containers
+
+```
+theme_element_background_color(color=None) -> (str) - color string of the element background color currently in use
+```
+
+Sets/Returns the text color used by elements that have text as part of their display (Tables, Trees and Sliders)
+
+```
+theme_element_text_color(color=None) -> (str) - color string currently in use
+```
+
+Sets/Returns the input element background color currently in use
+
+```
+theme_input_background_color(color=None) -> (str) - color string of the input element background color currently in use
+```
+
+Sets/Returns the input element entry color (not the text but the thing that's displaying the text)
+
+```
+theme_input_text_color(color=None) -> (str) - color string of the input element color currently in use
+```
+
+Returns a sorted list of the currently available color themes
+
+```
+theme_list() -> List[str] - A sorted list of the currently available color themes
+```
+
+Show a window with all of the color themes - takes a while so be patient
+
+```
+theme_previewer(columns=12)
+```
+
+Sets/Returns the progress meter border width currently in use
+
+```
+theme_progress_bar_border_width(border_width=None) -> (int) - border width currently in use
+```
+
+Sets/Returns the progress bar colors by the current color theme
+
+```
+theme_progress_bar_color(color=None) -> Tuple[str, str] - TUPLE with color strings of the ProgressBar color currently in use(button text color, button background color)
+```
+
+Sets/Returns the slider border width currently in use
+
+```
+theme_slider_border_width(border_width=None) -> (int) - border width currently in use
+```
+
+Sets/Returns the slider color (used for sliders)
+
+```
+theme_slider_color(color=None) -> (str) - color string of the slider color currently in use
+```
+
+Sets/Returns the text color currently in use
+
+```
+theme_text_color(color=None) -> (str) - color string of the text color currently in use
+```
+
+Sets/Returns the background color for text elements
+
+```
+theme_text_element_background_color(color=None) -> (str) - color string of the text background color currently in use
+```
+
+## Old Themes (Look and Feel) - Replaced by theme()
+
+Change the "color scheme" of all future PySimpleGUI Windows.
+The scheme are string names that specify a group of colors. Background colors, text colors, button colors.
+There are 13 different color settings that are changed at one time using a single call to ChangeLookAndFeel
+The look and feel table itself has these indexes into the dictionary LOOK_AND_FEEL_TABLE.
+The original list was (prior to a major rework and renaming)... these names still work...
+In Nov 2019 a new Theme Formula was devised to make choosing a theme easier:
+The "Formula" is:
+["Dark" or "Light"] Color Number
+Colors can be Blue Brown Grey Green Purple Red Teal Yellow Black
+The number will vary for each pair. There are more DarkGrey entries than there are LightYellow for example.
+Default = The default settings (only button color is different than system default)
+Default1 = The full system default including the button (everything's gray... how sad... don't be all gray... please....)
+
+```
+ChangeLookAndFeel(index, force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | index | the name of the index into the Look and Feel table (does not have to be exact, can be "fuzzy") |
+| bool | force | no longer used |
+
+Get a list of the valid values to pass into your call to change_look_and_feel
+
+```
+ListOfLookAndFeelValues() -> List[str] - list of valid string values
+```
+
+Displays a "Quick Reference Window" showing all of the different Look and Feel settings that are available.
+They are sorted alphabetically. The legacy color names are mixed in, but otherwise they are sorted into Dark and Light halves
+
+```
+preview_all_look_and_feel_themes(columns=12)
+```
+
+Get a list of the valid values to pass into your call to change_look_and_feel
+
+```
+list_of_look_and_feel_values() -> List[str] - list of valid string values
+```
+
+Change the "color scheme" of all future PySimpleGUI Windows.
+The scheme are string names that specify a group of colors. Background colors, text colors, button colors.
+There are 13 different color settings that are changed at one time using a single call to ChangeLookAndFeel
+The look and feel table itself has these indexes into the dictionary LOOK_AND_FEEL_TABLE.
+The original list was (prior to a major rework and renaming)... these names still work...
+In Nov 2019 a new Theme Formula was devised to make choosing a theme easier:
+The "Formula" is:
+["Dark" or "Light"] Color Number
+Colors can be Blue Brown Grey Green Purple Red Teal Yellow Black
+The number will vary for each pair. There are more DarkGrey entries than there are LightYellow for example.
+Default = The default settings (only button color is different than system default)
+Default1 = The full system default including the button (everything's gray... how sad... don't be all gray... please....)
+
+```
+change_look_and_feel(index, force=False)
+```
+
+Parameter Descriptions:
+
+|Type|Name|Meaning|
+|--|--|--|
+| str | index | the name of the index into the Look and Feel table (does not have to be exact, can be "fuzzy") |
+| bool | force | no longer used |
\ No newline at end of file
diff --git a/readme_creator/PySimpleGUIlib.py b/readme_creator/PySimpleGUIlib.py
index 0e273781..a7cb340f 100644
--- a/readme_creator/PySimpleGUIlib.py
+++ b/readme_creator/PySimpleGUIlib.py
@@ -1,6 +1,6 @@
#!/usr/bin/python3
-version = __version__ = "4.13.1.3 Unreleased - Element.set_cursor, NEW theme(), Combo.update allows any value, table & tree header font defaults to window font, default theme now Dark Blue 3, Macs no longer default to colorless windows and buttons"
+version = __version__ = "4.16.15 Unreleased\n update_animation_no_buffering, popup_notify, removed TRANSPARENT_BUTTON, TabGroup now autonumbers keys, Table col width better size based on font, Table measure row height, Upgrade from GitHub utility (experimental), Multiline.print, fix padding lost with visibility, new upgrade utility, upgrade parameter, switched to urllib, more docstrings"
port = 'PySimpleGUI'
@@ -124,6 +124,11 @@ import inspect
from random import randint
import warnings
from math import floor
+from math import fabs
+from functools import wraps
+from subprocess import run, PIPE
+from threading import Thread
+import os
warnings.simplefilter('always', UserWarning)
@@ -150,6 +155,56 @@ def TimerStop():
print((g_time_delta * 1000))
+
+def _timeit(func):
+ """
+ Put @_timeit as a decorator to a function to get the time spent in that function printed out
+
+ :param func: Decorated function
+ :return: Execution time for the decorated function
+ """
+
+ @wraps(func)
+ def wrapper(*args, **kwargs):
+ start = time.time()
+ result = func(*args, **kwargs)
+ end = time.time()
+ print('{} executed in {:.4f} seconds'.format( func.__name__, end - start))
+ return result
+
+ return wrapper
+
+_timeit_counter = 0
+MAX_TIMEIT_COUNT = 1000
+_timeit_total = 0
+
+def _timeit_summary(func):
+ """
+ Same as the timeit decorator except that the value is shown as an averave
+ Put @_timeit_summary as a decorator to a function to get the time spent in that function printed out
+
+ :param func: Decorated function
+ :return: Execution time for the decorated function
+ """
+
+ @wraps(func)
+ def wrapper(*args, **kwargs):
+ global _timeit_counter, _timeit_total
+
+ start = time.time()
+ result = func(*args, **kwargs)
+ end = time.time()
+ _timeit_counter += 1
+ _timeit_total += end - start
+ if _timeit_counter > MAX_TIMEIT_COUNT:
+ print('{} executed in {:.4f} seconds'.format( func.__name__, _timeit_total/MAX_TIMEIT_COUNT))
+ _timeit_counter = 0
+ _timeit_total = 0
+ return result
+
+ return wrapper
+
+
"""
Welcome to the "core" PySimpleGUI code....
@@ -241,7 +296,7 @@ DEFAULT_SCROLLBAR_COLOR = None
# DEFAULT_PROGRESS_BAR_COLOR = (PURPLES[1],PURPLES[0]) # a nice purple progress bar
# A transparent button is simply one that matches the background
-TRANSPARENT_BUTTON = 'This constant has been depricated. You must set your button background = background it is on for it to be transparent appearing'
+# TRANSPARENT_BUTTON = 'This constant has been depricated. You must set your button background = background it is on for it to be transparent appearing'
# --------------------------------------------------------------------------------
# Progress Bar Relief Choices
RELIEF_RAISED = 'raised'
@@ -336,11 +391,18 @@ ENABLE_TK_WINDOWS = False
def RGB(red, green, blue):
"""
Given integer values of Red, Green, Blue, return a color string "#RRGGBB"
- :param red: (int) Red portion from 0 to 255
- :param green: (int) Green portion from 0 to 255
- :param blue: (int) Blue portion from 0 to 255
- :return: (str) A single RGB String in the format "#RRGGBB" where each pair is a hex number.
+ :param red: Red portion from 0 to 255
+ :type red: (int)
+ :param green: Green portion from 0 to 255
+ :type green: (int)
+ :param blue: Blue portion from 0 to 255
+ :type blue: (int)
+ :return: A single RGB String in the format "#RRGGBB" where each pair is a hex number.
+ :rtype: (str)
"""
+ red = min(int(red),255) if red > 0 else 0
+ blue = min(int(blue),255) if blue > 0 else 0
+ green = min(int(green),255) if green > 0 else 0
return '#%02x%02x%02x' % (red, green, blue)
@@ -420,11 +482,12 @@ class ToolTip:
def __init__(self, widget, text, timeout=DEFAULT_TOOLTIP_TIME):
"""
-
- :param widget: (widget type varies) The tkinter widget
- :param text: (str) text for the tooltip. It can inslude \n
- :param timeout: (int) Time in milliseconds that mouse must remain still before tip is shown
-
+ :param widget: The tkinter widget
+ :type widget: widget type varies
+ :param text: text for the tooltip. It can inslude \n
+ :type text: str
+ :param timeout: Time in milliseconds that mouse must remain still before tip is shown
+ :type timeout: int
"""
self.widget = widget
self.text = text
@@ -518,17 +581,28 @@ class Element():
"""
Element base class. Only used internally. User will not create an Element object by itself
- :param type: (int) (could be enum) The type of element. These constants all start with "ELEM_TYPE_"
- :param size: Tuple[int, int] (width ,height ) w=characters-wide, h=rows-high
- :param auto_size_text: (bool) True if the Widget should be shrunk to exactly fit the number of chars to show
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc (see docs for exact formats)
- :param background_color: (str) color of background. Can be in #RRGGBB format or a color name "black"
- :param text_color: (str) element's text color. Can be in #RRGGBB format or a color name "black"
- :param key: (Any) Identifies an Element. Should be UNIQUE to this window.
- :param pad: (int, int) or ((int,int),(int,int)) Amount of padding to put around element in pixels (left/right, top/bottom)
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param visible: (bool) set visibility state of the element (Default = True)
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param type: The type of element. These constants all start with "ELEM_TYPE_"
+ :type type: (int) (could be enum)
+ :param size: w=characters-wide, h=rows-high
+ :type size: Tuple[int, int] (width, height)
+ :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
+ :param font: specifies the font family, size, etc (see docs for exact formats)
+ :type font: Union[str, Tuple[str, int]]
+ :param background_color: color of background. Can be in #RRGGBB format or a color name "black"
+ :type background_color: (str)
+ :param text_color: element's text color. Can be in #RRGGBB format or a color name "black"
+ :type text_color: (str)
+ :param key: Identifies an Element. Should be UNIQUE to this window.
+ :type key: (Any)
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param visible: set visibility state of the element (Default = True)
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.Size = size
self.Type = type
@@ -559,6 +633,9 @@ class Element():
self.metadata = metadata # type: Any
self.user_bind_dict = {} # Used when user defines a tkinter binding using bind method - convert bind string to key modifier
self.user_bind_event = None # Used when user defines a tkinter binding using bind method - event data from tkinter
+ self.pad_used = (0,0) # the amount of pad used when was inserted into the layout
+
+
def _RightClickMenuCallback(self, event):
"""
@@ -574,7 +651,8 @@ class Element():
"""
Callback function called when user chooses a menu item from menubar, Button Menu or right click menu
- :param item_chosen: (str) String holding the value chosen.
+ :param item_chosen: String holding the value chosen.
+ :type item_chosen: str
"""
# print('IN MENU ITEM CALLBACK', item_chosen)
@@ -591,6 +669,7 @@ class Element():
:param form: the Window object to search
:return: Union[Button, None] Button Object if a button is found, else None if no button found
+ :rtype: Button Object if a button is found, else None if no button found
"""
for row in form.Rows:
for element in row:
@@ -776,6 +855,17 @@ class Element():
self.Widget.bind(bind_string, lambda evt: self._user_bind_callback(bind_string, evt))
self.user_bind_dict[bind_string] = key_modifier
+
+ def unbind(self, bind_string):
+ """
+ Removes a previously bound tkinter event from an Element.
+ :param bind_string: The string tkinter expected in its bind function
+ """
+ self.Widget.unbind(bind_string)
+ self.user_bind_dict.pop(bind_string, None)
+
+
+
def ButtonReboundCallback(self, event):
"""
*** DEPRICATED ***
@@ -793,7 +883,8 @@ class Element():
"""
Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
- :param tooltip_text: (str) the text to show in tooltip.
+ :param tooltip_text: the text to show in tooltip.
+ :type tooltip_text: str
"""
self.TooltipObject = ToolTip(self.Widget, text=tooltip_text, timeout=DEFAULT_TOOLTIP_TIME)
@@ -801,7 +892,8 @@ class Element():
"""
Sets the current focus to be on this element
- :param force: (bool) if True will call focus_force otherwise calls focus_set
+ :param force: if True will call focus_force otherwise calls focus_set
+ :type force: bool
"""
try:
@@ -817,7 +909,8 @@ class Element():
Changes the size of an element to a specific size.
It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.
- :param size: Tuple[int, int] The size in characters, rows typically. In some cases they are pixels
+ :param size: The size in characters, rows typically. In some cases they are pixels
+ :type size: Tuple[int, int]
"""
try:
if size[0] != None:
@@ -828,12 +921,16 @@ class Element():
if size[1] != None:
self.Widget.config(height=size[1])
except:
- print('Warning, error setting height on element with key=', self.Key)
+ try:
+ self.Widget.config(length=size[1])
+ except:
+ print('Warning, error setting height on element with key=', self.Key)
def get_size(self):
"""
Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.
- :return: Tuple[int, int] - Width, Height of the element
+ :return: width and height of the element
+ :rtype: Tuple[int, int]
"""
try:
w = self.Widget.winfo_width()
@@ -904,10 +1001,6 @@ class Element():
sg.Text('foo', key='T')
Then you can call the Update method for that element by writing:
window.FindElement('T')('new text value')
-
- :param args:
- :param kwargs:
- :return:
"""
return self.Update(*args, **kwargs)
@@ -930,26 +1023,44 @@ class InputText(Element):
change_submits=False, enable_events=False, do_not_clear=True, key=None, focus=False, pad=None,
use_readonly_for_disable=True, right_click_menu=None, visible=True, metadata=None):
"""
-
- :param default_text: (str) Text initially shown in the input box as a default value(Default value = '')
- :param size: Tuple[int, int] (width, height) w=characters-wide, h=rows-high
- :param disabled: (bool) set disable state for element (Default = False)
- :param password_char: (char) Password character if this is a password field (Default value = '')
- :param justification: (str) justification for data display. Valid choices - left, right, center
- :param background_color: (str) color of background in one of the color formats
- :param text_color: (str) color of the text
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param change_submits: (bool) * DEPRICATED DO NOT USE! Same as enable_events
- :param enable_events: (bool) If True then changes to this element are immediately reported as an event. Use this instead of change_submits (Default = False)
- :param do_not_clear: (bool) If False then the field will be set to blank after ANY event (button, any event) (Default = True)
- :param key: (any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
- :param focus: (bool) Determines if initial focus should go to this element.
- :param pad: (int, int) or ((int, int), (int, int)) Tuple(s). Amount of padding to put around element. Normally (horizontal pixels, vertical pixels) but can be split apart further into ((horizontal left, horizontal right), (vertical above, vertical below))
- :param use_readonly_for_disable: (bool) If True (the default) tkinter state set to 'readonly'. Otherwise state set to 'disabled'
- :param right_click_menu: List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
- :param visible: (bool) set visibility state of the element (Default = True)
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param default_text: Text initially shown in the input box as a default value(Default value = '')
+ :type default_text: (str)
+ :param size: w=characters-wide, h=rows-high
+ :type size: Tuple[int, int] (width, height)
+ :param disabled: set disable state for element (Default = False)
+ :type disabled: (bool)
+ :param password_char: Password character if this is a password field (Default value = '')
+ :type password_char: (char)
+ :param justification: justification for data display. Valid choices - left, right, center
+ :type justification: (str)
+ :param background_color: color of background in one of the color formats
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param change_submits: * DEPRICATED DO NOT USE! Same as enable_events
+ :type change_submits: (bool)
+ :param enable_events: If True then changes to this element are immediately reported as an event. Use this instead of change_submits (Default = False)
+ :type enable_events: (bool)
+ :param do_not_clear: If False then the field will be set to blank after ANY event (button, any event) (Default = True)
+ :type do_not_clear: (bool)
+ :param key: Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
+ :type key: (any)
+ :param focus: Determines if initial focus should go to this element.
+ :type focus: (bool)
+ :param pad: . Amount of padding to put around element. Normally (horizontal pixels, vertical pixels) but can be split apart further into ((horizontal left, horizontal right), (vertical above, vertical below))
+ :type pad: (int, int) or ((int, int), (int, int)) Tuple(s)
+ :param use_readonly_for_disable: If True (the default) tkinter state set to 'readonly'. Otherwise state set to 'disabled'
+ :type use_readonly_for_disable: (bool)
+ :param right_click_menu: A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
+ :type right_click_menu: List[List[Union[List[str],str]]]
+ :param visible: set visibility state of the element (Default = True)
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.DefaultText = default_text
self.PasswordCharacter = password_char
@@ -970,13 +1081,20 @@ class InputText(Element):
"""
Changes some of the settings for the Input Element. Must call `Window.Read` or `Window.Finalize` prior
- :param value: (str) new text to display as default text in Input field
- :param disabled: (bool) disable or enable state of the element (sets Entry Widget to readonly or normal)
- :param select: (bool) if True, then the text will be selected
- :param visible: (bool) change visibility of element
- :param text_color: (str) change color of text being typed
- :param background_color: (str) change color of the background
- :param move_cursor_to: Union[int, str] Moves the cursor to a particular offset. Defaults to 'end'
+ :param value: new text to display as default text in Input field
+ :type value: (str)
+ :param disabled: disable or enable state of the element (sets Entry Widget to readonly or normal)
+ :type disabled: (bool)
+ :param select: if True, then the text will be selected
+ :type select: (bool)
+ :param visible: change visibility of element
+ :type visible: (bool)
+ :param text_color: change color of text being typed
+ :type text_color: (str)
+ :param background_color: change color of the background
+ :type background_color: (str)
+ :param move_cursor_to: Moves the cursor to a particular offset. Defaults to 'end'
+ :type move_cursor_to: Union[int, str]
"""
if self.Widget is None:
warnings.warn('You cannot Update element with key = {} until the window has been Read or Finalized'.format(self.Key), UserWarning)
@@ -1004,13 +1122,14 @@ class InputText(Element):
if visible is False:
self.TKEntry.pack_forget()
elif visible is True:
- self.TKEntry.pack()
+ self.TKEntry.pack(padx=self.pad_used[0], pady=self.pad_used[1])
def Get(self):
"""
Read and return the current value of the input element. Must call `Window.Read` or `Window.Finalize` prior
- :return: (str) current value of Input field or '' if error encountered
+ :return: current value of Input field or '' if error encountered
+ :rtype: (str)
"""
try:
text = self.TKStringVar.get()
@@ -1042,22 +1161,38 @@ class Combo(Element):
text_color=None, change_submits=False, enable_events=False, disabled=False, key=None, pad=None,
tooltip=None, readonly=False, font=None, visible=True, metadata=None):
"""
- :param values: List[Any] values to choose. While displayed as text, the items returned are what the caller supplied, not text
- :param default_value: (Any) Choice to be displayed as initial value. Must match one of values variable contents
- :param size: Tuple[int, int] (width, height) width = characters-wide, height = rows-high
- :param auto_size_text: (bool) True if element should be the same size as the contents
- :param background_color: (str) color of background
- :param text_color: (str) color of the text
- :param change_submits: (bool) DEPRICATED DO NOT USE. Use `enable_events` instead
- :param enable_events: (bool) Turns on the element specific events. Combo event is when a choice is made
- :param disabled: (bool) set disable state for element
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param tooltip: (str) text that will appear when mouse hovers over this element
- :param readonly: (bool) make element readonly (user can't change). True means user cannot change
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param values: values to choose. While displayed as text, the items returned are what the caller supplied, not text
+ :type values: List[Any]
+ :param default_value: Choice to be displayed as initial value. Must match one of values variable contents
+ :type default_value: (Any)
+ :param size: width = characters-wide, height = rows-high
+ :type size: Tuple[int, int] (width, height)
+ :param auto_size_text: True if element should be the same size as the contents
+ :type auto_size_text: (bool)
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param change_submits: DEPRICATED DO NOT USE. Use `enable_events` instead
+ :type change_submits: (bool)
+ :param enable_events: Turns on the element specific events. Combo event is when a choice is made
+ :type enable_events: (bool)
+ :param disabled: set disable state for element
+ :type disabled: (bool)
+ :para key: Used with window.FindElement and with return values to uniquely identify this element
+ :type key: (Any)
+ :param: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :para tooltip: text that will appear when mouse hovers over this element
+ :type tooltip: (str)
+ :par readonly: make element readonly (user can't change). True means user cannot change
+ :type readonly: (bool)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.Values = values
self.DefaultValue = default_value
@@ -1074,14 +1209,20 @@ class Combo(Element):
def Update(self, value=None, values=None, set_to_index=None, disabled=None, readonly=None, font=None, visible=None):
"""
Changes some of the settings for the Combo Element. Must call `Window.Read` or `Window.Finalize` prior
-
- :param value: (Any) change which value is current selected hased on new list of previous list of choices
- :param values: List[Any] change list of choices
- :param set_to_index: (int) change selection to a particular choice starting with index = 0
- :param disabled: (bool) disable or enable state of the element
- :param readonly: (bool) if True make element readonly (user cannot change any choices)
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param visible: (bool) control visibility of element
+ :param value: change which value is current selected hased on new list of previous list of choices
+ :type value: (Any)
+ :param values: change list of choices
+ :type values: List[Any]
+ :param set_to_index: change selection to a particular choice starting with index = 0
+ :type set_to_index: (int)
+ :param disabled: disable or enable state of the element
+ :type disabled: (bool)
+ :param readonly: if True make element readonly (user cannot change any choices)
+ :type readonly: (bool)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self.Widget is None:
@@ -1127,14 +1268,15 @@ class Combo(Element):
if visible is False:
self.TKCombo.pack_forget()
elif visible is True:
- self.TKCombo.pack()
+ self.TKCombo.pack(padx=self.pad_used[0], pady=self.pad_used[1])
def Get(self):
"""
Returns the current (right now) value of the Combo. DO NOT USE THIS AS THE NORMAL WAY OF READING A COMBO!
You should be using values from your call to window.Read instead. Know what you're doing if you use it.
- :return: Union[Any, None] Returns the value of what is currently chosen
+ :return: Returns the value of what is currently chosen
+ :rtype: Union[Any, None]
"""
try:
if self.TKCombo.current() == -1: # if the current value was not in the original list
@@ -1172,18 +1314,29 @@ class OptionMenu(Element):
def __init__(self, values, default_value=None, size=(None, None), disabled=False, auto_size_text=None,
background_color=None, text_color=None, key=None, pad=None, tooltip=None, visible=True, metadata=None):
"""
- :param values: List[Any] Values to be displayed
- :param default_value: (Any) the value to choose by default
- :param size: Tuple[int, int] (width, height) size in characters (wide) and rows (high)
- :param disabled: (bool) control enabled / disabled
- :param auto_size_text: (bool) True if size of Element should match the contents of the items
- :param background_color: (str) color of background
- :param text_color: (str) color of the text
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :param values: Values to be displayed
+ :type values: List[Any]
+ :param default_value: the value to choose by default
+ :type default_value: (Any)
+ :param size: size in characters (wide) and rows (high)
+ :type size: Tuple[int, int] (width, height)
+ :param disabled: control enabled / disabled
+ :type disabled: (bool)
+ :param auto_size_text: True if size of Element should match the contents of the items
+ :type auto_size_text: (bool)
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param key: Used with window.FindElement and with return values to uniquely identify this element
+ :type key: (Any)
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
:param tooltip: (str) text that will appear when mouse hovers over this element
+ :type tooltip: (str)
:param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
"""
self.Values = values
self.DefaultValue = default_value
@@ -1198,11 +1351,14 @@ class OptionMenu(Element):
def Update(self, value=None, values=None, disabled=None, visible=None):
"""
Changes some of the settings for the OptionMenu Element. Must call `Window.Read` or `Window.Finalize` prior
-
- :param value: (Any) the value to choose by default
- :param values: List[Any] Values to be displayed
- :param disabled: (bool) disable or enable state of the element
- :param visible: (bool) control visibility of element
+ :param value: the value to choose by default
+ :type value: (Any)
+ :param values: Values to be displayed
+ :type values: List[Any]
+ :param disabled: disable or enable state of the element
+ :type disabled: (bool)
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self.Widget is None:
@@ -1233,7 +1389,7 @@ class OptionMenu(Element):
if visible is False:
self.TKOptionMenu.pack_forget()
elif visible is True:
- self.TKOptionMenu.pack()
+ self.TKOptionMenu.pack(padx=self.pad_used[0], pady=self.pad_used[1])
set_focus = Element.SetFocus
set_tooltip = Element.SetTooltip
@@ -1258,28 +1414,42 @@ class Listbox(Element):
background_color=None, text_color=None, key=None, pad=None, tooltip=None, right_click_menu=None,
visible=True, metadata=None):
"""
- :param values: List[Any] list of values to display. Can be any type including mixed types as long as they have __str__ method
- :param default_values: List[Any] which values should be initially selected
- :param select_mode: [enum] Select modes are used to determine if only 1 item can be selected or multiple and how they can be selected. Valid choices begin with "LISTBOX_SELECT_MODE_" and include:
- LISTBOX_SELECT_MODE_SINGLE
- LISTBOX_SELECT_MODE_MULTIPLE
- LISTBOX_SELECT_MODE_BROWSE
- LISTBOX_SELECT_MODE_EXTENDED
- :param change_submits: (bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead
- :param enable_events: (bool) Turns on the element specific events. Listbox generates events when an item is clicked
- :param bind_return_key: (bool) If True, then the return key will cause a the Listbox to generate an event
- :param size: Tuple(int, int) (width, height) width = characters-wide, height = rows-high
- :param disabled: (bool) set disable state for element
- :param auto_size_text: (bool) True if element should be the same size as the contents
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param background_color: (str) color of background
- :param text_color: (str) color of the text
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param right_click_menu: List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param values: list of values to display. Can be any type including mixed types as long as they have __str__ method
+ :type values: List[Any]
+ :param default_values: which values should be initially selected
+ :type default_values: List[Any]
+ :param select_mode: Select modes are used to determine if only 1 item can be selected or multiple and how they can be selected. Valid choices begin with "LISTBOX_SELECT_MODE_" and include: LISTBOX_SELECT_MODE_SINGLE LISTBOX_SELECT_MODE_MULTIPLE LISTBOX_SELECT_MODE_BROWSE LISTBOX_SELECT_MODE_EXTENDED
+ :type select_mode: [enum]
+ :param change_submits: DO NOT USE. Only listed for backwards compat - Use enable_events instead
+ :type change_submits: (bool)
+ :param enable_events: Turns on the element specific events. Listbox generates events when an item is clicked
+ :type enable_events: (bool)
+ :param bind_return_key: If True, then the return key will cause a the Listbox to generate an event
+ :type bind_return_key: (bool)
+ :param size: width = characters-wide, height = rows-high
+ :type size: Tuple(int, int) (width, height)
+ :param disabled: set disable state for element
+ :type disabled: (bool)
+ :param auto_size_text: True if element should be the same size as the contents
+ :type auto_size_text: (bool)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param key: Used with window.FindElement and with return values to uniquely identify this element
+ :type key: (Any)
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param right_click_menu: A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
+ :type right_click_menu: List[List[Union[List[str],str]]]
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.Values = values
self.DefaultValues = default_values
@@ -1306,15 +1476,21 @@ class Listbox(Element):
super().__init__(ELEM_TYPE_INPUT_LISTBOX, size=size, auto_size_text=auto_size_text, font=font,
background_color=bg, text_color=fg, key=key, pad=pad, tooltip=tooltip, visible=visible, metadata=metadata)
- def Update(self, values=None, disabled=None, set_to_index=None, scroll_to_index=None, visible=None):
+ def Update(self, values=None, disabled=None, set_to_index=None, scroll_to_index=None, select_mode=None, visible=None):
"""
Changes some of the settings for the Listbox Element. Must call `Window.Read` or `Window.Finalize` prior
-
- :param values: List[Any] new list of choices to be shown to user
- :param disabled: (bool) disable or enable state of the element
- :param set_to_index: Union[int, list, tuple] highlights the item(s) indicated. If parm is an int one entry will be set. If is a list, then each entry in list is highlighted
- :param scroll_to_index: (int) scroll the listbox so that this index is the first shown
- :param visible: (bool) control visibility of element
+ :param values: new list of choices to be shown to user
+ :type values: List[Any]
+ :param disabled: disable or enable state of the element
+ :type disabled: (bool)
+ :param set_to_index: highlights the item(s) indicated. If parm is an int one entry will be set. If is a list, then each entry in list is highlighted
+ :type set_to_index: Union[int, list, tuple]
+ :param scroll_to_index: scroll the listbox so that this index is the first shown
+ :type scroll_to_index: (int)
+ :param mode: changes the select mode according to tkinter's listbox widget
+ :type mode: (str)
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self.Widget is None:
@@ -1328,7 +1504,7 @@ class Listbox(Element):
self.TKListbox.delete(0, 'end')
for item in values:
self.TKListbox.insert(tk.END, item)
- self.TKListbox.selection_set(0, 0)
+ # self.TKListbox.selection_set(0, 0)
self.Values = values
if set_to_index is not None:
self.TKListbox.selection_clear(0, len(self.Values)) # clear all listbox selections
@@ -1348,17 +1524,23 @@ class Listbox(Element):
if not self.NoScrollbar:
self.vsb.pack_forget()
elif visible is True:
- self.TKListbox.pack()
+ self.TKListbox.pack(padx=self.pad_used[0], pady=self.pad_used[1])
if not self.NoScrollbar:
self.vsb.pack()
if scroll_to_index is not None and len(self.Values):
self.TKListbox.yview_moveto(scroll_to_index / len(self.Values))
+ if select_mode is not None:
+ try:
+ self.TKListbox.config(selectmode=select_mode)
+ except:
+ print('Listbox.update error trying to change mode to: ', select_mode)
def SetValue(self, values):
"""
Set listbox highlighted choices
- :param values: List[Any] new values to choose based on previously set values
+ :param values: new values to choose based on previously set values
+ :type values: List[Any]
"""
for index, item in enumerate(self.Values):
@@ -1376,7 +1558,8 @@ class Listbox(Element):
"""
Returns list of Values provided by the user in the user's format
- :return: List[Any]. List of values. Can be any / mixed types -> []
+ :return: List of values. Can be any / mixed types -> []
+ :rtype: List[Any]
"""
return self.Values
@@ -1384,10 +1567,29 @@ class Listbox(Element):
"""
Returns the items currently selected as a list of indexes
- :return: List[int] A list of offsets into values that is currently selected
+ :return: A list of offsets into values that is currently selected
+ :rtype: List[int]
"""
return self.TKListbox.curselection()
+
+ def get(self):
+ """
+ Returns the list of items currently selected in this listbox. It should be identical
+ to the value you would receive when performing a window.read() call.
+
+ :return: The list of currently selected items. The actual items are returned, not the indexes
+ :rtype: List[Any]
+ """
+ try:
+ items = self.TKListbox.curselection()
+ value = [self.Values[int(item)] for item in items]
+ except:
+ value = []
+ return value
+
+
+
get_indexes = GetIndexes
get_list_values = GetListValues
set_focus = Element.SetFocus
@@ -1413,23 +1615,38 @@ class Radio(Element):
background_color=None, text_color=None, font=None, key=None, pad=None, tooltip=None,
change_submits=False, enable_events=False, visible=True, metadata=None):
"""
-
- :param text: (str) Text to display next to button
- :param group_id: (Any) Groups together multiple Radio Buttons. Any type works
- :param default: (bool). Set to True for the one element of the group you want initially selected
- :param disabled: (bool) set disable state
- :param size: Tuple[int, int] (width, height) width = characters-wide, height = rows-high
- :param auto_size_text: (bool) if True will size the element to match the length of the text
- :param background_color: (str) color of background
- :param text_color: (str) color of the text
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param change_submits: (bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead
- :param enable_events: (bool) Turns on the element specific events. Radio Button events happen when an item is selected
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param text: Text to display next to button
+ :type text: (str)
+ :param group_id: Groups together multiple Radio Buttons. Any type works
+ :type group_id: (Any)
+ :param default: Set to True for the one element of the group you want initially selected
+ :type default: (bool)
+ :param disabled: set disable state
+ :type disabled: (bool)
+ :param size: int] (width, height) width = characters-wide, height = rows-high
+ :type size: Tuple[int,
+ :param auto_size_text: if True will size the element to match the length of the text
+ :type auto_size_text: (bool)
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param key: Used with window.FindElement and with return values to uniquely identify this element
+ :type key: (Any)
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param change_submits: DO NOT USE. Only listed for backwards compat - Use enable_events instead
+ :type change_submits: (bool)
+ :param enable_events: Turns on the element specific events. Radio Button events happen when an item is selected
+ :type enable_events: (bool)
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.InitialState = default
@@ -1438,7 +1655,19 @@ class Radio(Element):
self.GroupID = group_id
self.Value = None
self.Disabled = disabled
- self.TextColor = text_color or DEFAULT_TEXT_COLOR
+ self.TextColor = text_color if text_color else theme_text_color()
+ # ---- compute color of circle background ---
+ try: # something in here will fail if a color is not specified in Hex
+ text_hsl = _hex_to_hsl(self.TextColor)
+ background_hsl = _hex_to_hsl(background_color if background_color else theme_background_color())
+ l_delta = abs(text_hsl[2] - background_hsl[2])/10
+ if text_hsl[2] > background_hsl[2]: # if the text is "lighter" than the background then make background darker
+ bg_rbg = _hsl_to_rgb(background_hsl[0], background_hsl[1], background_hsl[2]-l_delta)
+ else:
+ bg_rbg = _hsl_to_rgb(background_hsl[0], background_hsl[1],background_hsl[2]+l_delta)
+ self.CircleBackgroundColor = RGB(*bg_rbg)
+ except:
+ self.CircleBackgroundColor = background_color if background_color else theme_background_color()
self.ChangeSubmits = change_submits or enable_events
self.EncodedRadioValue = None
super().__init__(ELEM_TYPE_INPUT_RADIO, size=size, auto_size_text=auto_size_text, font=font,
@@ -1448,10 +1677,12 @@ class Radio(Element):
def Update(self, value=None, disabled=None, visible=None):
"""
Changes some of the settings for the Radio Button Element. Must call `Window.Read` or `Window.Finalize` prior
-
- :param value: (bool) if True change to selected and set others in group to unselected
- :param disabled: (bool) disable or enable state of the element
- :param visible: (bool) control visibility of element
+ :param value: if True change to selected and set others in group to unselected
+ :type value: (bool)
+ :param disabled: disable or enable state of the element
+ :type disabled: (bool)
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self.Widget is None:
@@ -1471,7 +1702,7 @@ class Radio(Element):
if visible is False:
self.TKRadio.pack_forget()
elif visible is True:
- self.TKRadio.pack()
+ self.TKRadio.pack(padx=self.pad_used[0], pady=self.pad_used[1])
def ResetGroup(self):
"""
@@ -1484,7 +1715,8 @@ class Radio(Element):
"""
A snapshot of the value of Radio Button -> (bool)
- :return: (bool) True if this radio button is selected
+ :return: True if this radio button is selected
+ :rtype: (bool)
"""
return self.TKIntVar.get() == self.EncodedRadioValue
@@ -1511,21 +1743,36 @@ class Checkbox(Element):
text_color=None, change_submits=False, enable_events=False, disabled=False, key=None, pad=None,
tooltip=None, visible=True, metadata=None):
"""
- :param text: (str) Text to display next to checkbox
- :param default: (bool). Set to True if you want this checkbox initially checked
- :param size: Tuple[int, int] (width, height) width = characters-wide, height = rows-high
- :param auto_size_text: (bool) if True will size the element to match the length of the text
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param background_color: (str) color of background
- :param text_color: (str) color of the text
- :param change_submits: (bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead
- :param enable_events: (bool) Turns on the element specific events. Checkbox events happen when an item changes
- :param disabled: (bool) set disable state
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param text: Text to display next to checkbox
+ :type text: (str)
+ :param default: Set to True if you want this checkbox initially checked
+ :type default: (bool)
+ :param size: (width, height) width = characters-wide, height = rows-high
+ :type size: Tuple[int, int]
+ :param auto_size_text: if True will size the element to match the length of the text
+ :type auto_size_text: (bool)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param change_submits: DO NOT USE. Only listed for backwards compat - Use enable_events instead
+ :type change_submits: (bool)
+ :param enable_events: Turns on the element specific events. Checkbox events happen when an item changes
+ :type enable_events: (bool)
+ :param disabled: set disable state
+ :type disabled: (bool)
+ :param key: Used with window.FindElement and with return values to uniquely identify this element
+ :type key: (Any)
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.Text = text
@@ -1533,7 +1780,21 @@ class Checkbox(Element):
self.Value = None
self.TKCheckbutton = self.Widget = None # type: tk.Checkbutton
self.Disabled = disabled
- self.TextColor = text_color if text_color else DEFAULT_TEXT_COLOR
+ self.TextColor = text_color if text_color else theme_text_color()
+ # ---- compute color of circle background ---
+ try: # something in here will fail if a color is not specified in Hex
+ text_hsl = _hex_to_hsl(self.TextColor)
+ background_hsl = _hex_to_hsl(background_color if background_color else theme_background_color())
+ # print(f'backgroundHSL = {background_hsl}')
+ l_delta = abs(text_hsl[2] - background_hsl[2])/10
+ if text_hsl[2] > background_hsl[2]: # if the text is "lighter" than the background then make background darker
+ bg_rbg = _hsl_to_rgb(background_hsl[0], background_hsl[1], background_hsl[2]-l_delta)
+ else:
+ bg_rbg = _hsl_to_rgb(background_hsl[0], background_hsl[1],background_hsl[2]+l_delta)
+ self.CheckboxBackgroundColor = RGB(*bg_rbg)
+ except:
+ self.CheckboxBackgroundColor = background_color if background_color else theme_background_color()
+
self.ChangeSubmits = change_submits or enable_events
super().__init__(ELEM_TYPE_INPUT_CHECKBOX, size=size, auto_size_text=auto_size_text, font=font,
@@ -1545,18 +1806,25 @@ class Checkbox(Element):
"""
Return the current state of this checkbox
- :return: (bool) Current state of checkbox
+ :return: Current state of checkbox
+ :rtype: (bool)
"""
return self.TKIntVar.get()
- def Update(self, value=None, disabled=None, visible=None):
+ def Update(self, value=None, background_color=None, text_color=None, disabled=None, visible=None):
"""
Changes some of the settings for the Checkbox Element. Must call `Window.Read` or `Window.Finalize` prior.
Note that changing visibility may cause element to change locations when made visible after invisible
-
- :param value: (bool) if True checks the checkbox, False clears it
- :param disabled: (bool) disable or enable element
- :param visible: (bool) control visibility of element
+ :param value: if True checks the checkbox, False clears it
+ :type value: (bool)
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text. Note this also changes the color of the checkmark
+ :type text_color: (str)
+ :param disabled: disable or enable element
+ :type disabled: (bool)
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self.Widget is None:
@@ -1572,10 +1840,34 @@ class Checkbox(Element):
self.TKCheckbutton.configure(state='disabled')
elif disabled == False:
self.TKCheckbutton.configure(state='normal')
+ if background_color is not None:
+ self.TKCheckbutton.configure(background=background_color)
+ self.BackgroundColor = background_color
+ if text_color is not None:
+ self.TKCheckbutton.configure(fg=text_color)
+ self.TextColor = text_color
+ if self.TextColor is not None and self.BackgroundColor is not None and self.TextColor.startswith('#') and self.BackgroundColor.startswith('#'):
+ # ---- compute color of circle background ---
+ # try: # something in here will fail if a color is not specified in Hex
+ text_hsl = _hex_to_hsl(self.TextColor)
+ background_hsl = _hex_to_hsl(self.BackgroundColor if self.BackgroundColor else theme_background_color())
+ # print(f'backgroundHSL = {background_hsl}')
+ l_delta = abs(text_hsl[2] - background_hsl[2])/10
+ if text_hsl[2] > background_hsl[2]: # if the text is "lighter" than the background then make background darker
+ bg_rbg = _hsl_to_rgb(background_hsl[0], background_hsl[1], background_hsl[2]-l_delta)
+ else:
+ bg_rbg = _hsl_to_rgb(background_hsl[0], background_hsl[1],background_hsl[2]+l_delta)
+ self.CheckboxBackgroundColor = RGB(*bg_rbg)
+ # except Exception as e:
+ # self.CheckboxBackgroundColor = self.BackgroundColor if self.BackgroundColor else theme_background_color()
+ # print(f'Update exception {e}')
+ # print(f'Setting checkbox background = {self.CheckboxBackgroundColor}')
+ self.TKCheckbutton.configure(selectcolor=self.CheckboxBackgroundColor) # The background of the checkbox
+
if visible is False:
self.TKCheckbutton.pack_forget()
elif visible is True:
- self.TKCheckbutton.pack()
+ self.TKCheckbutton.pack(padx=self.pad_used[0], pady=self.pad_used[1])
get = Get
set_focus = Element.SetFocus
@@ -1602,22 +1894,36 @@ class Spin(Element):
size=(None, None), auto_size_text=None, font=None, background_color=None, text_color=None, key=None,
pad=None, tooltip=None, visible=True, metadata=None):
"""
-
- :param values: List[Any] List of valid values
- :param initial_value: (Any) Initial item to show in window. Choose from list of values supplied
- :param disabled: (bool) set disable state
- :param change_submits: (bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead
- :param enable_events: (bool) Turns on the element specific events. Spin events happen when an item changes
- :param size: Tuple[int, int] (width, height) width = characters-wide, height = rows-high
- :param auto_size_text: (bool) if True will size the element to match the length of the text
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param background_color: (str) color of background
- :param text_color: (str) color of the text
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param values: List of valid values
+ :type values: List[Any]
+ :param initial_value: Initial item to show in window. Choose from list of values supplied
+ :type initial_value: (Any)
+ :param disabled: set disable state
+ :type disabled: (bool)
+ :param change_submits: DO NOT USE. Only listed for backwards compat - Use enable_events instead
+ :type change_submits: (bool)
+ :param enable_events: Turns on the element specific events. Spin events happen when an item changes
+ :type enable_events: (bool)
+ :param size: (width, height) width = characters-wide, height = rows-high
+ :type size: Tuple[int, int]
+ :param auto_size_text: if True will size the element to match the length of the text
+ :type auto_size_text: (bool)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param key: Used with window.FindElement and with return values to uniquely identify this element
+ :type key: (Any)
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.Values = values
@@ -1635,11 +1941,14 @@ class Spin(Element):
def Update(self, value=None, values=None, disabled=None, visible=None):
"""
Changes some of the settings for the Spin Element. Must call `Window.Read` or `Window.Finalize` prior
-
- :param value: (Any) set the current value from list of choices
- :param values: List[Any] set available choices
- :param disabled: (bool) disable or enable state of the element
- :param visible: (bool) control visibility of element
+ :param value: set the current value from list of choices
+ :type value: (Any)
+ :param values: set available choices
+ :type values: List[Any]
+ :param disabled: disable or enable state of the element
+ :type disabled: (bool)
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self.Widget is None:
@@ -1665,7 +1974,7 @@ class Spin(Element):
if visible is False:
self.TKSpinBox.pack_forget()
elif visible is True:
- self.TKSpinBox.pack()
+ self.TKSpinBox.pack(padx=self.pad_used[0], pady=self.pad_used[1])
def _SpinChangedHandler(self, event):
"""
@@ -1688,7 +1997,8 @@ class Spin(Element):
This value will be the same as what was provided as list of choices. If list items are ints, then the
item returned will be an int (not a string)
- :return: (Any) The currently visible entry
+ :return: The currently visible entry
+ :rtype: (Any)
"""
return self.TKStringVar.get()
@@ -1713,27 +2023,46 @@ class Multiline(Element):
enable_events=False, do_not_clear=True, key=None, focus=False, font=None, pad=None, tooltip=None,
right_click_menu=None, visible=True, metadata=None):
"""
-
- :param default_text: (str) Initial text to show
- :param enter_submits: (bool) if True, the Window.Read call will return is enter key is pressed in this element
- :param disabled: (bool) set disable state
- :param autoscroll: (bool) If True the contents of the element will automatically scroll as more data added to the end
- :param border_width: (int) width of border around element in pixels
- :param size: Tuple[int, int] (width, height) width = characters-wide, height = rows-high
- :param auto_size_text: (bool) if True will size the element to match the length of the text
- :param background_color: (str) color of background
- :param text_color: (str) color of the text
- :param change_submits: (bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead
- :param enable_events: (bool) Turns on the element specific events. Spin events happen when an item changes
+ :param default_text: Initial text to show
+ :type default_text: (str)
+ :param enter_submits: if True, the Window.Read call will return is enter key is pressed in this element
+ :type enter_submits: (bool)
+ :param disabled: set disable state
+ :type disabled: (bool)
+ :param autoscroll: If True the contents of the element will automatically scroll as more data added to the end
+ :type autoscroll: (bool)
+ :param border_width: width of border around element in pixels
+ :type border_width: (int)
+ :param size: int] (width, height) width = characters-wide, height = rows-high
+ :type size: Tuple[int,
+ :param auto_size_text: if True will size the element to match the length of the text
+ :type auto_size_text: (bool)
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param chfange_submits: DO NOT USE. Only listed for backwards compat - Use enable_events instead
+ :type chfange_submits: (bool)
+ :param enable_events: Turns on the element specific events. Spin events happen when an item changes
+ :type enable_events: (bool)
:param do_not_clear: if False the element will be cleared any time the Window.Read call returns
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
- :param focus: (bool) if True initial focus will go to this element
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param right_click_menu: List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :type do_not_clear: bool
+ :param key: Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
+ :type key: (Any)
+ :param focus: if True initial focus will go to this element
+ :type focus: (bool)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param right_click_menu: A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
+ :type right_click_menu: List[List[Union[List[str],str]]]
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.DefaultText = default_text
@@ -1757,17 +2086,23 @@ class Multiline(Element):
background_color_for_value=None, visible=None, autoscroll=None):
"""
Changes some of the settings for the Multiline Element. Must call `Window.Read` or `Window.Finalize` prior
-
- :param value: (str) new text to display
- :param disabled: (bool) disable or enable state of the element
- :param append: (bool) if True then new value will be added onto the end of the current value. if False then contents will be replaced.
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param text_color: (str) color of the text
- :param background_color: (str) color of background
- :param visible: (bool) set visibility state of the element
- :param autoscroll: (bool) if True then contents of element are scrolled down when new text is added to the end
+ :param value: new text to display
+ :type value: (str)
+ :param disabled: disable or enable state of the element
+ :type disabled: (bool)
+ :param append: if True then new value will be added onto the end of the current value. if False then contents will be replaced.
+ :type append: (bool)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param background_color: color of background
+ :type background_color: (str)
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param autoscroll: if True then contents of element are scrolled down when new text is added to the end
+ :type autoscroll: (bool)
"""
- value = str(value)
if self.Widget is None:
warnings.warn('You cannot Update element with key = {} until the window has been Read or Finalized'.format(self.Key), UserWarning)
return
@@ -1780,6 +2115,7 @@ class Multiline(Element):
self.TKText.tag_configure(str(self.TagCounter), background=background_color_for_value)
if value is not None:
+ value = str(value)
if self.Disabled:
self.TKText.configure(state='normal')
try:
@@ -1796,9 +2132,9 @@ class Multiline(Element):
self.DefaultText = value
if self.Autoscroll:
self.TKText.see(tk.END)
- if disabled == True:
+ if disabled is True:
self.TKText.configure(state='disabled')
- elif disabled == False:
+ elif disabled is False:
self.TKText.configure(state='normal')
if background_color is not None:
self.TKText.configure(background=background_color)
@@ -1809,18 +2145,40 @@ class Multiline(Element):
if visible is False:
self.TKText.pack_forget()
elif visible is True:
- self.TKText.pack()
+ self.TKText.pack(padx=self.pad_used[0], pady=self.pad_used[1])
self.TagCounter += 1 # doesn't matter if the counter is bumped every call
def Get(self):
"""
Return current contents of the Multiline Element
- :return: (str) current contents of the Multiline Element (used as an input type of Multiline
+ :return: current contents of the Multiline Element (used as an input type of Multiline
+ :rtype: (str)
"""
return self.TKText.get(1.0, tk.END)
+
+
+ def print(self, *args, end=None, sep=None, text_color=None, background_color=None):
+ """
+ Print like Python normally prints except route the output to a multline element and also add colors if desired
+
+ :param args: The arguments to print
+ :type args: List[Any]
+ :param end: The end char to use just like print uses
+ :type end: (str)
+ :param sep: The separation character like print uses
+ :type sep: (str)
+ :param text_color: The color of the text
+ :type text_color: (str)
+ :param background_color: The background color of the line
+ :type background_color: (str)
+ """
+ _print_to_element(self, *args, end=end, sep=sep, text_color=text_color, background_color=background_color)
+
+
+
get = Get
set_focus = Element.SetFocus
set_tooltip = Element.SetTooltip
@@ -1843,23 +2201,40 @@ class Text(Element):
relief=None, font=None, text_color=None, background_color=None, border_width=None, justification=None, pad=None, key=None,
right_click_menu=None, tooltip=None, visible=True, metadata=None):
"""
- :param text: (str) The text to display. Can include /n to achieve multiple lines
- :param size: Tuple[int, int] (width, height) width = characters-wide, height = rows-high
- :param auto_size_text: (bool) if True size of the Text Element will be sized to fit the string provided in 'text' parm
- :param click_submits: (bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead
- :param enable_events: (bool) Turns on the element specific events. Text events happen when the text is clicked
- :param relief: (str/enum) relief style around the text. Values are same as progress meter relief values. Should be a constant that is defined at starting with "RELIEF_" - `RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID`
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param text_color: (str) color of the text
- :param background_color: (str) color of background
- :param border_width: (int) number of pixels for the border (if using a relief)
- :param justification: (str) how string should be aligned within space provided by size. Valid choices = `left`, `right`, `center`
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
- :param right_click_menu: List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param text: The text to display. Can include /n to achieve multiple lines
+ :type text: (str)
+ :param size: (width, height) width = characters-wide, height = rows-high
+ :type size: Tuple[int, int]
+ :param auto_size_text: if True size of the Text Element will be sized to fit the string provided in 'text' parm
+ :type auto_size_text: (bool)
+ :param click_submits: DO NOT USE. Only listed for backwards compat - Use enable_events instead
+ :type click_submits: (bool)
+ :param enable_events: Turns on the element specific events. Text events happen when the text is clicked
+ :type enable_events: (bool)
+ :param relief: relief style around the text. Values are same as progress meter relief values. Should be a constant that is defined at starting with "RELIEF_" - `RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID`
+ :type relief: (str/enum)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param background_color: color of background
+ :type background_color: (str)
+ :param border_width: number of pixels for the border (if using a relief)
+ :type border_width: (int)
+ :param justification: how string should be aligned within space provided by size. Valid choices = `left`, `right`, `center`
+ :type justification: (str)
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param key: Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
+ :type key: (Any)
+ :param right_click_menu: A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
+ :type right_click_menu: List[List[Union[List[str],str]]]
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.DisplayText = str(text)
@@ -1881,21 +2256,24 @@ class Text(Element):
def Update(self, value=None, background_color=None, text_color=None, font=None, visible=None):
"""
Changes some of the settings for the Text Element. Must call `Window.Read` or `Window.Finalize` prior
-
- :param value: (str) new text to show
- :param background_color: (str) color of background
- :param text_color: (str) color of the text
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param visible: (bool) set visibility state of the element
+ :param value: new text to show
+ :type value: (str)
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param visible: set visibility state of the element
+ :type visible: (bool)
"""
if self.Widget is None:
warnings.warn('You cannot Update element with key = {} until the window has been Read or Finalized'.format(self.Key), UserWarning)
return
if value is not None:
- self.DisplayText = value
- stringvar = self.TKStringVar
- stringvar.set(value)
+ self.DisplayText = str(value)
+ self.TKStringVar.set(str(value))
if background_color is not None:
self.TKText.configure(background=background_color)
if text_color is not None:
@@ -1905,7 +2283,7 @@ class Text(Element):
if visible is False:
self.TKText.pack_forget()
elif visible is True:
- self.TKText.pack()
+ self.TKText.pack(padx=self.pad_used[0], pady=self.pad_used[1])
set_focus = Element.SetFocus
set_tooltip = Element.SetTooltip
@@ -1930,22 +2308,36 @@ class StatusBar(Element):
relief=RELIEF_SUNKEN, font=None, text_color=None, background_color=None, justification=None, pad=None,
key=None, tooltip=None, visible=True, metadata=None):
"""
-
- :param text: (str) Text that is to be displayed in the widget
- :param size: Tuple[(int), (int)] (w,h) w=characters-wide, h=rows-high
- :param auto_size_text: (bool) True if size should fit the text length
- :param click_submits: (bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead
- :param enable_events: (bool) Turns on the element specific events. StatusBar events occur when the bar is clicked
- :param relief: (enum) relief style. Values are same as progress meter relief values. Can be a constant or a string: `RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID`
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param text_color: (str) color of the text
- :param background_color: (str) color of background
- :param justification: (str) how string should be aligned within space provided by size. Valid choices = `left`, `right`, `center`
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param text: Text that is to be displayed in the widget
+ :type text: (str)
+ :param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[(int), (int)]
+ :param auto_size_text: True if size should fit the text length
+ :type auto_size_text: (bool)
+ :param click_submits: DO NOT USE. Only listed for backwards compat - Use enable_events instead
+ :type click_submits: (bool)
+ :param enable_events: Turns on the element specific events. StatusBar events occur when the bar is clicked
+ :type enable_events: (bool)
+ :param relief: relief style. Values are same as progress meter relief values. Can be a constant or a string: `RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID`
+ :type relief: (enum)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param background_color: color of background
+ :type background_color: (str)
+ :param justification: how string should be aligned within space provided by size. Valid choices = `left`, `right`, `center`
+ :type justification: (str)
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param key: Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
+ :type key: (Any)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.DisplayText = text
@@ -1966,11 +2358,16 @@ class StatusBar(Element):
def Update(self, value=None, background_color=None, text_color=None, font=None, visible=None):
"""
Changes some of the settings for the Status Bar Element. Must call `Window.Read` or `Window.Finalize` prior
- :param value: (str) new text to show
- :param background_color: (str) color of background
- :param text_color: (str) color of the text
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param visible: (bool) set visibility state of the element
+ :param value: new text to show
+ :type value: (str)
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param visible: set visibility state of the element
+ :type visible: (bool)
"""
if self.Widget is None:
@@ -1989,7 +2386,7 @@ class StatusBar(Element):
if visible is False:
self.TKText.pack_forget()
elif visible is True:
- self.TKText.pack()
+ self.TKText.pack(padx=self.pad_used[0], pady=self.pad_used[1])
set_focus = Element.SetFocus
set_tooltip = Element.SetTooltip
@@ -2002,23 +2399,31 @@ class StatusBar(Element):
# ---------------------------------------------------------------------- #
class TKProgressBar():
- """ """
def __init__(self, root, max, length=400, width=DEFAULT_PROGRESS_BAR_SIZE[1], style=DEFAULT_TTK_THEME,
relief=DEFAULT_PROGRESS_BAR_RELIEF, border_width=DEFAULT_PROGRESS_BAR_BORDER_WIDTH,
orientation='horizontal', BarColor=(None, None), key=None):
"""
-
- :param root: Union[tk.Tk, tk.TopLevel] The root window bar is to be shown in
- :param max: (int) Maximum value the bar will be measuring
- :param length: (int) length in pixels of the bar
- :param width: (int) width in pixels of the bar
- :param style: (str) Progress bar style defined as one of these 'default', 'winnative', 'clam', 'alt', 'classic', 'vista', 'xpnative'
- :param relief: (str) relief style. Values are same as progress meter relief values. Can be a constant or a string: `RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID` (Default value = DEFAULT_PROGRESS_BAR_RELIEF)
- :param border_width: (int) The amount of pixels that go around the outside of the bar
- :param orientation: (str) 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical')
- :param BarColor: Tuple[str, str] The 2 colors that make up a progress bar. One is the background, the other is the bar
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
+ :param root: The root window bar is to be shown in
+ :type root: Union[tk.Tk, tk.TopLevel]
+ :param max: Maximum value the bar will be measuring
+ :type max: (int)
+ :param length: length in pixels of the bar
+ :type length: (int)
+ :param width: width in pixels of the bar
+ :type width: (int)
+ :param style: Progress bar style defined as one of these 'default', 'winnative', 'clam', 'alt', 'classic', 'vista', 'xpnative'
+ :type style: (str)
+ :param relief: relief style. Values are same as progress meter relief values. Can be a constant or a string: `RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID` (Default value = DEFAULT_PROGRESS_BAR_RELIEF)
+ :type relief: (str)
+ :param border_width: The amount of pixels that go around the outside of the bar
+ :type border_width: (int)
+ :param orientation: 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical')
+ :type orientation: (str)
+ :param BarColor: The 2 colors that make up a progress bar. One is the background, the other is the bar
+ :type BarColor: Tuple[str, str]
+ :param key: Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
+ :type key: (Any)
"""
self.Length = length
@@ -2028,7 +2433,7 @@ class TKProgressBar():
self.Count = None
self.PriorCount = 0
- if orientation[0].lower() == 'h':
+ if orientation.lower().startswith('h'):
s = ttk.Style()
s.theme_use(style)
if BarColor != COLOR_SYSTEM_DEFAULT:
@@ -2057,9 +2462,10 @@ class TKProgressBar():
def Update(self, count=None, max=None):
"""
Update the current value of the bar and/or update the maximum value the bar can reach
-
- :param count: (int) current value
- :param max: (int) the maximum value
+ :param count: current value
+ :type count: (int)
+ :param max: the maximum value
+ :type max: (int)
"""
if max is not None:
self.Max = max
@@ -2067,7 +2473,6 @@ class TKProgressBar():
self.TKProgressBarForReal.config(maximum=max)
except:
return False
- if count is not None and count > self.Max: return False
if count is not None:
try:
self.TKProgressBarForReal['value'] = count
@@ -2091,14 +2496,22 @@ class TKOutput(tk.Frame):
def __init__(self, parent, width, height, bd, background_color=None, text_color=None, font=None, pad=None):
"""
- :param parent: Union[tk.Tk, tk.Toplevel] The "Root" that the Widget will be in
- :param width: (int) Width in characters
- :param height: (int) height in rows
- :param bd: (int) Border Depth. How many pixels of border to show
- :param background_color: (str) color of background
- :param text_color: (str) color of the text
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :param parent: The "Root" that the Widget will be in
+ :type parent: Union[tk.Tk, tk.Toplevel]
+ :param width: Width in characters
+ :type width: (int)
+ :param height: height in rows
+ :type height: (int)
+ :param bd: Border Depth. How many pixels of border to show
+ :type bd: (int)
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
"""
self.frame = tk.Frame(parent)
tk.Frame.__init__(self, self.frame)
@@ -2124,7 +2537,8 @@ class TKOutput(tk.Frame):
"""
Called by Python (not tkinter?) when stdout or stderr wants to write
- :param txt: (str) text of output
+ :param txt: text of output
+ :type txt: (str)
"""
try:
self.output.insert(tk.END, str(txt))
@@ -2166,16 +2580,26 @@ class Output(Element):
def __init__(self, size=(None, None), background_color=None, text_color=None, pad=None, font=None, tooltip=None,
key=None, right_click_menu=None, visible=True, metadata=None):
"""
- :param size: Tuple[int, int] (w,h) w=characters-wide, h=rows-high
- :param background_color: (str) color of background
- :param text_color: (str) color of the text
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
- :param right_click_menu: List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param size: (width, height) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param key: Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
+ :type key: (Any)
+ :param right_click_menu: A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
+ :type right_click_menu: List[List[Union[List[str],str]]]
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self._TKOut = self.Widget = None # type: TKOutput
@@ -2188,7 +2612,6 @@ class Output(Element):
@property
def TKOut(self):
- """ """
if self._TKOut is None:
print('*** Did you forget to call Finalize()? Your code should look something like: ***')
print('*** form = sg.Window("My Form").Layout(layout).Finalize() ***')
@@ -2198,8 +2621,10 @@ class Output(Element):
"""
Changes some of the settings for the Output Element. Must call `Window.Read` or `Window.Finalize` prior
- :param value: (str) string that will replace current contents of the output area
- :param visible: (bool) control visibility of element
+ :param value: string that will replace current contents of the output area
+ :type value: (str)
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self.Widget is None:
warnings.warn('You cannot Update element with key = {} until the window has been Read or Finalized'.format(self.Key), UserWarning)
@@ -2210,12 +2635,13 @@ class Output(Element):
if visible is False:
self._TKOut.frame.pack_forget()
elif visible is True:
- self._TKOut.frame.pack()
+ self._TKOut.frame.pack(padx=self.pad_used[0], pady=self.pad_used[1])
def Get(self):
"""
Returns the current contents of the output. Similar to Get method other Elements
- :return: (str) the current value of the output
+ :return: the current value of the output
+ :rtype: (str)
"""
return self._TKOut.output.get(1.0, tk.END)
@@ -2223,8 +2649,10 @@ class Output(Element):
"""
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
- :param expand_x: (Bool) If True Element will expand in the Horizontal directions
- :param expand_y: (Bool) If True Element will expand in the Vertical directions
+ :param expand_x: If True Element will expand in the Horizontal directions
+ :type expand_x: (Bool)
+ :param expand_y: If True Element will expand in the Vertical directions
+ :type expand_y: (Bool)
"""
if expand_x and expand_y:
@@ -2240,6 +2668,13 @@ class Output(Element):
self._TKOut.frame.pack(expand=True, fill=fill)
self.ParentRowFrame.pack(expand=True, fill=fill)
+ def __del__(self):
+ """
+ Delete this element. Normally Elements do not have their delete method specified, but for this one
+ it's important that the underlying TKOut object get deleted so that the stdout will get restored properly
+ """
+ self._TKOut.__del__()
+
set_focus = Element.SetFocus
set_tooltip = Element.SetTooltip
tk_out = TKOut
@@ -2261,32 +2696,58 @@ class Button(Element):
use_ttk_buttons=None,
font=None, bind_return_key=False, focus=False, pad=None, key=None, visible=True, metadata=None):
"""
- :param button_text: (str) Text to be displayed on the button
- :param button_type: (int) You should NOT be setting this directly. ONLY the shortcut functions set this
- :param target: Union[str, Tuple[int, int]] key or (row,col) target for the button. Note that -1 for column means 1 element to the left of this one. The constant ThisRow is used to indicate the current row. The Button itself is a valid target for some types of button
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param file_types: Tuple[Tuple[str, str], ...] the filetypes that will be used to match files. To indicate all files: (("ALL Files", "*.*"),). Note - NOT SUPPORTED ON MAC
- :param initial_folder: (str) starting path for folders and files
- :param disabled: (bool) If True button will be created disabled
- :param click_submits: (bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead
- :param enable_events: (bool) Turns on the element specific events. If this button is a target, should it generate an event when filled in
- :param image_filename: (str) image filename if there is a button image. GIFs and PNGs only.
- :param image_data: Union[bytes, str] Raw or Base64 representation of the image to put on button. Choose either filename or data
- :param image_size: Tuple[int, int] Size of the image in pixels (width, height)
- :param image_subsample: (int) amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc
- :param border_width: (int) width of border around button in pixels
- :param size: Tuple[int, int] (width, height) of the button in characters wide, rows high
- :param auto_size_button: (bool) if True the button size is sized to fit the text
- :param button_color: Tuple[str, str] (text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green".
- :param disabled_button_color: Tuple[str, str] colors to use when button is disabled (text, background). Use None for a color if don't want to change. Only ttk buttons support both text and background colors. tk buttons only support changing text color
- :param use_ttk_buttons: (bool) True = use ttk buttons. False = do not use ttk buttons. None (Default) = use ttk buttons only if on a Mac and not with button images
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param bind_return_key: (bool) If True the return key will cause this button to be pressed
- :param focus: (bool) if True, initial focus will be put on this button
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param button_text: Text to be displayed on the button
+ :type button_text: (str)
+ :param button_type: You should NOT be setting this directly. ONLY the shortcut functions set this
+ :type button_type: (int)
+ :param target: key or (row,col) target for the button. Note that -1 for column means 1 element to the left of this one. The constant ThisRow is used to indicate the current row. The Button itself is a valid target for some types of button
+ :type target: Union[str, Tuple[int, int]]
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param file_types: the filetypes that will be used to match files. To indicate all files: (("ALL Files", "*.*"),). Note - NOT SUPPORTED ON MAC
+ :type file_types: Tuple[Tuple[str, str], ...]
+ :param initial_folder: starting path for folders and files
+ :type initial_folder: (str)
+ :param disabled: If True button will be created disabled
+ :type disabled: (bool)
+ :param click_submits: DO NOT USE. Only listed for backwards compat - Use enable_events instead
+ :type click_submits: (bool)
+ :param enable_events: Turns on the element specific events. If this button is a target, should it generate an event when filled in
+ :type enable_events: (bool)
+ :param image_filename: image filename if there is a button image. GIFs and PNGs only.
+ :type image_filename: (str)
+ :param image_data: Raw or Base64 representation of the image to put on button. Choose either filename or data
+ :type image_data: Union[bytes, str]
+ :param image_size: Size of the image in pixels (width, height)
+ :type image_size: Tuple[int, int]
+ :param image_subsample: amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc
+ :type image_subsample: (int)
+ :param border_width: width of border around button in pixels
+ :type border_width: (int)
+ :param size: (width, height) of the button in characters wide, rows high
+ :type size: Tuple[int, int]
+ :param auto_size_button: if True the button size is sized to fit the text
+ :type auto_size_button: (bool)
+ :param button_color: (text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green".
+ :type button_color: Tuple[str, str]
+ :param disabled_button_color: colors to use when button is disabled (text, background). Use None for a color if don't want to change. Only ttk buttons support both text and background colors. tk buttons only support changing text color
+ :type disabled_button_color: Tuple[str, str]
+ :param use_ttk_buttons: True = use ttk buttons. False = do not use ttk buttons. None (Default) = use ttk buttons only if on a Mac and not with button images
+ :type use_ttk_buttons: (bool)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param bind_return_key: If True the return key will cause this button to be pressed
+ :type bind_return_key: (bool)
+ :param focus: if True, initial focus will be put on this button
+ :type focus: (bool)
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param key: Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
+ :type key: (Any)
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.AutoSizeButton = auto_size_button
@@ -2440,7 +2901,7 @@ class Button(Element):
self.ParentForm.TKroot.quit()
if self.ParentForm.NonBlocking:
self.ParentForm.TKroot.destroy()
- Window.DecrementOpenCount()
+ Window._DecrementOpenCount()
elif self.BType == BUTTON_TYPE_READ_FORM: # LEAVE THE WINDOW OPEN!! DO NOT CLOSE
# first, get the results table built
# modify the Results table in the parent FlexForm object
@@ -2455,7 +2916,7 @@ class Button(Element):
self.ParentForm._Close()
if self.ParentForm.NonBlocking:
self.ParentForm.TKroot.destroy()
- Window.DecrementOpenCount()
+ Window._DecrementOpenCount()
elif self.BType == BUTTON_TYPE_CALENDAR_CHOOSER: # this is a return type button so GET RESULTS and destroy window
should_submit_window = False
root = tk.Toplevel()
@@ -2467,8 +2928,8 @@ class Button(Element):
self.TKCal.pack(expand=1, fill='both')
root.update()
- if type(Window.user_defined_icon) is bytes:
- calendar_icon = tkinter.PhotoImage(data=Window.user_defined_icon)
+ if type(Window._user_defined_icon) is bytes:
+ calendar_icon = tkinter.PhotoImage(data=Window._user_defined_icon)
else:
calendar_icon = tkinter.PhotoImage(data=DEFAULT_BASE64_ICON)
try:
@@ -2492,16 +2953,24 @@ class Button(Element):
visible=None, image_subsample=None, disabled_button_color=(None, None), image_size=None):
"""
Changes some of the settings for the Button Element. Must call `Window.Read` or `Window.Finalize` prior
-
- :param text: (str) sets button text
- :param button_color: Tuple[str, str] (text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green"
- :param disabled: (bool) disable or enable state of the element
- :param image_data: Union[bytes, str] Raw or Base64 representation of the image to put on button. Choose either filename or data
- :param image_filename: (str) image filename if there is a button image. GIFs and PNGs only.
- :param disabled_button_color: Tuple[str, str] colors to use when button is disabled (text, background). Use None for a color if don't want to change. Only ttk buttons support both text and background colors. tk buttons only support changing text color
- :param visible: (bool) control visibility of element
- :param image_subsample: (int) amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc
- :param image_size: Tuple[int, int] Size of the image in pixels (width, height)
+ :param text: sets button text
+ :type text: (str)
+ :param button_color: (text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green"
+ :type button_color: Tuple[str, str]
+ :param disabled: disable or enable state of the element
+ :type disabled: (bool)
+ :param image_data: Raw or Base64 representation of the image to put on button. Choose either filename or data
+ :type image_data: Union[bytes, str]
+ :param image_filename: image filename if there is a button image. GIFs and PNGs only.
+ :type image_filename: (str)
+ :param disabled_button_color: colors to use when button is disabled (text, background). Use None for a color if don't want to change. Only ttk buttons support both text and background colors. tk buttons only support changing text color
+ :type disabled_button_color: Tuple[str, str]
+ :param visible: control visibility of element
+ :type visible: (bool)
+ :param image_subsample: amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc
+ :type image_subsample: (int)
+ :param image_size: Size of the image in pixels (width, height)
+ :type image_size: Tuple[int, int]
"""
if self.Widget is None:
@@ -2559,7 +3028,7 @@ class Button(Element):
if visible is False:
self.TKButton.pack_forget()
elif visible is True:
- self.TKButton.pack()
+ self.TKButton.pack(padx=self.pad_used[0], pady=self.pad_used[1])
if disabled_button_color != (None, None):
if not self.UseTtkButtons:
self.TKButton['disabledforeground'] = disabled_button_color[0]
@@ -2575,7 +3044,8 @@ class Button(Element):
"""
Returns the current text shown on a button
- :return: (str) The text currently displayed on the button
+ :return: The text currently displayed on the button
+ :rtype: (str)
"""
return self.ButtonText
@@ -2614,24 +3084,42 @@ class ButtonMenu(Element):
size=(None, None), auto_size_button=None, button_color=None, font=None, pad=None, key=None,
tearoff=False, visible=True, metadata=None):
"""
- :param button_text: (str) Text to be displayed on the button
- :param menu_def: List[List[str]] A list of lists of Menu items to show when this element is clicked. See docs for format as they are the same for all menu types
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param disabled: (bool) If True button will be created disabled
- :param image_filename: (str) image filename if there is a button image. GIFs and PNGs only.
- :param image_data: Union[bytes, str] Raw or Base64 representation of the image to put on button. Choose either filename or data
- :param image_size: Tuple[int, int] Size of the image in pixels (width, height)
- :param image_subsample: (int) amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc
- :param border_width: (int) width of border around button in pixels
- :param size: Tuple[int, int] (width, height) of the button in characters wide, rows high
- :param auto_size_button: (bool) if True the button size is sized to fit the text
- :param button_color: Tuple[str, str] (text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green"
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
- :param tearoff: (bool) Determines if menus should allow them to be torn off
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param button_text: Text to be displayed on the button
+ :type button_text: (str)
+ :param menu_def: A list of lists of Menu items to show when this element is clicked. See docs for format as they are the same for all menu types
+ :type menu_def: List[List[str]]
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param disabled: If True button will be created disabled
+ :type disabled: (bool)
+ :param image_filename: image filename if there is a button image. GIFs and PNGs only.
+ :type image_filename: (str)
+ :param image_data: Raw or Base64 representation of the image to put on button. Choose either filename or data
+ :type image_data: Union[bytes, str]
+ :param image_size: Size of the image in pixels (width, height)
+ :type image_size: Tuple[int, int]
+ :param image_subsample: amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc
+ :type image_subsample: (int)
+ :param border_width: width of border around button in pixels
+ :type border_width: (int)
+ :param size:(width, height) of the button in characters wide, rows high
+ :type size: Tuple[int, int]
+ :param auto_size_button: if True the button size is sized to fit the text
+ :type auto_size_button: (bool)
+ :param button_color: (text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green"
+ :type button_color: Tuple[str, str]
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param key: Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
+ :type key: (Any)
+ :param tearoff: Determines if menus should allow them to be torn off
+ :type tearoff: (bool)
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.MenuDefinition = menu_def
@@ -2661,7 +3149,8 @@ class ButtonMenu(Element):
"""
Not a user callable function. Called by tkinter when an item is chosen from the menu.
- :param item_chosen: (str) The menu item chosen.
+ :param item_chosen: The menu item chosen.
+ :type item_chosen: (str)
"""
# print('IN MENU ITEM CALLBACK', item_chosen)
self.MenuItemChosen = item_chosen.replace('&', '')
@@ -2674,8 +3163,10 @@ class ButtonMenu(Element):
"""
Changes some of the settings for the ButtonMenu Element. Must call `Window.Read` or `Window.Finalize` prior
- :param menu_definition: (List[List]) New menu definition (in menu definition format)
- :param visible: (bool) control visibility of element
+ :param menu_definition: (New menu definition (in menu definition format)
+ :type menu_definition: List[List]
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self.Widget is None:
@@ -2689,7 +3180,7 @@ class ButtonMenu(Element):
if visible is False:
self.TKButtonMenu.pack_forget()
elif visible is True:
- self.TKButtonMenu.pack()
+ self.TKButtonMenu.pack(padx=self.pad_used[0], pady=self.pad_used[1])
def Click(self):
"""
@@ -2720,18 +3211,30 @@ class ProgressBar(Element):
def __init__(self, max_value, orientation=None, size=(None, None), auto_size_text=None, bar_color=(None, None), style=None, border_width=None, relief=None,
key=None, pad=None, visible=True, metadata=None):
"""
- :param max_value: (int) max value of progressbar
- :param orientation: (str) 'horizontal' or 'vertical'
- :param size: Tuple[int, int] Size of the bar. If horizontal (chars wide, pixels high), vert (pixels wide, rows high)
- :param auto_size_text: (bool) Not sure why this is here
- :param bar_color: Tuple[str, str] The 2 colors that make up a progress bar. One is the background, the other is the bar
- :param style: (str) Progress bar style defined as one of these 'default', 'winnative', 'clam', 'alt', 'classic', 'vista', 'xpnative'
- :param border_width: (int) The amount of pixels that go around the outside of the bar
- :param relief: (str) relief style. Values are same as progress meter relief values. Can be a constant or a string: `RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID` (Default value = DEFAULT_PROGRESS_BAR_RELIEF)
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param max_value: max value of progressbar
+ :type max_value: (int)
+ :param orientation: 'horizontal' or 'vertical'
+ :type orientation: (str)
+ :param size: Size of the bar. If horizontal (chars wide, pixels high), vert (pixels wide, rows high)
+ :type size: Tuple[int, int]
+ :param auto_size_text: Not sure why this is here
+ :type auto_size_text: (bool)
+ :param bar_color: The 2 colors that make up a progress bar. One is the background, the other is the bar
+ :type bar_color: Tuple[str, str]
+ :param style: Progress bar style defined as one of these 'default', 'winnative', 'clam', 'alt', 'classic', 'vista', 'xpnative'
+ :type style: (str)
+ :param border_width: The amount of pixels that go around the outside of the bar
+ :type border_width: (int)
+ :param relief: relief style. Values are same as progress meter relief values. Can be a constant or a string: `RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID` (Default value = DEFAULT_PROGRESS_BAR_RELIEF)
+ :type relief: (str)
+ :param key: Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
+ :type key: (Any)
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.MaxValue = max_value
@@ -2752,8 +3255,10 @@ class ProgressBar(Element):
"""
Change what the bar shows by changing the current count and optionally the max count
- :param current_count: (int) sets the current value
- :param max: (int) changes the max value
+ :param current_count: sets the current value
+ :type current_count: (int)
+ :param max: changes the max value
+ :type max: (int)
"""
if self.ParentForm.TKrootDestroyed:
@@ -2762,7 +3267,7 @@ class ProgressBar(Element):
try:
self.ParentForm.TKroot.update()
except:
- Window.DecrementOpenCount()
+ Window._DecrementOpenCount()
# _my_windows.Decrement()
return False
return True
@@ -2771,7 +3276,8 @@ class ProgressBar(Element):
"""
Changes some of the settings for the ProgressBar Element. Must call `Window.Read` or `Window.Finalize` prior
- :param visible: (bool) control visibility of element
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self.Widget is None:
warnings.warn('You cannot Update element with key = {} until the window has been Read or Finalized'.format(self.Key), UserWarning)
@@ -2779,7 +3285,7 @@ class ProgressBar(Element):
if visible is False:
self.TKProgressBar.TKProgressBarForReal.pack_forget()
elif visible is True:
- self.TKProgressBar.TKProgressBarForReal.pack()
+ self.TKProgressBar.TKProgressBarForReal.pack(padx=self.pad_used[0], pady=self.pad_used[1])
set_focus = Element.SetFocus
set_tooltip = Element.SetTooltip
@@ -2802,17 +3308,28 @@ class Image(Element):
def __init__(self, filename=None, data=None, background_color=None, size=(None, None), pad=None, key=None,
tooltip=None, right_click_menu=None, visible=True, enable_events=False, metadata=None):
"""
- :param filename: (str) image filename if there is a button image. GIFs and PNGs only.
- :param data: Union[bytes, str] Raw or Base64 representation of the image to put on button. Choose either filename or data
+ :param filename: image filename if there is a button image. GIFs and PNGs only.
+ :type filename: (str)
+ :param data: Raw or Base64 representation of the image to put on button. Choose either filename or data
+ :type data: Union[bytes, str]
:param background_color: color of background
- :param size: Tuple[int, int] (width, height) size of image in pixels
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param right_click_menu: List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
- :param visible: (bool) set visibility state of the element
- :param enable_events: (bool) Turns on the element specific events. For an Image element, the event is "image clicked"
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :type background_color:
+ :param size: (width, height) size of image in pixels
+ :type size: Tuple[int, int]
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param key: Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
+ :type key: (Any)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param right_click_menu: A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
+ :type right_click_menu: List[List[Union[List[str],str]]]
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param enable_events: Turns on the element specific events. For an Image element, the event is "image clicked"
+ :type enable_events: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.Filename = filename
@@ -2820,7 +3337,7 @@ class Image(Element):
self.tktext_label = None
self.BackgroundColor = background_color
if data is None and filename is None:
- print('* Warning... no image specified in Image Element! *')
+ self.Filename = ''
self.EnableEvents = enable_events
self.RightClickMenu = right_click_menu
self.AnimatedFrames = None
@@ -2836,11 +3353,14 @@ class Image(Element):
def Update(self, filename=None, data=None, size=(None, None), visible=None):
"""
Changes some of the settings for the Image Element. Must call `Window.Read` or `Window.Finalize` prior
-
- :param filename: (str) filename to the new image to display.
- :param data: Union[str, tkPhotoImage] Base64 encoded string OR a tk.PhotoImage object
- :param size: Tuple[int,int] size of a image (w,h) w=characters-wide, h=rows-high
- :param visible: (bool) control visibility of element
+ :param filename: filename to the new image to display.
+ :type filename: (str)
+ :param data: Base64 encoded string OR a tk.PhotoImage object
+ :type data: Union[str, tkPhotoImage]
+ :param size: size of a image (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int,int]
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
image = None
@@ -2859,7 +3379,10 @@ class Image(Element):
else:
return
if image is not None:
- width, height = size[0] or image.width(), size[1] or image.height()
+ if type(image) is not bytes:
+ width, height = size[0] or image.width(), size[1] or image.height()
+ else:
+ width, height = size
try: # sometimes crashes if user closed with X
self.tktext_label.configure(image=image, width=width, height=height)
except:
@@ -2868,15 +3391,16 @@ class Image(Element):
if visible is False:
self.tktext_label.pack_forget()
elif visible is True:
- self.tktext_label.pack()
+ self.tktext_label.pack(padx=self.pad_used[0], pady=self.pad_used[1])
def UpdateAnimation(self, source, time_between_frames=0):
"""
Show an Animated GIF. Call the function as often as you like. The function will determine when to show the next frame and will automatically advance to the next frame at the right time.
NOTE - does NOT perform a sleep call to delay
-
- :param source: Union[str,bytes] Filename or Base64 encoded string containing Animated GIF
- :param time_between_frames: (int) Number of milliseconds to wait between showing frames
+ :param source: Filename or Base64 encoded string containing Animated GIF
+ :type source: Union[str,bytes]
+ :param time_between_frames: Number of milliseconds to wait between showing frames
+ :type time_between_frames: (int)
"""
if self.Source != source:
@@ -2918,6 +3442,58 @@ class Image(Element):
except:
pass
+
+
+ def update_animation_no_buffering(self, source, time_between_frames=0):
+ """
+ Show an Animated GIF. Call the function as often as you like. The function will determine when to show the next frame and will automatically advance to the next frame at the right time.
+ NOTE - does NOT perform a sleep call to delay
+ :param source: Filename or Base64 encoded string containing Animated GIF
+ :type source: Union[str,bytes]
+ :param time_between_frames: Number of milliseconds to wait between showing frames
+ :type time_between_frames: (int)
+ """
+
+ if self.Source != source:
+ self.AnimatedFrames = None
+ self.Source = source
+ self.frame_num = 0
+
+ # read a frame
+ while True:
+ if type(source) is not bytes:
+ try:
+ self.image = tk.PhotoImage(file=source, format='gif -index %i' % (self.frame_num))
+ self.frame_num += 1
+ except:
+ self.frame_num = 0
+ else:
+ try:
+ self.image = tk.PhotoImage(data=source, format='gif -index %i' % (self.frame_num))
+ self.frame_num += 1
+ except:
+ self.frame_num = 0
+ if self.frame_num:
+ break
+
+ now = time.time()
+
+ if time_between_frames:
+ if (now - self.LastFrameTime) * 1000 > time_between_frames:
+ self.LastFrameTime = now
+ else: # don't reshow the frame again if not time for new frame
+ return
+
+ try: # needed in case the window was closed with an "X"
+ self.tktext_label.configure(image=self.image, width=self.image.width(), heigh=self.image.height())
+
+ except:
+ pass
+
+
+
+
+
set_focus = Element.SetFocus
set_tooltip = Element.SetTooltip
update = Update
@@ -2928,21 +3504,28 @@ class Image(Element):
# Canvas #
# ---------------------------------------------------------------------- #
class Canvas(Element):
- """ """
def __init__(self, canvas=None, background_color=None, size=(None, None), pad=None, key=None, tooltip=None,
right_click_menu=None, visible=True, metadata=None):
"""
-
- :param canvas: (tk.Canvas) Your own tk.Canvas if you already created it. Leave blank to create a Canvas
- :param background_color: (str) color of background
- :param size: Tuple[int,int] (width in char, height in rows) size in pixels to make canvas
+ :param canvas: Your own tk.Canvas if you already created it. Leave blank to create a Canvas
+ :type canvas: (tk.Canvas)
+ :param background_color: color of background
+ :type background_color: (str)
+ :param size: (width in char, height in rows) size in pixels to make canvas
+ :type size: Tuple[int,int]
:param pad: Amount of padding to put around element
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param right_click_menu: List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :type pad: int
+ :param key: Used with window.FindElement and with return values to uniquely identify this element
+ :type key: (Any)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param right_click_menu: A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
+ :type right_click_menu: List[List[Union[List[str],str]]]
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.BackgroundColor = background_color if background_color is not None else DEFAULT_BACKGROUND_COLOR
@@ -2955,7 +3538,6 @@ class Canvas(Element):
@property
def TKCanvas(self):
- """ """
if self._TKCanvas is None:
print('*** Did you forget to call Finalize()? Your code should look something like: ***')
print('*** window = sg.Window("My Form", layout, finalize=True) ***')
@@ -2986,20 +3568,34 @@ class Graph(Element):
change_submits=False, drag_submits=False, enable_events=False, key=None, tooltip=None,
right_click_menu=None, visible=True, float_values=False, metadata=None):
"""
- :param canvas_size: Tuple[int, int] (width, height) size of the canvas area in pixels
- :param graph_bottom_left: Tuple[int, int] (x,y) The bottoms left corner of your coordinate system
- :param graph_top_right: Tuple[int, int] (x,y) The top right corner of your coordinate system
- :param background_color: (str) background color of the drawing area
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param change_submits: (bool) * DEPRICATED DO NOT USE! Same as enable_events
- :param drag_submits: (bool) if True and Events are enabled for the Graph, will report Events any time the mouse moves while button down
- :param enable_events: (bool) If True then clicks on the Graph are immediately reported as an event. Use this instead of change_submits
- :param key: (any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param right_click_menu: List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
- :param visible: (bool) set visibility state of the element (Default = True)
- :param float_values: (bool) If True x,y coordinates are returned as floats, not ints
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param canvas_size: (width, height) size of the canvas area in pixels
+ :type canvas_size: Tuple[int, int]
+ :param graph_bottom_left: (x,y) The bottoms left corner of your coordinate system
+ :type graph_bottom_left: Tuple[int, int]
+ :param graph_top_right: (x,y) The top right corner of your coordinate system
+ :type graph_top_right: Tuple[int, int]
+ :param background_color: background color of the drawing area
+ :type background_color: (str)
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param change_submits: * DEPRICATED DO NOT USE! Same as enable_events
+ :type change_submits: (bool)
+ :param drag_submits: if True and Events are enabled for the Graph, will report Events any time the mouse moves while button down
+ :type drag_submits: (bool)
+ :param enable_events: If True then clicks on the Graph are immediately reported as an event. Use this instead of change_submits
+ :type enable_events: (bool)
+ :param key: Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
+ :type key: (any)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param right_click_menu: A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
+ :type right_click_menu: List[List[Union[List[str],str]]]
+ :param visible: set visibility state of the element (Default = True)
+ :type visible: (bool)
+ :param float_values: If True x,y coordinates are returned as floats, not ints
+ :type float_values: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.CanvasSize = canvas_size
@@ -3022,10 +3618,12 @@ class Graph(Element):
def _convert_xy_to_canvas_xy(self, x_in, y_in):
"""
Not user callable. Used to convert user's coordinates into the ones used by tkinter
-
- :param x_in: Union[int, float] The x coordinate to convert
- :param y_in: Union[int, float] The y coordinate to convert
+ :param x_in: The x coordinate to convert
+ :type x_in: Union[int, float]
+ :param y_in: The y coordinate to convert
+ :type y_in: Union[int, float]
:return: Tuple[int, int] The converted canvas coordinates
+ :rtype: Tuple[int, int]
"""
if None in (x_in, y_in):
return None, None
@@ -3040,8 +3638,11 @@ class Graph(Element):
Not user callable. Used to convert tkinter Canvas coords into user's coordinates
:param x_in: (int) The x coordinate in canvas coordinates
+ :type x_in: (int)
:param y_in: (int) The y coordinate in canvas coordinates
- :return: Union[Tuple[int, int], Tuple[float, float]] The converted USER coordinates
+ :type y_in: (int)
+ :return: The converted USER coordinates
+ :rtype: Union[Tuple[int, int], Tuple[float, float]]
"""
if None in (x_in, y_in):
return None, None
@@ -3058,13 +3659,16 @@ class Graph(Element):
def DrawLine(self, point_from, point_to, color='black', width=1):
"""
Draws a line from one point to another point using USER'S coordinates. Can set the color and width of line
-
- :param point_from: Union[Tuple[int, int], Tuple[float, float]] Starting point for line
- :param point_to: Union[Tuple[int, int], Tuple[float, float]] Ending point for line
- :param color: (str) Color of the line
- :param width: (int) width of line in pixels
- :return: Union[int, None] id returned from tktiner or None if user closed the window. id is used when you
- want to manipulate the line
+ :param point_from: Starting point for line
+ :type point_from: Union[Tuple[int, int], Tuple[float, float]]
+ :param point_to: Ending point for line
+ :type point_to: Union[Tuple[int, int], Tuple[float, float]]
+ :param color: Color of the line
+ :type color: (str)
+ :param width: width of line in pixels
+ :type width: (int)
+ :return: id returned from tktiner or None if user closed the window. id is used when you
+ :rtype: Union[int, None]
"""
if point_from == (None, None):
return
@@ -3083,11 +3687,14 @@ class Graph(Element):
def DrawPoint(self, point, size=2, color='black'):
"""
Draws a "dot" at the point you specify using the USER'S coordinate system
-
- :param point: Union [Tuple[int, int], Tuple[float, float]] Center location using USER'S coordinate system
- :param size: Union[int, float] Radius? (Or is it the diameter?) in user's coordinate values.
- :param color: (str) color of the point to draw
- :return: Union[int, None] id returned from tkinter that you'll need if you want to manipulate the point
+ :param point: Center location using USER'S coordinate system
+ :type point: Union [Tuple[int, int], Tuple[float, float]]
+ :param size: Radius? (Or is it the diameter?) in user's coordinate values.
+ :type size: Union[int, float]
+ :param color: color of the point to draw
+ :type color: (str)
+ :return: id returned from tkinter that you'll need if you want to manipulate the point
+ :rtype: Union[int, None]
"""
if point == (None, None):
return
@@ -3099,8 +3706,13 @@ class Graph(Element):
print('Call Window.Finalize() prior to this operation')
return None
try: # needed in case window was closed with an X
- id = self._TKCanvas2.create_oval(converted_point[0] - size, converted_point[1] - size,
- converted_point[0] + size, converted_point[1] + size, fill=color,
+ point1 = converted_point[0] - size // 2, converted_point[1] - size // 2
+ point2 = converted_point[0] + size // 2, converted_point[1] + size // 2
+ # print(f'point size = {size} points = {point1} and {point2}')
+ id = self._TKCanvas2.create_oval(point1[0], point1[1],
+ point2[0], point2[1],
+ width=0,
+ fill=color,
outline=color)
except:
id = None
@@ -3109,13 +3721,18 @@ class Graph(Element):
def DrawCircle(self, center_location, radius, fill_color=None, line_color='black', line_width=1):
"""
Draws a circle, cenetered at the location provided. Can set the fill and outline colors
-
- :param center_location: Union [Tuple[int, int], Tuple[float, float]] Center location using USER'S coordinate system
- :param radius: Union[int, float] Radius in user's coordinate values.
- :param fill_color: (str) color of the point to draw
- :param line_color: (str) color of the outer line that goes around the circle (sorry, can't set thickness)
- :param line_width: (int) width of the line around the circle, the outline, in pixels
- :return: Union[int, None] id returned from tkinter that you'll need if you want to manipulate the circle
+ :param center_location: Center location using USER'S coordinate system
+ :type center_location: Union [Tuple[int, int], Tuple[float, float]]
+ :param radius: Radius in user's coordinate values.
+ :type radius: Union[int, float]
+ :param fill_color: color of the point to draw
+ :type fill_color: (str)
+ :param line_color: color of the outer line that goes around the circle (sorry, can't set thickness)
+ :type line_color: (str)
+ :param line_width: width of the line around the circle, the outline, in pixels
+ :type line_width: (int)
+ :return: id returned from tkinter that you'll need if you want to manipulate the circle
+ :rtype: Union[int, None]
"""
if center_location == (None, None):
return
@@ -3141,13 +3758,18 @@ class Graph(Element):
def DrawOval(self, top_left, bottom_right, fill_color=None, line_color=None, line_width=1):
"""
Draws an oval based on coordinates in user coordinate system. Provide the location of a "bounding rectangle"
-
- :param top_left: Union[Tuple[int, int], Tuple[float, float]] the top left point of bounding rectangle
- :param bottom_right: Union[Tuple[int, int], Tuple[float, float]] the bottom right point of bounding rectangle
- :param fill_color: (str) color of the interrior
- :param line_color: (str) color of outline of oval
- :param line_width: (int) width of the line around the oval, the outline, in pixels
- :return: Union[int, None] id returned from tkinter that you'll need if you want to manipulate the oval
+ :param top_left: the top left point of bounding rectangle
+ :type top_left: Union[Tuple[int, int], Tuple[float, float]]
+ :param bottom_right: the bottom right point of bounding rectangle
+ :type bottom_right: Union[Tuple[int, int], Tuple[float, float]]
+ :param fill_color: color of the interrior
+ :type fill_color: (str)
+ :param line_color: color of outline of oval
+ :type line_color: (str)
+ :param line_width: width of the line around the oval, the outline, in pixels
+ :type line_width: (int)
+ :return: id returned from tkinter that you'll need if you want to manipulate the oval
+ :rtype: Union[int, None]
"""
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])
@@ -3163,18 +3785,23 @@ class Graph(Element):
return id
- def DrawArc(self, top_left, bottom_right, extent, start_angle, style=None, arc_color='black'):
+ def DrawArc(self, top_left, bottom_right, extent, start_angle, style=None, arc_color='black', line_width=1):
"""
Draws different types of arcs. Uses a "bounding box" to define location
-
- :param top_left: Union[Tuple[int, int], Tuple[float, float]] the top left point of bounding rectangle
- :param bottom_right: Union[Tuple[int, int], Tuple[float, float]] the bottom right point of bounding rectangle
- :param extent: (float) Andle to end drawing. Used in conjunction with start_angle
- :param start_angle: (float) Angle to begin drawing. Used in conjunction with extent
- :param style: (str) Valid choices are One of these Style strings- 'pieslice', 'chord', 'arc', 'first', 'last',
- 'butt', 'projecting', 'round', 'bevel', 'miter'
- :param arc_color: (str) color to draw arc with
- :return: Union[int, None] id returned from tkinter that you'll need if you want to manipulate the arc
+ :param top_left: the top left point of bounding rectangle
+ :type top_left: Union[Tuple[int, int], Tuple[float, float]]
+ :param bottom_right: the bottom right point of bounding rectangle
+ :type bottom_right: Union[Tuple[int, int], Tuple[float, float]]
+ :param extent: Andle to end drawing. Used in conjunction with start_angle
+ :type extent: (float)
+ :param start_angle: Angle to begin drawing. Used in conjunction with extent
+ :type start_angle: (float)
+ :param style: Valid choices are One of these Style strings- 'pieslice', 'chord', 'arc', 'first', 'last', 'butt', 'projecting', 'round', 'bevel', 'miter'
+ :type style: (str)
+ :param arc_color: color to draw arc with
+ :type arc_color: (str)
+ :return: id returned from tkinter that you'll need if you want to manipulate the arc
+ :rtype: Union[int, None]
"""
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])
@@ -3186,7 +3813,7 @@ class Graph(Element):
try: # in case closed with X
id = 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)
+ outline=arc_color, width=line_width)
except:
id = None
return id
@@ -3195,11 +3822,18 @@ class Graph(Element):
"""
Draw a rectangle given 2 points. Can control the line and fill colors
- :param top_left: Union[Tuple[int, int], Tuple[float, float]] the top left point of rectangle
- :param bottom_right: Union[Tuple[int, int], Tuple[float, float]] the bottom right point of rectangle
- :param fill_color: (str) color of the interior
- :param line_color: (str) color of outline
+ :param top_left: the top left point of rectangle
+ :type top_left: Union[Tuple[int, int], Tuple[float, float]]
+ :param bottom_right: the bottom right point of rectangle
+ :type bottom_right: Union[Tuple[int, int], Tuple[float, float]]
+ :param fill_color: color of the interior
+ :type fill_color: (str)
+ :param line_color: color of outline
+ :type line_color: (str)
+ :param line_width: width of the line in pixels
+ :type line_width: (int)
:return: Union[int, None] id returned from tkinter that you'll need if you want to manipulate the rectangle
+ :rtype: Union[int, None]
"""
converted_top_left = self._convert_xy_to_canvas_xy(top_left[0], top_left[1])
@@ -3218,18 +3852,56 @@ class Graph(Element):
id = None
return id
+
+ def DrawPolygon(self, points, fill_color=None, line_color=None, line_width=None):
+ """
+ Draw a rectangle given 2 points. Can control the line and fill colors
+
+ :param points: list of points that define the polygon
+ :type points: List[Union[Tuple[int, int], Tuple[float, float]]]
+ :param fill_color: color of the interior
+ :type fill_color: (str)
+ :param line_color: color of outline
+ :type line_color: (str)
+ :param line_width: width of the line in pixels
+ :type line_width: (int)
+ :return: id returned from tkinter that you'll need if you want to manipulate the rectangle
+ :rtype: Union[int, None]
+ """
+
+ converted_points = [self._convert_xy_to_canvas_xy(point[0], point[1]) for point in points]
+ 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
+ try: # in case closed with X
+ id = self._TKCanvas2.create_polygon(converted_points, fill=fill_color, outline=line_color, width=line_width)
+ except:
+ id = None
+ return id
+
+
+
def DrawText(self, text, location, color='black', font=None, angle=0, text_location=TEXT_LOCATION_CENTER):
"""
Draw some text on your graph. This is how you label graph number lines for example
- :param text: (str) text to display
- :param location: Union[Tuple[int, int], Tuple[float, float]] location to place first letter
- :param color: (str) text color
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param angle: (float) Angle 0 to 360 to draw the text. Zero represents horizontal text
- :param text_location: (enum) "anchor" location for the text. Values start with TEXT_LOCATION_
- :return: Union[int, None] id returned from tkinter that you'll need if you want to manipulate the text
+ :param text: text to display
+ :type text: (str)
+ :param location: location to place first letter
+ :type location: Union[Tuple[int, int], Tuple[float, float]]
+ :param color: text color
+ :type color: (str)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param angle: Angle 0 to 360 to draw the text. Zero represents horizontal text
+ :type angle: (float)
+ :param text_location: "anchor" location for the text. Values start with TEXT_LOCATION_
+ :type text_location: (enum)
+ :return: id returned from tkinter that you'll need if you want to manipulate the text
+ :rtype: Union[int, None]
"""
+ text = str(text)
if location == (None, None):
return
converted_point = self._convert_xy_to_canvas_xy(location[0], location[1])
@@ -3247,13 +3919,20 @@ class Graph(Element):
"""
Places an image onto your canvas. It's a really important method for this element as it enables so much
- :param filename: (str) if image is in a file, path and filename for the image. (GIF and PNG only!)
- :param data: Union[str, bytes] if image is in Base64 format or raw? format then use instead of filename
- :param location: Union[Tuple[int, int], Tuple[float, float]] the (x,y) location to place image's top left corner
- :param color: (str) text color
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param angle: (float) Angle 0 to 360 to draw the text. Zero represents horizontal text
- :return: Union[int, None] id returned from tkinter that you'll need if you want to manipulate the image
+ :param filename: if image is in a file, path and filename for the image. (GIF and PNG only!)
+ :type filename: (str)
+ :param data: if image is in Base64 format or raw? format then use instead of filename
+ :type data: Union[str, bytes]
+ :param location: the (x,y) location to place image's top left corner
+ :type location: Union[Tuple[int, int], Tuple[float, float]]
+ :param color: text color
+ :type color: (str)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param angle: Angle 0 to 360 to draw the text. Zero represents horizontal text
+ :type angle: (float)
+ :return: id returned from tkinter that you'll need if you want to manipulate the image
+ :rtype: Union[int, None]
"""
if location == (None, None):
return
@@ -3295,7 +3974,8 @@ class Graph(Element):
"""
Remove from the Graph the figure represented by id. The id is given to you anytime you call a drawing primitive
- :param id: (int) the id returned to you when calling one of the drawing methods
+ :param id: the id returned to you when calling one of the drawing methods
+ :type id: (int)
"""
try:
self._TKCanvas2.delete(id)
@@ -3311,7 +3991,9 @@ class Graph(Element):
Changes some of the settings for the Graph Element. Must call `Window.Read` or `Window.Finalize` prior
:param background_color: color of background
- :param visible: (bool) control visibility of element
+ :type background_color: ???
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self._TKCanvas2 is None:
print('*** WARNING - The Graph element has not been finalized and cannot be drawn upon ***')
@@ -3322,14 +4004,16 @@ class Graph(Element):
if visible is False:
self._TKCanvas2.pack_forget()
elif visible is True:
- self._TKCanvas2.pack()
+ self._TKCanvas2.pack(padx=self.pad_used[0], pady=self.pad_used[1])
def Move(self, x_direction, y_direction):
"""
Moves the entire drawing area (the canvas) by some delta from the current position. Units are indicated in your coordinate system indicated number of ticks in your coordinate system
- :param x_direction: Union[int, float] how far to move in the "X" direction in your coordinates
- :param y_direction: Union[int, float] how far to move in the "Y" direction in your coordinates
+ :param x_direction: how far to move in the "X" direction in your coordinates
+ :type x_direction: Union[int, float]
+ :param y_direction: how far to move in the "Y" direction in your coordinates
+ :type y_direction: Union[int, float]
"""
zero_converted = self._convert_xy_to_canvas_xy(0, 0)
shift_converted = self._convert_xy_to_canvas_xy(x_direction, y_direction)
@@ -3344,9 +4028,12 @@ class Graph(Element):
"""
Moves a previously drawn figure using a "delta" from current position
- :param figure: (id) Previously obtained figure-id. These are returned from all Draw methods
- :param x_direction: Union[int, float] delta to apply to position in the X direction
- :param y_direction: Union[int, float] delta to apply to position in the Y direction
+ :param figure: Previously obtained figure-id. These are returned from all Draw methods
+ :type figure: (id)
+ :param x_direction: delta to apply to position in the X direction
+ :type x_direction: Union[int, float]
+ :param y_direction: delta to apply to position in the Y direction
+ :type y_direction: Union[int, float]
"""
zero_converted = self._convert_xy_to_canvas_xy(0, 0)
shift_converted = self._convert_xy_to_canvas_xy(x_direction, y_direction)
@@ -3362,9 +4049,12 @@ class Graph(Element):
Move a previously made figure to an arbitrary (x,y) location. This differs from the Move methods because it
uses absolute coordinates versus relative for Move
- :param figure: (id) Previously obtained figure-id. These are returned from all Draw methods
- :param x: Union[int, float] location on X axis (in user coords) to move the upper left corner of the figure
- :param y: Union[int, float] location on Y axis (in user coords) to move the upper left corner of the figure
+ :param figure: Previously obtained figure-id. These are returned from all Draw methods
+ :type figure: (id)
+ :param x: location on X axis (in user coords) to move the upper left corner of the figure
+ :type x: Union[int, float]
+ :param y: location on Y axis (in user coords) to move the upper left corner of the figure
+ :type y: Union[int, float]
"""
zero_converted = self._convert_xy_to_canvas_xy(0, 0)
@@ -3381,7 +4071,8 @@ class Graph(Element):
"""
Changes Z-order of figures on the Graph. Sends the indicated figure to the back of all other drawn figures
- :param figure: (int) value returned by tkinter when creating the figure / drawing
+ :param figure: value returned by tkinter when creating the figure / drawing
+ :type figure: (int)
"""
self.TKCanvas.tag_lower(figure) # move figure to the "bottom" of all other figure
@@ -3389,7 +4080,8 @@ class Graph(Element):
"""
Changes Z-order of figures on the Graph. Brings the indicated figure to the front of all other drawn figures
- :param figure: (int) value returned by tkinter when creating the figure / drawing
+ :param figure: value returned by tkinter when creating the figure / drawing
+ :type figure: (int)
"""
self.TKCanvas.tag_raise(figure) # move figure to the "top" of all other figures
@@ -3398,8 +4090,10 @@ class Graph(Element):
"""
Returns a list of figures located at a particular x,y location within the Graph
- :param location: Union[Tuple[int, int], Tuple[float, float]] point to check
- :return: List[int] a list of previously drawn "Figures" (returned from the drawing primitives)
+ :param location: point to check
+ :type location: Union[Tuple[int, int], Tuple[float, float]]
+ :return: a list of previously drawn "Figures" (returned from the drawing primitives)
+ :rtype: List[int]
"""
x, y = self._convert_xy_to_canvas_xy(location[0], location[1])
ids = self.TKCanvas.find_overlapping(x,y,x,y)
@@ -3410,16 +4104,32 @@ class Graph(Element):
Given a figure, returns the upper left and lower right bounding box coordinates
:param figure: a previously drawing figure
- :return: Union[Tuple[int, int, int, int], Tuple[float, float, float, float]] (upper left x, upper left y, lower right x, lower right y
+ :type figure: object
+ :return: upper left x, upper left y, lower right x, lower right y
+ :rtype: Union[Tuple[int, int, int, int], Tuple[float, float, float, float]]
"""
box = self.TKCanvas.bbox(figure)
top_left = self._convert_canvas_xy_to_xy(box[0], box[1])
bottom_right = self._convert_canvas_xy_to_xy(box[2], box[3])
return top_left,bottom_right
+
+ def change_coordinates(self, graph_bottom_left, graph_top_right):
+ """
+ Changes the corrdinate system to a new one. The same 2 points in space are used to define the coorinate
+ system - the bottom left and the top right values of your graph.
+
+ :param graph_bottom_left: The bottoms left corner of your coordinate system
+ :type graph_bottom_left: Tuple[int, int] (x,y)
+ :param graph_top_right: The top right corner of your coordinate system
+ :type graph_top_right: Tuple[int, int] (x,y)
+ """
+ self.BottomLeft = graph_bottom_left
+ self.TopRight = graph_top_right
+
+
@property
def TKCanvas(self):
- """ """
if self._TKCanvas2 is None:
print('*** Did you forget to call Finalize()? Your code should look something like: ***')
print('*** form = sg.Window("My Form").Layout(layout).Finalize() ***')
@@ -3493,6 +4203,7 @@ class Graph(Element):
draw_line = DrawLine
draw_oval = DrawOval
draw_point = DrawPoint
+ draw_polygon = DrawPolygon
draw_rectangle = DrawRectangle
draw_text = DrawText
get_figures_at_location = GetFiguresAtLocation
@@ -3521,23 +4232,38 @@ class Frame(Element):
relief=DEFAULT_FRAME_RELIEF, size=(None, None), font=None, pad=None, border_width=None, key=None,
tooltip=None, right_click_menu=None, visible=True, element_justification='left', metadata=None):
"""
- :param title: (str) text that is displayed as the Frame's "label" or title
- :param layout: List[List[Elements]] The layout to put inside the Frame
- :param title_color: (str) color of the title text
- :param background_color: (str) background color of the Frame
- :param title_location: (enum) location to place the text title. Choices include: TITLE_LOCATION_TOP TITLE_LOCATION_BOTTOM TITLE_LOCATION_LEFT TITLE_LOCATION_RIGHT TITLE_LOCATION_TOP_LEFT TITLE_LOCATION_TOP_RIGHT TITLE_LOCATION_BOTTOM_LEFT TITLE_LOCATION_BOTTOM_RIGHT
- :param relief: (enum) relief style. Values are same as other elements with reliefs.
- Choices include RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID
- :param size: Tuple[int, int] (width in characters, height in rows) (note this parameter may not always work)
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param border_width: (int) width of border around element in pixels
- :param key: (any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param right_click_menu: List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
- :param visible: (bool) set visibility state of the element
- :param element_justification: (str) All elements inside the Frame will have this justification 'left', 'right', 'center' are valid values
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param title: text that is displayed as the Frame's "label" or title
+ :type title: (str)
+ :param layout: The layout to put inside the Frame
+ :type layout: List[List[Elements]]
+ :param title_color: color of the title text
+ :type title_color: (str)
+ :param background_color: background color of the Frame
+ :type background_color: (str)
+ :param title_location: location to place the text title. Choices include: TITLE_LOCATION_TOP TITLE_LOCATION_BOTTOM TITLE_LOCATION_LEFT TITLE_LOCATION_RIGHT TITLE_LOCATION_TOP_LEFT TITLE_LOCATION_TOP_RIGHT TITLE_LOCATION_BOTTOM_LEFT TITLE_LOCATION_BOTTOM_RIGHT
+ :type title_location: (enum)
+ :param relief: relief style. Values are same as other elements with reliefs. Choices include RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID
+ :type relief: (enum)
+ :param size: (width, height) (note this parameter may not always work)
+ :type size: Tuple[int, int]
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param border_width: width of border around element in pixels
+ :type border_width: (int)
+ :param key: Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
+ :type key: (any)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param right_click_menu: A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
+ :type right_click_menu: List[List[Union[List[str],str]]]
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param element_justification: All elements inside the Frame will have this justification 'left', 'right', 'center' are valid values
+ :type element_justification: (str)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.UseDictionary = False
@@ -3555,7 +4281,7 @@ class Frame(Element):
self.BorderWidth = border_width
self.BackgroundColor = background_color if background_color is not None else DEFAULT_BACKGROUND_COLOR
self.RightClickMenu = right_click_menu
- self.ContainerElemementNumber = Window.GetAContainerNumber()
+ self.ContainerElemementNumber = Window._GetAContainerNumber()
self.ElementJustification = element_justification
self.Layout(layout)
@@ -3567,13 +4293,45 @@ class Frame(Element):
"""
Not recommended user call. Used to add rows of Elements to the Frame Element.
- :param *args: List[Element] The list of elements for this row
+ :param *args: The list of elements for this row
+ :type *args: List[Element]
"""
NumRows = len(self.Rows) # number of existing rows is our row number
CurrentRowNumber = NumRows # this row's number
CurrentRow = [] # start with a blank row and build up
# ------------------------- Add the elements to a row ------------------------- #
for i, element in enumerate(args): # Loop through list of elements and add them to the row
+ if type(element) == list:
+ PopupError('Error creating Frame layout',
+ 'Layout has a LIST instead of an ELEMENT',
+ 'This means you have a badly placed ]',
+ 'The offensive list is:',
+ element,
+ 'This list will be stripped from your layout',
+ keep_on_top=True
+ )
+ continue
+ elif callable(element) and not isinstance(element, Element):
+ PopupError('Error creating Frame layout',
+ 'Layout has a FUNCTION instead of an ELEMENT',
+ 'This likely means you are missing () from your layout',
+ 'The offensive list is:',
+ element,
+ 'This item will be stripped from your layout',
+ keep_on_top=True)
+ continue
+ if element.ParentContainer is not None:
+ warnings.warn('*** YOU ARE ATTEMPTING TO RESUSE AN ELEMENT IN YOUR LAYOUT! Once placed in a layout, an element cannot be used in another layout. ***', UserWarning)
+ PopupError('Error creating Frame layout',
+ 'The layout specified has already been used',
+ 'You MUST start witha "clean", unused layout every time you create a window',
+ 'The offensive Element = ',
+ element,
+ 'and has a key = ', element.Key,
+ 'This item will be stripped from your layout',
+ 'Hint - try printing your layout and matching the IDs "print(layout)"',
+ obj_to_string_single_obj(element), keep_on_top=True)
+ continue
element.Position = (CurrentRowNumber, i)
element.ParentContainer = self
CurrentRow.append(element)
@@ -3586,11 +4344,23 @@ class Frame(Element):
"""
Can use like the Window.Layout method, but it's better to use the layout parameter when creating
- :param rows: List[List[Element]] The rows of Elements
- :return: (Frame) Used for chaining
+ :param rows: The rows of Elements
+ :type rows: List[List[Element]]
+ :return: Used for chaining
+ :rtype: (Frame)
"""
for row in rows:
+ try:
+ iter(row)
+ except TypeError:
+ PopupError('Error creating Frame layout',
+ 'Your row is not an iterable (e.g. a list)',
+ 'Instead of a list, the type found was {}'.format(type(row)),
+ 'The offensive row = ',
+ row,
+ 'This item will be stripped from your layout', keep_on_top=True)
+ continue
self.AddRow(*row)
return self
@@ -3598,8 +4368,10 @@ class Frame(Element):
"""
Not user callable. Used to find the Element at a row, col position within the layout
- :param location: Tuple[int, int] (row, column) position of the element to find in layout
+ :param location: (row, column) position of the element to find in layout
+ :type location: Tuple[int, int]
:return: (Element) The element found at the location
+ :rtype: (Element)
"""
(row_num, col_num) = location
@@ -3611,8 +4383,10 @@ class Frame(Element):
"""
Changes some of the settings for the Frame Element. Must call `Window.Read` or `Window.Finalize` prior
- :param value: (Any) New text value to show on frame
- :param visible: (bool) control visibility of element
+ :param value: New text value to show on frame
+ :type value: (Any)
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self.Widget is None:
warnings.warn('You cannot Update element with key = {} until the window has been Read or Finalized'.format(self.Key), UserWarning)
@@ -3620,7 +4394,7 @@ class Frame(Element):
if visible is False:
self.TKFrame.pack_forget()
elif visible is True:
- self.TKFrame.pack()
+ self.TKFrame.pack(padx=self.pad_used[0], pady=self.pad_used[1])
if value is not None:
self.TKFrame.config(text=str(value))
@@ -3642,7 +4416,8 @@ class VerticalSeparator(Element):
def __init__(self, pad=None):
"""
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
"""
self.Orientation = 'vertical' # for now only vertical works
@@ -3669,20 +4444,34 @@ class Tab(Element):
def __init__(self, title, layout, title_color=None, background_color=None, font=None, pad=None, disabled=False,
border_width=None, key=None, tooltip=None, right_click_menu=None, visible=True, element_justification='left', metadata=None):
"""
- :param title: (str) text to show on the tab
- :param layout: List[List[Element]] The element layout that will be shown in the tab
- :param title_color: (str) color of the tab text (note not currently working on tkinter)
- :param background_color: (str) color of background of the entire layout
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param disabled: (bool) If True button will be created disabled
- :param border_width: (int) width of border around element in pixels
- :param key: (any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param right_click_menu: List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
- :param visible: (bool) set visibility state of the element
- :param element_justification: (str) All elements inside the Tab will have this justification 'left', 'right', 'center' are valid values
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param title: text to show on the tab
+ :type title: (str)
+ :param layout: The element layout that will be shown in the tab
+ :type layout: List[List[Element]]
+ :param title_color: color of the tab text (note not currently working on tkinter)
+ :type title_color: (str)
+ :param background_color: color of background of the entire layout
+ :type background_color: (str)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param disabled: If True button will be created disabled
+ :type disabled: (bool)
+ :param border_width: width of border around element in pixels
+ :type border_width: (int)
+ :param key: Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
+ :type key: (any)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param right_click_menu: A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
+ :type right_click_menu: List[List[Union[List[str],str]]]
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param element_justification: All elements inside the Tab will have this justification 'left', 'right', 'center' are valid values
+ :type element_justification: (str)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.UseDictionary = False
@@ -3700,7 +4489,7 @@ class Tab(Element):
self.TabID = None
self.BackgroundColor = background_color if background_color is not None else DEFAULT_BACKGROUND_COLOR
self.RightClickMenu = right_click_menu
- self.ContainerElemementNumber = Window.GetAContainerNumber()
+ self.ContainerElemementNumber = Window._GetAContainerNumber()
self.ElementJustification = element_justification
self.Layout(layout)
@@ -3713,13 +4502,42 @@ class Tab(Element):
"""
Not recommended use call. Used to add rows of Elements to the Frame Element.
- :param *args: List[Element] The list of elements for this row
+ :param *args: The list of elements for this row
+ :type *args: List[Element]
"""
NumRows = len(self.Rows) # number of existing rows is our row number
CurrentRowNumber = NumRows # this row's number
CurrentRow = [] # start with a blank row and build up
# ------------------------- Add the elements to a row ------------------------- #
for i, element in enumerate(args): # Loop through list of elements and add them to the row
+ if type(element) == list:
+ PopupError('Error creating Tab layout',
+ 'Layout has a LIST instead of an ELEMENT',
+ 'This means you have a badly placed ]',
+ 'The offensive list is:',
+ element,
+ 'This list will be stripped from your layout' , keep_on_top=True
+ )
+ continue
+ elif callable(element) and not isinstance(element, Element):
+ PopupError('Error creating Tab layout',
+ 'Layout has a FUNCTION instead of an ELEMENT',
+ 'This likely means you are missing () from your layout',
+ 'The offensive list is:',
+ element,
+ 'This item will be stripped from your layout', keep_on_top=True)
+ continue
+ if element.ParentContainer is not None:
+ warnings.warn('*** YOU ARE ATTEMPTING TO RESUSE AN ELEMENT IN YOUR LAYOUT! Once placed in a layout, an element cannot be used in another layout. ***', UserWarning)
+ PopupError('Error creating Tab layout',
+ 'The layout specified has already been used',
+ 'You MUST start witha "clean", unused layout every time you create a window',
+ 'The offensive Element = ',
+ element,
+ 'and has a key = ', element.Key,
+ 'This item will be stripped from your layout',
+ 'Hint - try printing your layout and matching the IDs "print(layout)"', keep_on_top=True)
+ continue
element.Position = (CurrentRowNumber, i)
element.ParentContainer = self
CurrentRow.append(element)
@@ -3737,15 +4555,28 @@ class Tab(Element):
"""
for row in rows:
+ try:
+ iter(row)
+ except TypeError:
+ PopupError('Error creating Tab layout',
+ 'Your row is not an iterable (e.g. a list)',
+ 'Instead of a list, the type found was {}'.format(type(row)),
+ 'The offensive row = ',
+ row,
+ 'This item will be stripped from your layout', keep_on_top=True)
+ continue
self.AddRow(*row)
return self
+
def Update(self, disabled=None, visible=None): # TODO Disable / enable of tabs is not complete
"""
Changes some of the settings for the Tab Element. Must call `Window.Read` or `Window.Finalize` prior
- :param disabled: (bool) disable or enable state of the element
- :param visible: (bool) control visibility of element
+ :param disabled: disable or enable state of the element
+ :type disabled: (bool)
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self.Widget is None:
warnings.warn('You cannot Update element with key = {} until the window has been Read or Finalized'.format(self.Key), UserWarning)
@@ -3768,8 +4599,10 @@ class Tab(Element):
"""
Not user callable. Used to find the Element at a row, col position within the layout
- :param location: Tuple[int, int] (row, column) position of the element to find in layout
- :return: (Element) The element found at the location
+ :param location: (row, column) position of the element to find in layout
+ :type location: Tuple[int, int]
+ :return: The element found at the location
+ :rtype: (Element)
"""
(row_num, col_num) = location
@@ -3809,23 +4642,40 @@ class TabGroup(Element):
font=None, change_submits=False, enable_events=False, pad=None, border_width=None, theme=None,
key=None, tooltip=None, visible=True, metadata=None):
"""
- :param layout: List[List[Tab]] Layout of Tabs. Different than normal layouts. ALL Tabs should be on first row
- :param tab_location: (str) location that tabs will be displayed. Choices are left, right, top, bottom, lefttop, leftbottom, righttop, rightbottom, bottomleft, bottomright, topleft, topright
- :param title_color: (str) color of text on tabs
- :param tab_background_color: (str) color of all tabs that are not selected
- :param selected_title_color: (str) color of tab text when it is selected
- :param selected_background_color: (str) color of tab when it is selected
- :param background_color: (str) color of background area that tabs are located on
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param change_submits: (bool) * DEPRICATED DO NOT USE! Same as enable_events
- :param enable_events: (bool) If True then switching tabs will generate an Event
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param border_width: (int) width of border around element in pixels
- :param theme: (enum) DEPRICATED - You can only specify themes using set options or when window is created. It's not possible to do it on an element basis
- :param key: (any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param layout: Layout of Tabs. Different than normal layouts. ALL Tabs should be on first row
+ :type layout: List[List[Tab]]
+ :param tab_location: location that tabs will be displayed. Choices are left, right, top, bottom, lefttop, leftbottom, righttop, rightbottom, bottomleft, bottomright, topleft, topright
+ :type tab_location: (str)
+ :param title_color: color of text on tabs
+ :type title_color: (str)
+ :param tab_background_color: color of all tabs that are not selected
+ :type tab_background_color: (str)
+ :param selected_title_color: color of tab text when it is selected
+ :type selected_title_color: (str)
+ :param selected_background_color: color of tab when it is selected
+ :type selected_background_color: (str)
+ :param background_color: color of background area that tabs are located on
+ :type background_color: (str)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param change_submits: * DEPRICATED DO NOT USE! Same as enable_events
+ :type change_submits: (bool)
+ :param enable_events: If True then switching tabs will generate an Event
+ :type enable_events: (bool)
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param border_width: width of border around element in pixels
+ :type border_width: (int)
+ :param theme: DEPRICATED - You can only specify themes using set options or when window is created. It's not possible to do it on an element basis
+ :type theme: (enum)
+ :param key: Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
+ :type key: (any)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.UseDictionary = False
@@ -3859,7 +4709,8 @@ class TabGroup(Element):
"""
Not recommended user call. Used to add rows of Elements to the Frame Element.
- :param *args: List[Element] The list of elements for this row
+ :param *args: The list of elements for this row
+ :typeparam *args: List[Element]
"""
NumRows = len(self.Rows) # number of existing rows is our row number
@@ -3867,6 +4718,34 @@ class TabGroup(Element):
CurrentRow = [] # start with a blank row and build up
# ------------------------- Add the elements to a row ------------------------- #
for i, element in enumerate(args): # Loop through list of elements and add them to the row
+ if type(element) == list:
+ PopupError('Error creating Tab layout',
+ 'Layout has a LIST instead of an ELEMENT',
+ 'This means you have a badly placed ]',
+ 'The offensive list is:',
+ element,
+ 'This list will be stripped from your layout' , keep_on_top=True
+ )
+ continue
+ elif callable(element) and not isinstance(element, Element):
+ PopupError('Error creating Tab layout',
+ 'Layout has a FUNCTION instead of an ELEMENT',
+ 'This likely means you are missing () from your layout',
+ 'The offensive list is:',
+ element,
+ 'This item will be stripped from your layout', keep_on_top=True)
+ continue
+ if element.ParentContainer is not None:
+ warnings.warn('*** YOU ARE ATTEMPTING TO RESUSE AN ELEMENT IN YOUR LAYOUT! Once placed in a layout, an element cannot be used in another layout. ***', UserWarning)
+ PopupError('Error creating Tab layout',
+ 'The layout specified has already been used',
+ 'You MUST start witha "clean", unused layout every time you create a window',
+ 'The offensive Element = ',
+ element,
+ 'and has a key = ', element.Key,
+ 'This item will be stripped from your layout',
+ 'Hint - try printing your layout and matching the IDs "print(layout)"', keep_on_top=True)
+ continue
element.Position = (CurrentRowNumber, i)
element.ParentContainer = self
CurrentRow.append(element)
@@ -3879,19 +4758,34 @@ class TabGroup(Element):
"""
Can use like the Window.Layout method, but it's better to use the layout parameter when creating
- :param rows: List[List[Element]] The rows of Elements
- :return: (Frame) Used for chaining
+ :param rows: The rows of Elements
+ :type rows: List[List[Element]]
+ :return: Used for chaining
+ :rtype: (Frame)
"""
for row in rows:
+ try:
+ iter(row)
+ except TypeError:
+ PopupError('Error creating Tab layout',
+ 'Your row is not an iterable (e.g. a list)',
+ 'Instead of a list, the type found was {}'.format(type(row)),
+ 'The offensive row = ',
+ row,
+ 'This item will be stripped from your layout', keep_on_top=True)
+ continue
self.AddRow(*row)
return self
+
def _GetElementAtLocation(self, location):
"""
Not user callable. Used to find the Element at a row, col position within the layout
- :param location: Tuple[int, int] (row, column) position of the element to find in layout
- :return: (Element) The element found at the location
+ :param location: (row, column) position of the element to find in layout
+ :type location: Tuple[int, int]
+ :return: The element found at the location
+ :rtype: (Element)
"""
(row_num, col_num) = location
@@ -3903,8 +4797,10 @@ class TabGroup(Element):
"""
Searches through the layout to find the key that matches the text on the tab. Implies names should be unique
- :param tab_name:
- :return: Union[key, None] Returns the key or None if no key found
+ :param tab_name: name of a tab
+ :type tab_name: str
+ :return: Returns the key or None if no key found
+ :rtype: Union[key, None]
"""
for row in self.Rows:
for element in row:
@@ -3919,7 +4815,8 @@ class TabGroup(Element):
Note that this is exactly the same data that would be returned from a call to Window.Read. Are you sure you
are using this method correctly?
- :return: Union[Any, None] The key of the currently selected tab or the tab's text if it has no key
+ :return: The key of the currently selected tab or the tab's text if it has no key
+ :rtype: Union[Any, None]
"""
try:
@@ -3952,33 +4849,46 @@ class Slider(Element):
enable_events=False, disabled=False, size=(None, None), font=None, background_color=None,
text_color=None, key=None, pad=None, tooltip=None, visible=True, metadata=None):
"""
-
- :param range: Union[Tuple[int, int], Tuple[float, float]] slider's range (min value, max value)
- :param default_value: Union[int, float] starting value for the slider
- :param resolution: Union[int, float] the smallest amount the slider can be moved
- :param tick_interval: Union[int, float] how often a visible tick should be shown next to slider
- :param orientation: (str) 'horizontal' or 'vertical' ('h' or 'v' also work)
- :param disable_number_display: (bool) if True no number will be displayed by the Slider Element
- :param border_width: (int) width of border around element in pixels
- :param relief: (enum) relief style.
- RELIEF_RAISED
- RELIEF_SUNKEN
- RELIEF_FLAT
- RELIEF_RIDGE
- RELIEF_GROOVE
- RELIEF_SOLID
- :param change_submits: (bool) * DEPRICATED DO NOT USE! Same as enable_events
- :param enable_events: (bool) If True then moving the slider will generate an Event
- :param disabled: (bool) set disable state for element
- :param size: Tuple[int, int] (width in characters, height in rows)
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param background_color: (str) color of slider's background
- :param text_color: (str) color of the slider's text
- :param key: (any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param range: slider's range (min value, max value)
+ :type range: Union[Tuple[int, int], Tuple[float, float]]
+ :param default_value: starting value for the slider
+ :type default_value: Union[int, float]
+ :param resolution: the smallest amount the slider can be moved
+ :type resolution: Union[int, float]
+ :param tick_interval: how often a visible tick should be shown next to slider
+ :type tick_interval: Union[int, float]
+ :param orientation: 'horizontal' or 'vertical' ('h' or 'v' also work)
+ :type orientation: (str)
+ :param disable_number_display: if True no number will be displayed by the Slider Element
+ :type disable_number_display: (bool)
+ :param border_width: width of border around element in pixels
+ :type border_width: (int)
+ :param relief: relief style. RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID
+ :type relief: (enum)
+ :param change_submits: * DEPRICATED DO NOT USE! Same as enable_events
+ :type change_submits: (bool)
+ :param enable_events: If True then moving the slider will generate an Event
+ :type enable_events: (bool)
+ :param disabled: set disable state for element
+ :type disabled: (bool)
+ :param size: (w=characters-wide, h=rows-high)
+ :type size: Tuple[int, int]
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param background_color: color of slider's background
+ :type background_color: (str)
+ :param text_color: color of the slider's text
+ :type text_color: (str)
+ :param key: Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
+ :type key: (any)
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.TKScale = self.Widget = None # type: tk.Scale
@@ -4005,11 +4915,14 @@ class Slider(Element):
"""
Changes some of the settings for the Slider Element. Must call `Window.Read` or `Window.Finalize` prior
- :param value: Union[int, float] sets current slider value
- :param range: Union[Tuple[int, int], Tuple[float, float] Sets a new range for slider
- :param disabled: (bool) disable or enable state of the element
- :param visible: (bool) control visibility of element
-
+ :param value: sets current slider value
+ :type value: Union[int, float]
+ :param range: Sets a new range for slider
+ :type range: Union[Tuple[int, int], Tuple[float, float]
+ :param disabled: disable or enable state of the element
+ :type disabled: (bool)
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self.Widget is None:
warnings.warn('You cannot Update element with key = {} until the window has been Read or Finalized'.format(self.Key), UserWarning)
@@ -4027,7 +4940,7 @@ class Slider(Element):
if visible is False:
self.TKScale.pack_forget()
elif visible is True:
- self.TKScale.pack()
+ self.TKScale.pack(padx=self.pad_used[0], pady=self.pad_used[1])
if range != (None, None):
self.TKScale.config(from_=range[0], to_=range[1])
@@ -4062,6 +4975,7 @@ class TkFixedFrame(tk.Frame):
def __init__(self, master, **kwargs):
"""
:param master: (tk.Widget) The parent widget
+ :type master: (tk.Widget)
:param **kwargs: The keyword args
"""
tk.Frame.__init__(self, master, **kwargs)
@@ -4092,10 +5006,10 @@ class TkScrollableFrame(tk.Frame):
def __init__(self, master, vertical_only, **kwargs):
"""
-
- :param master: (tk.Widget) The parent widget
- :param vertical_only: (bool) if True the only a vertical scrollbar will be shown
- :param **kwargs: The keyword parms
+ :param master: The parent widget
+ :type master: (tk.Widget)
+ :param vertical_only: if True the only a vertical scrollbar will be shown
+ :type vertical_only: (bool)
"""
tk.Frame.__init__(self, master, **kwargs)
# create a canvas object and a vertical scrollbar for scrolling it
@@ -4148,42 +5062,21 @@ class TkScrollableFrame(tk.Frame):
# self.bind_mouse_scroll(self, self.yscroll)
def resize_frame(self, e):
- """
-
- :param e:
-
- """
self.canvas.itemconfig(self.frame_id, height=e.height, width=e.width)
def yscroll(self, event):
- """
-
- :param event:
-
- """
if event.num == 5 or event.delta < 0:
self.canvas.yview_scroll(1, "unit")
elif event.num == 4 or event.delta > 0:
self.canvas.yview_scroll(-1, "unit")
def xscroll(self, event):
- """
-
- :param event:
-
- """
if event.num == 5 or event.delta < 0:
self.canvas.xview_scroll(1, "unit")
elif event.num == 4 or event.delta > 0:
self.canvas.xview_scroll(-1, "unit")
def bind_mouse_scroll(self, parent, mode):
- """
-
- :param parent:
- :param mode:
-
- """
# ~~ Windows only
parent.bind("", mode)
# ~~ Unix only
@@ -4191,11 +5084,7 @@ class TkScrollableFrame(tk.Frame):
parent.bind("", mode)
def set_scrollregion(self, event=None):
- """Set the scroll region on the canvas
-
- :param event:
-
- """
+ """ Set the scroll region on the canvas """
self.canvas.configure(scrollregion=self.canvas.bbox('all'))
@@ -4210,19 +5099,30 @@ class Column(Element):
def __init__(self, layout, background_color=None, size=(None, None), pad=None, scrollable=False,
vertical_scroll_only=False, right_click_menu=None, key=None, visible=True, justification='left', element_justification='left', metadata=None):
"""
- :param layout: List[List[Element]] Layout that will be shown in the Column container
- :param background_color: (str) color of background of entire Column
- :param size: Tuple[int, int] (width, height) size in pixels (doesn't work quite right, sometimes
- only 1 dimension is set by tkinter
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param scrollable: (bool) if True then scrollbars will be added to the column
- :param vertical_scroll_only: (bool) if Truen then no horizontal scrollbar will be shown
- :param right_click_menu: List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
- :param key: (any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
- :param visible: (bool) set visibility state of the element
- :param justification: (str) set justification for the Column itself. Note entire row containing the Column will be affected
- :param element_justification: (str) All elements inside the Column will have this justification 'left', 'right', 'center' are valid values
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param layout: Layout that will be shown in the Column container
+ :type layout: List[List[Element]]
+ :param background_color: color of background of entire Column
+ :type background_color: (str)
+ :param size: (width, height) size in pixels (doesn't work quite right, sometimes only 1 dimension is set by tkinter
+ :type size: Tuple[int, int]
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param scrollable: if True then scrollbars will be added to the column
+ :type scrollable: (bool)
+ :param vertical_scroll_only: if Truen then no horizontal scrollbar will be shown
+ :type vertical_scroll_only: (bool)
+ :param right_click_menu: A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
+ :type right_click_menu: List[List[Union[List[str],str]]]
+ :param key: Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
+ :type key: (any)
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param justification: set justification for the Column itself. Note entire row containing the Column will be affected
+ :type justification: (str)
+ :param element_justification: All elements inside the Column will have this justification 'left', 'right', 'center' are valid values
+ :type element_justification: (str)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.UseDictionary = False
@@ -4239,7 +5139,7 @@ class Column(Element):
self.VerticalScrollOnly = vertical_scroll_only
self.RightClickMenu = right_click_menu
bg = background_color if background_color is not None else DEFAULT_BACKGROUND_COLOR
- self.ContainerElemementNumber = Window.GetAContainerNumber()
+ self.ContainerElemementNumber = Window._GetAContainerNumber()
self.ElementJustification = element_justification
self.Justification = justification
self.Layout(layout)
@@ -4251,7 +5151,8 @@ class Column(Element):
"""
Not recommended user call. Used to add rows of Elements to the Column Element.
- :param *args: List[Element] The list of elements for this row
+ :param *args: The list of elements for this row
+ :type *args: List[Element]
"""
NumRows = len(self.Rows) # number of existing rows is our row number
@@ -4259,6 +5160,34 @@ class Column(Element):
CurrentRow = [] # start with a blank row and build up
# ------------------------- Add the elements to a row ------------------------- #
for i, element in enumerate(args): # Loop through list of elements and add them to the row
+ if type(element) == list:
+ PopupError('Error creating Column layout',
+ 'Layout has a LIST instead of an ELEMENT',
+ 'This means you have a badly placed ]',
+ 'The offensive list is:',
+ element,
+ 'This list will be stripped from your layout' , keep_on_top=True
+ )
+ continue
+ elif callable(element) and not isinstance(element, Element):
+ PopupError('Error creating Column layout',
+ 'Layout has a FUNCTION instead of an ELEMENT',
+ 'This likely means you are missing () from your layout',
+ 'The offensive list is:',
+ element,
+ 'This item will be stripped from your layout', keep_on_top=True)
+ continue
+ if element.ParentContainer is not None:
+ warnings.warn('*** YOU ARE ATTEMPTING TO RESUSE AN ELEMENT IN YOUR LAYOUT! Once placed in a layout, an element cannot be used in another layout. ***', UserWarning)
+ PopupError('Error creating Column layout',
+ 'The layout specified has already been used',
+ 'You MUST start witha "clean", unused layout every time you create a window',
+ 'The offensive Element = ',
+ element,
+ 'and has a key = ', element.Key,
+ 'This item will be stripped from your layout',
+ 'Hint - try printing your layout and matching the IDs "print(layout)"', keep_on_top=True)
+ continue
element.Position = (CurrentRowNumber, i)
element.ParentContainer = self
CurrentRow.append(element)
@@ -4271,20 +5200,35 @@ class Column(Element):
"""
Can use like the Window.Layout method, but it's better to use the layout parameter when creating
- :param rows: List[List[Element]] The rows of Elements
- :return: (Column) Used for chaining
+ :param rows: The rows of Elements
+ :type rows: List[List[Element]]
+ :return: Used for chaining
+ :rtype: (Column)
"""
for row in rows:
+ try:
+ iter(row)
+ except TypeError:
+ PopupError('Error creating Column layout',
+ 'Your row is not an iterable (e.g. a list)',
+ 'Instead of a list, the type found was {}'.format(type(row)),
+ 'The offensive row = ',
+ row,
+ 'This item will be stripped from your layout', keep_on_top=True)
+ continue
self.AddRow(*row)
return self
+
def _GetElementAtLocation(self, location):
"""
Not user callable. Used to find the Element at a row, col position within the layout
- :param location: Tuple[int, int] (row, column) position of the element to find in layout
- :return: (Element) The element found at the location
+ :param location: (row, column) position of the element to find in layout
+ :typeparam location: Tuple[int, int]
+ :return: The element found at the location
+ :rtype: (Element)
"""
(row_num, col_num) = location
@@ -4296,7 +5240,8 @@ class Column(Element):
"""
Changes some of the settings for the Column Element. Must call `Window.Read` or `Window.Finalize` prior
- :param visible: (bool) control visibility of element
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self.Widget is None:
warnings.warn('You cannot Update element with key = {} until the window has been Read or Finalized'.format(self.Key), UserWarning)
@@ -4308,7 +5253,7 @@ class Column(Element):
self.ParentPanedWindow.remove(self.TKColFrame)
elif visible is True:
if self.TKColFrame:
- self.TKColFrame.pack()
+ self.TKColFrame.pack(padx=self.pad_used[0], pady=self.pad_used[1])
if self.ParentPanedWindow:
self.ParentPanedWindow.add(self.TKColFrame)
@@ -4333,24 +5278,30 @@ class Pane(Element):
def __init__(self, pane_list, background_color=None, size=(None, None), pad=None, orientation='vertical',
show_handle=True, relief=RELIEF_RAISED, handle_size=None, border_width=None, key=None, visible=True, metadata=None):
"""
- :param pane_list: List[Column] Must be a list of Column Elements. Each Column supplied becomes one pane that's shown
- :param background_color: (str) color of background
- :param size: Tuple[int, int] (w,h) w=characters-wide, h=rows-high How much room to reserve for the Pane
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param orientation: (str) 'horizontal' or 'vertical' or ('h' or 'v'). Direction the Pane should slide
- :param show_handle: (bool) if True, the handle is drawn that makes it easier to grab and slide
- :param relief: (enum) relief style. Values are same as other elements that use relief values.
- RELIEF_RAISED
- RELIEF_SUNKEN
- RELIEF_FLAT
- RELIEF_RIDGE
- RELIEF_GROOVE
- RELIEF_SOLID
- :param handle_size: (int) Size of the handle in pixels
- :param border_width: (int) width of border around element in pixels
- :param key: (any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param pane_list: Must be a list of Column Elements. Each Column supplied becomes one pane that's shown
+ :type pane_list: List[Column]
+ :param background_color: color of background
+ :type background_color: (str)
+ :param size: (width, height) w=characters-wide, h=rows-high How much room to reserve for the Pane
+ :type size: Tuple[int, int]
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param orientation: 'horizontal' or 'vertical' or ('h' or 'v'). Direction the Pane should slide
+ :type orientation: (str)
+ :param show_handle: if True, the handle is drawn that makes it easier to grab and slide
+ :type show_handle: (bool)
+ :param relief: relief style. Values are same as other elements that use relief values. RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID
+ :type relief: (enum)
+ :param handle_size: Size of the handle in pixels
+ :type handle_size: (int)
+ :param border_width: width of border around element in pixels
+ :type border_width: (int)
+ :param key: Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
+ :type key: (any)
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.UseDictionary = False
@@ -4379,7 +5330,8 @@ class Pane(Element):
"""
Changes some of the settings for the Pane Element. Must call `Window.Read` or `Window.Finalize` prior
- :param visible: (bool) control visibility of element
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self.Widget is None:
warnings.warn('You cannot Update element with key = {} until the window has been Read or Finalized'.format(self.Key), UserWarning)
@@ -4387,7 +5339,7 @@ class Pane(Element):
if visible is False:
self.PanedWindow.pack_forget()
elif visible is True:
- self.PanedWindow.pack()
+ self.PanedWindow.pack(padx=self.pad_used[0], pady=self.pad_used[1])
set_focus = Element.SetFocus
set_tooltip = Element.SetTooltip
@@ -4408,19 +5360,7 @@ class TKCalendar(ttk.Frame):
timedelta = calendar.datetime.timedelta
def __init__(self, master=None, target_element=None, close_when_chosen=True, default_date=(None, None, None), **kw):
- """WIDGET-SPECIFIC OPTIONS
-
- locale, firstweekday, year, month, selectbackground,
- selectforeground
-
- :param master:
- :param target_element:
- :param close_when_chosen: (Default = True)
- :param default_date: (Default = (None))
- :param None:, None))
- :param **kw:
-
- """
+ """WIDGET-SPECIFIC OPTIONS: locale, firstweekday, year, month, selectbackground, selectforeground """
self._TargetElement = target_element
default_mon, default_day, default_year = default_date
# remove custom options from kw before initializating ttk.Frame
@@ -4459,12 +5399,6 @@ class TKCalendar(ttk.Frame):
self._build_calendar()
def __setitem__(self, item, value):
- """
-
- :param item:
- :param value:
-
- """
if item in ('year', 'month'):
raise AttributeError("attribute '%s' is not writeable" % item)
elif item == 'selectbackground':
@@ -4475,11 +5409,6 @@ class TKCalendar(ttk.Frame):
ttk.Frame.__setitem__(self, item, value)
def __getitem__(self, item):
- """
-
- :param item:
-
- """
if item in ('year', 'month'):
return getattr(self._date, item)
elif item == 'selectbackground':
@@ -4491,7 +5420,6 @@ class TKCalendar(ttk.Frame):
return r[item]
def __setup_styles(self):
- """ """
# custom ttk styles
style = ttk.Style(self.master)
arrow_layout = lambda dir: (
@@ -4501,7 +5429,6 @@ class TKCalendar(ttk.Frame):
style.layout('R.TButton', arrow_layout('right'))
def __place_widgets(self):
- """ """
# header frame and its widgets
hframe = ttk.Frame(self)
lbtn = ttk.Button(hframe, style='L.TButton', command=self._prev_month)
@@ -4518,7 +5445,6 @@ class TKCalendar(ttk.Frame):
self._calendar.pack(in_=self, expand=1, fill='both', side='bottom')
def __config_calendar(self):
- """ """
cols = self._cal.formatweekheader(3).split()
self._calendar['columns'] = cols
self._calendar.tag_configure('header', background='grey90')
@@ -4531,12 +5457,6 @@ class TKCalendar(ttk.Frame):
anchor='e')
def __setup_selection(self, sel_bg, sel_fg):
- """
-
- :param sel_bg:
- :param sel_fg:
-
- """
self._font = tkinter.font.Font()
self._canvas = canvas = tk.Canvas(self._calendar,
background=sel_bg, borderwidth=0, highlightthickness=0)
@@ -4547,17 +5467,11 @@ class TKCalendar(ttk.Frame):
self._calendar.bind('', self._pressed)
def __minsize(self, evt):
- """
-
- :param evt:
-
- """
width, height = self._calendar.master.geometry().split('x')
height = height[:height.index('+')]
self._calendar.master.minsize(width, height)
def _build_calendar(self):
- """ """
year, month = self._date.year, self._date.month
# update header text (Month, YEAR)
@@ -4572,12 +5486,7 @@ class TKCalendar(ttk.Frame):
self._calendar.item(item, values=fmt_week)
def _show_selection(self, text, bbox):
- """Configure canvas for a new selection.
-
- :param text:
- :param bbox:
-
- """
+ """ Configure canvas for a new selection. """
x, y, width, height = bbox
textw = self._font.measure(text)
@@ -4591,11 +5500,7 @@ class TKCalendar(ttk.Frame):
# Callbacks
def _pressed(self, evt):
- """Clicked somewhere in the calendar.
-
- :param evt:
-
- """
+ """ Clicked somewhere in the calendar. """
x, y, widget = evt.x, evt.y, evt.widget
item = widget.identify_row(y)
column = widget.identify_column(x)
@@ -4657,7 +5562,6 @@ class TKCalendar(ttk.Frame):
@property
def selection(self):
- """ """
if not self._selection:
return None
@@ -4686,17 +5590,25 @@ class Menu(Element):
menu is shown. The key portion is returned as part of the event.
"""
- def __init__(self, menu_definition, background_color=None, size=(None, None), tearoff=False, pad=None, key=None,
+ def __init__(self, menu_definition, background_color=None, size=(None, None), tearoff=False, font=None, pad=None, key=None,
visible=True, metadata=None):
"""
- :param menu_definition: List[List[Tuple[str, List[str]]]
- :param background_color: (str) color of the background
- :param size: Tuple[int, int] Not used in the tkinter port
- :param tearoff: (bool) if True, then can tear the menu off from the window ans use as a floating window. Very cool effect
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param key: (any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param menu_definition: ???
+ :type menu_definition: List[List[Tuple[str, List[str]]]
+ :param background_color: color of the background
+ :type background_color: (str)
+ :param size: Not used in the tkinter port
+ :type size: Tuple[int, int]
+ :param tearoff: if True, then can tear the menu off from the window ans use as a floating window. Very cool effect
+ :type tearoff: (bool)
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param key: Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window
+ :type key: (any)
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.BackgroundColor = background_color if background_color is not None else DEFAULT_BACKGROUND_COLOR
@@ -4706,14 +5618,15 @@ class Menu(Element):
self.MenuItemChosen = None
super().__init__(ELEM_TYPE_MENUBAR, background_color=background_color, size=size, pad=pad, key=key,
- visible=visible, metadata=metadata)
+ visible=visible, font=font, metadata=metadata)
return
def _MenuItemChosenCallback(self, item_chosen): # Menu Menu Item Chosen Callback
"""
Not user callable. Called when some end-point on the menu (an item) has been clicked. Send the information back to the application as an event. Before event can be sent
- :param item_chosen: (str) the text that was clicked on / chosen from the menu
+ :param item_chosen: the text that was clicked on / chosen from the menu
+ :type item_chosen: (str)
"""
# print('IN MENU ITEM CALLBACK', item_chosen)
self.MenuItemChosen = item_chosen
@@ -4726,8 +5639,10 @@ class Menu(Element):
"""
Update a menubar - can change the menu definition and visibility. The entire menu has to be specified
- :param menu_definition: List[List[Tuple[str, List[str]]]
- :param visible: (bool) control visibility of element
+ :param menu_definition: ???
+ :type menu_definition: List[List[Tuple[str, List[str]]]
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self.Widget is None:
warnings.warn('You cannot Update element with key = {} until the window has been Read or Finalized'.format(self.Key), UserWarning)
@@ -4770,7 +5685,6 @@ MenuBar = Menu # another name for Menu to make it clear it's the Menu Bar
# Table #
# ---------------------------------------------------------------------- #
class Table(Element):
- """ """
def __init__(self, values, headings=None, visible_column_map=None, col_widths=None, def_col_width=10,
auto_size_columns=True, max_col_width=20, select_mode=None, display_row_numbers=False, num_rows=None,
@@ -4779,41 +5693,70 @@ class Table(Element):
size=(None, None), change_submits=False, enable_events=False, bind_return_key=False, pad=None,
key=None, tooltip=None, right_click_menu=None, visible=True, metadata=None):
"""
- :param values: List[List[Union[str, int, float]]]
- :param headings: List[str] The headings to show on the top line
- :param visible_column_map: List[bool] One entry for each column. False indicates the column is not shown
- :param col_widths: List[int] Number of characters that each column will occupy
- :param def_col_width: (int) Default column width in characters
- :param auto_size_columns: (bool) if True columns will be sized automatically
- :param max_col_width: (int) Maximum width for all columns in characters
- :param select_mode: (enum) Select Mode. Valid values start with "TABLE_SELECT_MODE_". Valid values are:
- TABLE_SELECT_MODE_NONE
- TABLE_SELECT_MODE_BROWSE
- TABLE_SELECT_MODE_EXTENDED
- :param display_row_numbers: (bool) if True, the first column of the table will be the row #
- :param num_rows: (int) The number of rows of the table to display at a time
- :param row_height: (int) height of a single row in pixels
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param justification: (str) 'left', 'right', 'center' are valid choices
- :param text_color: (str) color of the text
- :param background_color: (str) color of background
- :param alternating_row_color: (str) if set then every other row will have this color in the background.
- :param header_text_color: (str) sets the text color for the header
- :param header_background_color: (str) sets the background color for the header
- :param header_font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param row_colors: List[Union[Tuple[int, str], Tuple[Int, str, str]] list of tuples of (row, background color) OR (row, foreground color, background color). Sets the colors of listed rows to the color(s) provided (note the optional foreground color)
- :param vertical_scroll_only: (bool) if True only the vertical scrollbar will be visible
- :param hide_vertical_scroll: (bool) if True vertical scrollbar will be hidden
- :param size: Tuple[int, int] DO NOT USE! Use num_rows instead
- :param change_submits: (bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead
- :param enable_events: (bool) Turns on the element specific events. Table events happen when row is clicked
- :param bind_return_key: (bool) if True, pressing return key will cause event coming from Table, ALSO a left button double click will generate an event if this parameter is True
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param right_click_menu: List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param values: ???
+ :type values: List[List[Union[str, int, float]]]
+ :param headings: The headings to show on the top line
+ :type headings: List[str]
+ :param visible_column_map: One entry for each column. False indicates the column is not shown
+ :type visible_column_map: List[bool]
+ :param col_widths: Number of characters that each column will occupy
+ :type col_widths: List[int]
+ :param def_col_width: Default column width in characters
+ :type def_col_width: (int)
+ :param auto_size_columns: if True columns will be sized automatically
+ :type auto_size_columns: (bool)
+ :param max_col_width: Maximum width for all columns in characters
+ :type max_col_width: (int)
+ :param select_mode: Select Mode. Valid values start with "TABLE_SELECT_MODE_". Valid values are: TABLE_SELECT_MODE_NONE TABLE_SELECT_MODE_BROWSE TABLE_SELECT_MODE_EXTENDED
+ :type select_mode: (enum)
+ :param display_row_numbers: if True, the first column of the table will be the row #
+ :type display_row_numbers: (bool)
+ :param num_rows: The number of rows of the table to display at a time
+ :type num_rows: (int)
+ :param row_height: height of a single row in pixels
+ :type row_height: (int)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param justification: 'left', 'right', 'center' are valid choices
+ :type justification: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param background_color: color of background
+ :type background_color: (str)
+ :param alternating_row_color: if set then every other row will have this color in the background.
+ :type alternating_row_color: (str)
+ :param header_text_color: sets the text color for the header
+ :type header_text_color: (str)
+ :param header_background_color: sets the background color for the header
+ :type header_background_color: (str)
+ :param header_font: specifies the font family, size, etc
+ :type header_font: Union[str, Tuple[str, int]]
+ :param row_colors: list of tuples of (row, background color) OR (row, foreground color, background color). Sets the colors of listed rows to the color(s) provided (note the optional foreground color)
+ :type row_colors: List[Union[Tuple[int, str], Tuple[Int, str, str]]
+ :param vertical_scroll_only: if True only the vertical scrollbar will be visible
+ :type vertical_scroll_only: (bool)
+ :param hide_vertical_scroll: if True vertical scrollbar will be hidden
+ :type hide_vertical_scroll: (bool)
+ :param size: DO NOT USE! Use num_rows instead
+ :type size: Tuple[int, int]
+ :param change_submits: DO NOT USE. Only listed for backwards compat - Use enable_events instead
+ :type change_submits: (bool)
+ :param enable_events: Turns on the element specific events. Table events happen when row is clicked
+ :type enable_events: (bool)
+ :param bind_return_key: if True, pressing return key will cause event coming from Table, ALSO a left button double click will generate an event if this parameter is True
+ :type bind_return_key: (bool)
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param key: Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
+ :type key: (Any)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param right_click_menu: A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
+ :type right_click_menu: List[List[Union[List[str],str]]]
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.Values = values
@@ -4854,12 +5797,18 @@ class Table(Element):
"""
Changes some of the settings for the Table Element. Must call `Window.Read` or `Window.Finalize` prior
- :param values: List[List[Union[str, int, float]]] A new 2-dimensional table to show
- :param num_rows: (int) How many rows to display at a time
- :param visible: (bool) if True then will be visible
- :param select_rows: List[int] List of rows to select as if user did
- :param alternating_row_color: (str) the color to make every other row
- :param row_colors: List[Union[Tuple[int, str], Tuple[Int, str, str]] list of tuples of (row, background color) OR (row, foreground color, background color). Changes the colors of listed rows to the color(s) provided (note the optional foreground color)
+ :param values: A new 2-dimensional table to show
+ :type values: List[List[Union[str, int, float]]]
+ :param num_rows: How many rows to display at a time
+ :type num_rows: (int)
+ :param visible: if True then will be visible
+ :type visible: (bool)
+ :param select_rows: List of rows to select as if user did
+ :type select_rows: List[int]
+ :param alternating_row_color: the color to make every other row
+ :type alternating_row_color: (str)
+ :param row_colors: list of tuples of (row, background color) OR (row, foreground color, background color). Changes the colors of listed rows to the color(s) provided (note the optional foreground color)
+ :type row_colors: List[Union[Tuple[int, str], Tuple[Int, str, str]]
"""
if self.Widget is None:
warnings.warn('You cannot Update element with key = {} until the window has been Read or Finalized'.format(self.Key), UserWarning)
@@ -4897,7 +5846,7 @@ class Table(Element):
if visible is False:
self.TKTreeview.pack_forget()
elif visible is True:
- self.TKTreeview.pack()
+ self.TKTreeview.pack(padx=self.pad_used[0], pady=self.pad_used[1])
if num_rows is not None:
self.TKTreeview.config(height=num_rows)
if select_rows is not None:
@@ -4918,7 +5867,7 @@ class Table(Element):
else:
self.TKTreeview.tag_configure(row_def[0], background=row_def[2], foreground=row_def[1])
- def treeview_selected(self, event):
+ def _treeview_selected(self, event):
"""
Not user callable. Callback function that is called when something is selected from Table.
Stores the selected rows in Element as they are being selected. If events enabled, then returns from Read
@@ -4936,7 +5885,7 @@ class Table(Element):
if self.ParentForm.CurrentlyRunningMainloop:
self.ParentForm.TKroot.quit()
- def treeview_double_click(self, event):
+ def _treeview_double_click(self, event):
"""
Not user callable. Callback function that is called when something is selected from Table.
Stores the selected rows in Element as they are being selected. If events enabled, then returns from Read
@@ -4960,7 +5909,8 @@ class Table(Element):
edited. Don't know yet how to enable editing of a Tree in tkinter so just returning the values provided by
user when Table was created or Updated.
- :return: List[List[Any]] the current table values (for now what was originally provided up updated)
+ :return: the current table values (for now what was originally provided up updated)
+ :rtype: List[List[Any]]
"""
return self.Values
@@ -4985,37 +5935,60 @@ class Tree(Element):
background_color=None, header_text_color=None, header_background_color=None, header_font=None, num_rows=None, row_height=None, pad=None, key=None, tooltip=None,
right_click_menu=None, visible=True, metadata=None):
"""
-
- :param data: (TreeData) The data represented using a PySimpleGUI provided TreeData class
- :param headings: List[str] List of individual headings for each column
- :param visible_column_map: List[bool] Determines if a column should be visible. If left empty, all columns will be shown
- :param col_widths: List[int] List of column widths so that individual column widths can be controlled
- :param col0_width: (int) Size of Column 0 which is where the row numbers will be optionally shown
- :param def_col_width: (int) default column width
- :param auto_size_columns: (bool) if True, the size of a column is determined using the contents of the column
- :param max_col_width: (int) the maximum size a column can be
- :param select_mode: (enum) Use same values as found on Table Element. Valid values include:
- TABLE_SELECT_MODE_NONE
- TABLE_SELECT_MODE_BROWSE
- TABLE_SELECT_MODE_EXTENDED
- :param show_expanded: (bool) if True then the tree will be initially shown with all nodes completely expanded
- :param change_submits: (bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead
- :param enable_events: (bool) Turns on the element specific events. Tree events happen when row is clicked
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param justification: (str) 'left', 'right', 'center' are valid choices
- :param text_color: (str) color of the text
- :param background_color: (str) color of background
- :param header_text_color: (str) sets the text color for the header
- :param header_background_color: (str) sets the background color for the header
- :param header_font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param num_rows: (int) The number of rows of the table to display at a time
- :param row_height: (int) height of a single row in pixels
- :param pad: (int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param right_click_menu: List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
- :param visible: (bool) set visibility state of the element
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param data: The data represented using a PySimpleGUI provided TreeData class
+ :type data: (TreeData)
+ :param headings: List of individual headings for each column
+ :type headings: List[str]
+ :param visible_column_map: Determines if a column should be visible. If left empty, all columns will be shown
+ :type visible_column_map: List[bool]
+ :param col_widths: List of column widths so that individual column widths can be controlled
+ :type col_widths: List[int]
+ :param col0_width: Size of Column 0 which is where the row numbers will be optionally shown
+ :type col0_width: (int)
+ :param def_col_width: default column width
+ :type def_col_width: (int)
+ :param auto_size_columns: if True, the size of a column is determined using the contents of the column
+ :type auto_size_columns: (bool)
+ :param max_col_width: the maximum size a column can be
+ :type max_col_width: (int)
+ :param select_mode: Use same values as found on Table Element. Valid values include: TABLE_SELECT_MODE_NONE TABLE_SELECT_MODE_BROWSE TABLE_SELECT_MODE_EXTENDED
+ :type select_mode: (enum)
+ :param show_expanded: if True then the tree will be initially shown with all nodes completely expanded
+ :type show_expanded: (bool)
+ :param change_submits: DO NOT USE. Only listed for backwards compat - Use enable_events instead
+ :type change_submits: (bool)
+ :param enable_events: Turns on the element specific events. Tree events happen when row is clicked
+ :type enable_events: (bool)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param justification: 'left', 'right', 'center' are valid choices
+ :type justification: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param background_color: color of background
+ :type background_color: (str)
+ :param header_text_color: sets the text color for the header
+ :type header_text_color: (str)
+ :param header_background_color: sets the background color for the header
+ :type header_background_color: (str)
+ :param header_font: specifies the font family, size, etc
+ :type header_font: Union[str, Tuple[str, int]]
+ :param num_rows: The number of rows of the table to display at a time
+ :type num_rows: (int)
+ :param row_height: height of a single row in pixels
+ :type row_height: (int)
+ :param pad: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type pad: (int, int) or ((int, int),(int,int))
+ :param key: Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element
+ :type key: (Any)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param right_click_menu: [Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
+ :type right_click_menu: List[List
+ :param visible: set visibility state of the element
+ :type visible: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.TreeData = data
@@ -5049,12 +6022,13 @@ class Tree(Element):
key=key, tooltip=tooltip, visible=visible, metadata=metadata)
return
- def treeview_selected(self, event):
+ def _treeview_selected(self, event):
"""
Not a user function. Callback function that happens when an item is selected from the tree. In this
method, it saves away the reported selections so they can be properly returned.
- :param event: (Any) An event parameter passed in by tkinter. Not used
+ :param event: An event parameter passed in by tkinter. Not used
+ :type event: (Any)
"""
selections = self.TKTreeview.selection()
@@ -5074,7 +6048,8 @@ class Tree(Element):
"""
Not a user function. Recursive method that inserts tree data into the tkinter treeview widget.
- :param node: (TreeData) The node to insert. Will insert all nodes from starting point downward, recursively
+ :param node: The node to insert. Will insert all nodes from starting point downward, recursively
+ :type node: (TreeData)
"""
if node.key != '':
if node.icon:
@@ -5103,12 +6078,18 @@ class Tree(Element):
"""
Changes some of the settings for the Tree Element. Must call `Window.Read` or `Window.Finalize` prior
- :param values: (TreeData) Representation of the tree
- :param key: (Any) identifies a particular item in tree to update
- :param value: (Any) sets the node identified by key to a particular value
- :param text: (str) sets the node identified by ket to this string
- :param icon: Union[bytes, str] can be either a base64 icon or a filename for the icon
- :param visible: (bool) control visibility of element
+ :param values: Representation of the tree
+ :type values: (TreeData)
+ :param key: identifies a particular item in tree to update
+ :type key: (Any)
+ :param value: sets the node identified by key to a particular value
+ :type value: (Any)
+ :param text: sets the node identified by ket to this string
+ :type text: (str)
+ :param icon: can be either a base64 icon or a filename for the icon
+ :type icon: Union[bytes, str]
+ :param visible: control visibility of element
+ :type visible: (bool)
"""
if self.Widget is None:
warnings.warn('You cannot Update element with key = {} until the window has been Read or Finalized'.format(self.Key), UserWarning)
@@ -5153,7 +6134,7 @@ class Tree(Element):
if visible is False:
self.TKTreeview.pack_forget()
elif visible is True:
- self.TKTreeview.pack()
+ self.TKTreeview.pack(padx=self.pad_used[0], pady=self.pad_used[1])
return self
set_focus = Element.SetFocus
@@ -5175,11 +6156,16 @@ class TreeData(object):
def __init__(self, parent, key, text, values, icon=None):
"""
- :param parent: (TreeData.Node) The parent Node
- :param key: (Any) Used to uniquely identify this node
- :param text: (str) The text that is displayed at this node's location
- :param values: List[Any] The list of values that are displayed at this node
- :param icon: Union[str, bytes]
+ :param parent: The parent Node
+ :type parent: (TreeData.Node)
+ :param key: Used to uniquely identify this node
+ :type key: (Any)
+ :param text: The text that is displayed at this node's location
+ :type text: (str)
+ :param values: The list of values that are displayed at this node
+ :type values: List[Any]
+ :param icon: just a icon
+ :type icon: Union[str, bytes]
"""
self.parent = parent # type: TreeData.Node
@@ -5190,11 +6176,6 @@ class TreeData(object):
self.icon = icon # type: Union[str, bytes]
def _Add(self, node):
- """
-
- :param node:
-
- """
self.children.append(node)
def __init__(self):
@@ -5209,8 +6190,10 @@ class TreeData(object):
"""
Adds a node to tree dictionary (not user callable)
- :param key: (str) Uniquely identifies this Node
- :param node: (TreeData.Node) Node being added
+ :param key: Uniquely identifies this Node
+ :type key: (str)
+ :param node: Node being added
+ :type node: (TreeData.Node)
"""
self.tree_dict[key] = node
@@ -5219,11 +6202,16 @@ class TreeData(object):
Inserts a node into the tree. This is how user builds their tree, by Inserting Nodes
This is the ONLY user callable method in the TreeData class
- :param parent: (Node) the parent Node
- :param key: (Any) Used to uniquely identify this node
- :param text: (str) The text that is displayed at this node's location
- :param values: List[Any] The list of values that are displayed at this node
- :param icon: Union[str, bytes]
+ :param parent: the parent Node
+ :type parent: (Node)
+ :param key: Used to uniquely identify this node
+ :type key: (Any)
+ :param text: The text that is displayed at this node's location
+ :type text: (str)
+ :param values: The list of values that are displayed at this node
+ :type values: List[Any]
+ :param icon: icon
+ :type icon: Union[str, bytes]
"""
node = self.Node(parent, key, text, values, icon)
@@ -5243,8 +6231,10 @@ class TreeData(object):
"""
Does the magic of converting the TreeData into a nicely formatted string version
- :param node: (TreeData.Node) The node to begin printing the tree
- :param level: (int) The indentation level for string formatting
+ :param node: The node to begin printing the tree
+ :type node: (TreeData.Node)
+ :param level: The indentation level for string formatting
+ :type level: (int)
"""
return '\n'.join(
[str(node.key) + ' : ' + str(node.text)] +
@@ -5273,24 +6263,31 @@ class ErrorElement(Element):
"""
Update method for the Error Element, an element that should not be directly used by developer
- :param silent_on_error: (bool) if False, then a Popup window will be shown
- :param *args: (Any) meant to "soak up" any normal parameters passed in
- :param **kwargs: (Any) meant to "soak up" any keyword parameters that were passed in
- :return: (ErrorElement) returns 'self' so call can be chained
+ :param silent_on_error: if False, then a Popup window will be shown
+ :type silent_on_error: (bool)
+ :param *args: meant to "soak up" any normal parameters passed in
+ :type *args: (Any)
+ :param **kwargs: meant to "soak up" any keyword parameters that were passed in
+ :type **kwargs: (Any)
+ :return: returns 'self' so call can be chained
+ :rtype: (ErrorElement)
"""
if not silent_on_error:
- PopupError('Keyword error in Update',
+ PopupError('Key error in Update',
'You need to stop this madness and check your spelling',
'Bad key = {}'.format(self.Key),
'Your bad line of code may resemble this:',
- 'window.FindElement("{}")'.format(self.Key))
+ 'window.FindElement("{}")'.format(self.Key),
+ 'or window["{}"]'.format(self.Key), keep_on_top=True
+ )
return self
def Get(self):
"""
One of the method names found in other Elements. Used here to return an error string in case it's called
- :return: (str) A warning text string.
+ :return: A warning text string.
+ :rtype: (str)
"""
return 'This is NOT a valid Element!\nSTOP trying to do things with it or I will have to crash at some point!'
@@ -5315,11 +6312,11 @@ class Window:
Represents a single Window
"""
NumOpenWindows = 0
- user_defined_icon = None
+ _user_defined_icon = None
hidden_master_root = None
- animated_popup_dict = {}
- container_element_counter = 0 # used to get a number of Container Elements (Frame, Column, Tab)
- read_call_from_debugger = False
+ _animated_popup_dict = {}
+ _container_element_counter = 0 # used to get a number of Container Elements (Frame, Column, Tab)
+ _read_call_from_debugger = False
def __init__(self, title, layout=None, default_element_size=DEFAULT_ELEMENT_SIZE,
default_button_element_size=(None, None),
@@ -5332,43 +6329,80 @@ class Window:
disable_minimize=False, right_click_menu=None, transparent_color=None, debugger_enabled=True,
finalize=False, element_justification='left', ttk_theme=None, use_ttk_buttons=None, metadata=None):
"""
- :param title: (str) The title that will be displayed in the Titlebar and on the Taskbar
- :param layout: List[List[Elements]] The layout for the window. Can also be specified in the Layout method
- :param default_element_size: Tuple[int, int] (width, height) size in characters (wide) and rows (high) for all elements in this window
- :param default_button_element_size: Tuple[int, int] (width, height) size in characters (wide) and rows (high) for all Button elements in this window
- :param auto_size_text: (bool) True if Elements in Window should be sized to exactly fir the length of text
- :param auto_size_buttons: (bool) True if Buttons in this Window should be sized to exactly fit the text on this.
- :param location: Tuple[int, int] (x,y) location, in pixels, to locate the upper left corner of the window on the screen. Default is to center on screen.
- :param size: Tuple[int, int] (width, height) size in pixels for this window. Normally the window is autosized to fit contents, not set to an absolute size by the user
- :param element_padding: Tuple[int, int] or ((int, int),(int,int)) Default amount of padding to put around elements in window (left/right, top/bottom) or ((left, right), (top, bottom))
- :param margins: Tuple[int, int] (left/right, top/bottom) Amount of pixels to leave inside the window's frame around the edges before your elements are shown.
- :param button_color: Tuple[str, str] (text color, button color) Default button colors for all buttons in the window
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param progress_bar_color: Tuple[str, str] (bar color, background color) Sets the default colors for all progress bars in the window
- :param background_color: (str) color of background
- :param border_depth: (int) Default border depth (width) for all elements in the window
- :param auto_close: (bool) If True, the window will automatically close itself
- :param auto_close_duration: (int) Number of seconds to wait before closing the window
- :param icon: Union[str, str] Can be either a filename or Base64 value.
- :param force_toplevel: (bool) If True will cause this window to skip the normal use of a hidden master window
- :param alpha_channel: (float) Sets the opacity of the window. 0 = invisible 1 = completely visible. Values bewteen 0 & 1 will produce semi-transparent windows in SOME environments (The Raspberry Pi always has this value at 1 and cannot change.
- :param return_keyboard_events: (bool) if True key presses on the keyboard will be returned as Events from Read calls
- :param use_default_focus: (bool) If True will use the default focus algorithm to set the focus to the "Correct" element
- :param text_justification: (str) Union ['left', 'right', 'center'] Default text justification for all Text Elements in window
- :param no_titlebar: (bool) If true, no titlebar nor frame will be shown on window. This means you cannot minimize the window and it will not show up on the taskbar
- :param grab_anywhere: (bool) If True can use mouse to click and drag to move the window. Almost every location of the window will work except input fields on some systems
- :param keep_on_top: (bool) If True, window will be created on top of all other windows on screen. It can be bumped down if another window created with this parm
- :param resizable: (bool) If True, allows the user to resize the window. Note the not all Elements will change size or location when resizing.
- :param disable_close: (bool) If True, the X button in the top right corner of the window will no work. Use with caution and always give a way out toyour users
- :param disable_minimize: (bool) if True the user won't be able to minimize window. Good for taking over entire screen and staying that way.
- :param right_click_menu: List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
- :param transparent_color: (str) Any portion of the window that has this color will be completely transparent. You can even click through these spots to the window under this window.
- :param debugger_enabled: (bool) If True then the internal debugger will be enabled
- :param finalize: (bool) If True then the Finalize method will be called. Use this rather than chaining .Finalize for cleaner code
- :param element_justification: (str) All elements in the Window itself will have this justification 'left', 'right', 'center' are valid values
- :param ttk_theme: (str) Set the tkinter ttk "theme" of the window. Default = DEFAULT_TTK_THEME. Sets all ttk widgets to this theme as their default
- :param use_ttk_buttons: (bool) Affects all buttons in window. True = use ttk buttons. False = do not use ttk buttons. None = use ttk buttons only if on a Mac
- :param metadata: (Any) User metadata that can be set to ANYTHING
+ :param title: The title that will be displayed in the Titlebar and on the Taskbar
+ :type title: (str)
+ :param layout: The layout for the window. Can also be specified in the Layout method
+ :type layout: List[List[Elements]]
+ :param default_element_size: (width, height) size in characters (wide) and rows (high) for all elements in this window
+ :type default_element_size: Tuple[int, int]
+ :param default_button_element_size: (width, height) size in characters (wide) and rows (high) for all Button elements in this window
+ :type default_button_element_size: Tuple[int, int]
+ :param auto_size_text: True if Elements in Window should be sized to exactly fir the length of text
+ :type auto_size_text: (bool)
+ :param auto_size_buttons: True if Buttons in this Window should be sized to exactly fit the text on this.
+ :type auto_size_buttons: (bool)
+ :param location: (x,y) location, in pixels, to locate the upper left corner of the window on the screen. Default is to center on screen.
+ :type location: Tuple[int, int]
+ :param size: (width, height) size in pixels for this window. Normally the window is autosized to fit contents, not set to an absolute size by the user
+ :type size: Tuple[int, int]
+ :param element_padding: Default amount of padding to put around elements in window (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type element_padding: Tuple[int, int] or ((int, int),(int,int))
+ :param margins: (left/right, top/bottom) Amount of pixels to leave inside the window's frame around the edges before your elements are shown.
+ :type margins: Tuple[int, int]
+ :param button_color: (text color, button color) Default button colors for all buttons in the window
+ :type button_color: Tuple[str, str]
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param progress_bar_color: (bar color, background color) Sets the default colors for all progress bars in the window
+ :type progress_bar_color: Tuple[str, str]
+ :param background_color: color of background
+ :type background_color: (str)
+ :param border_depth: Default border depth (width) for all elements in the window
+ :type border_depth: (int)
+ :param auto_close: If True, the window will automatically close itself
+ :type auto_close: (bool)
+ :param auto_close_duration: Number of seconds to wait before closing the window
+ :type auto_close_duration: (int)
+ :param icon: Can be either a filename or Base64 value. For Windows if filename, it MUST be ICO format. For Linux, must NOT be ICO
+ :type icon: Union[str, str]
+ :param force_toplevel: If True will cause this window to skip the normal use of a hidden master window
+ :type force_toplevel: (bool)
+ :param alpha_channel: Sets the opacity of the window. 0 = invisible 1 = completely visible. Values bewteen 0 & 1 will produce semi-transparent windows in SOME environments (The Raspberry Pi always has this value at 1 and cannot change.
+ :type alpha_channel: (float)
+ :param return_keyboard_events: if True key presses on the keyboard will be returned as Events from Read calls
+ :type return_keyboard_events: (bool)
+ :param use_default_focus: If True will use the default focus algorithm to set the focus to the "Correct" element
+ :type use_default_focus: (bool)
+ :param text_justification: Union ['left', 'right', 'center'] Default text justification for all Text Elements in window
+ :type text_justification: (str)
+ :param no_titlebar: If true, no titlebar nor frame will be shown on window. This means you cannot minimize the window and it will not show up on the taskbar
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True can use mouse to click and drag to move the window. Almost every location of the window will work except input fields on some systems
+ :type grab_anywhere: (bool)
+ :param keep_on_top: If True, window will be created on top of all other windows on screen. It can be bumped down if another window created with this parm
+ :type keep_on_top: (bool)
+ :param resizable: If True, allows the user to resize the window. Note the not all Elements will change size or location when resizing.
+ :type resizable: (bool)
+ :param disable_close: If True, the X button in the top right corner of the window will no work. Use with caution and always give a way out toyour users
+ :type disable_close: (bool)
+ :param disable_minimize: if True the user won't be able to minimize window. Good for taking over entire screen and staying that way.
+ :type disable_minimize: (bool)
+ :param right_click_menu: A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.
+ :type right_click_menu: List[List[Union[List[str],str]]]
+ :param transparent_color: Any portion of the window that has this color will be completely transparent. You can even click through these spots to the window under this window.
+ :type transparent_color: (str)
+ :param debugger_enabled: If True then the internal debugger will be enabled
+ :type debugger_enabled: (bool)
+ :param finalize: If True then the Finalize method will be called. Use this rather than chaining .Finalize for cleaner code
+ :type finalize: (bool)
+ :param element_justification: All elements in the Window itself will have this justification 'left', 'right', 'center' are valid values
+ :type element_justification: (str)
+ :param ttk_theme: Set the tkinter ttk "theme" of the window. Default = DEFAULT_TTK_THEME. Sets all ttk widgets to this theme as their default
+ :type ttk_theme: (str)
+ :param use_ttk_buttons: Affects all buttons in window. True = use ttk buttons. False = do not use ttk buttons. None = use ttk buttons only if on a Mac
+ :type use_ttk_buttons: (bool)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
"""
self.AutoSizeText = auto_size_text if auto_size_text is not None else DEFAULT_AUTOSIZE_TEXT
@@ -5387,8 +6421,8 @@ class Window:
self.BorderDepth = border_depth
if icon:
self.WindowIcon = icon
- elif Window.user_defined_icon is not None:
- self.WindowIcon = Window.user_defined_icon
+ elif Window._user_defined_icon is not None:
+ self.WindowIcon = Window._user_defined_icon
else:
self.WindowIcon = DEFAULT_WINDOW_ICON
self.AutoClose = auto_close
@@ -5430,7 +6464,7 @@ class Window:
self.ElementPadding = element_padding or DEFAULT_ELEMENT_PADDING
self.RightClickMenu = right_click_menu
self.Margins = margins if margins != (None, None) else DEFAULT_MARGINS
- self.ContainerElemementNumber = Window.GetAContainerNumber()
+ self.ContainerElemementNumber = Window._GetAContainerNumber()
self.AllKeysDict = {}
self.TransparentColor = transparent_color
self.UniqueKeyCounter = 0
@@ -5457,16 +6491,16 @@ class Window:
"If you seriously want this gray window and no more nagging, add change_look_and_feel('DefaultNoMoreNagging') ")
@classmethod
- def GetAContainerNumber(cls):
+ def _GetAContainerNumber(cls):
"""
Not user callable!
:return: A simple counter that makes each container element unique
"""
- cls.container_element_counter += 1
- return cls.container_element_counter
+ cls._container_element_counter += 1
+ return cls._container_element_counter
@classmethod
- def IncrementOpenCount(self):
+ def _IncrementOpenCount(self):
"""
Not user callable! Increments the number of open windows
Note - there is a bug where this count easily gets out of sync. Issue has been opened already. No ill effects
@@ -5475,7 +6509,7 @@ class Window:
# print('+++++ INCREMENTING Num Open Windows = {} ---'.format(Window.NumOpenWindows))
@classmethod
- def DecrementOpenCount(self):
+ def _DecrementOpenCount(self):
"""
Not user callable! Decrements the number of open windows
"""
@@ -5510,31 +6544,32 @@ class Window:
# ------------------------- Add the elements to a row ------------------------- #
for i, element in enumerate(args): # Loop through list of elements and add them to the row
if type(element) == list:
- PopupError('Error creating layout',
+ PopupError('Error creating Window layout',
'Layout has a LIST instead of an ELEMENT',
'This means you have a badly placed ]',
'The offensive list is:',
element,
- 'This list will be stripped from your layout'
+ 'This list will be stripped from your layout' , keep_on_top=True
)
continue
elif callable(element) and not isinstance(element, Element):
- PopupError('Error creating layout',
+ PopupError('Error creating Window layout',
'Layout has a FUNCTION instead of an ELEMENT',
- 'This means you are missing () from your layout',
+ 'This likely means you are missing () from your layout',
'The offensive list is:',
element,
- 'This item will be stripped from your layout')
+ 'This item will be stripped from your layout', keep_on_top=True)
continue
if element.ParentContainer is not None:
- warnings.warn('*** YOU ARE ATTEMPTING TO RESUSE A LAYOUT! You must not attempt this kind of re-use ***', UserWarning)
- PopupError('Error creating layout',
+ warnings.warn('*** YOU ARE ATTEMPTING TO RESUSE AN ELEMENT IN YOUR LAYOUT! Once placed in a layout, an element cannot be used in another layout. ***', UserWarning)
+ PopupError('Error creating Window layout',
'The layout specified has already been used',
'You MUST start witha "clean", unused layout every time you create a window',
'The offensive Element = ',
element,
'and has a key = ', element.Key,
- 'This item will be stripped from your layout')
+ 'This item will be stripped from your layout',
+ 'Hint - try printing your layout and matching the IDs "print(layout)"', keep_on_top=True)
continue
element.Position = (CurrentRowNumber, i)
element.ParentContainer = self
@@ -5556,12 +6591,12 @@ class Window:
try:
iter(row)
except TypeError:
- PopupError('Error creating layout',
+ PopupError('Error creating Window layout',
'Your row is not an iterable (e.g. a list)',
'Instead of a list, the type found was {}'.format(type(row)),
'The offensive row = ',
row,
- 'This item will be stripped from your layout')
+ 'This item will be stripped from your layout', keep_on_top=True)
continue
self.AddRow(*row)
@@ -5572,19 +6607,46 @@ class Window:
has been removed from examples contained in documents and in the Demo Programs. Trying to remove this call
from history and replace with sending as a parameter to Window.
- :param rows: List[List[Elements]] Your entire layout
- :return: (Window} self so that you can chain method calls
+ :param rows: Your entire layout
+ :type rows: List[List[Elements]]
+ :return: self so that you can chain method calls
+ :rtype: (Window)
"""
self.AddRows(rows)
self._BuildKeyDict()
return self
+
+ def extend_layout(self, container, rows):
+ """
+ Adds new rows to an existing container element inside of this window
+
+ :param container: (Union[Frame, Column, Tab]) - The container Element the layout will be placed inside of
+ :type container: (Union[Frame, Column, Tab])
+ :param rows: (List[List[Element]]) - The layout to be added
+ :type rows: (List[List[Element]])
+ :return: (Window) self so could be chained
+ :rtype: (Window)
+ """
+ column = Column(rows, pad=(0,0))
+ if self == container:
+ frame = self.TKroot
+ else:
+ frame = container.Widget
+ PackFormIntoFrame(column, frame, self)
+ # sg.PackFormIntoFrame(col, window.TKroot, window)
+ self.AddRow(column)
+ self.AllKeysDict = self._BuildKeyDictForWindow(self, column, self.AllKeysDict)
+ return self
+
def LayoutAndRead(self, rows, non_blocking=False):
"""
Deprecated!! Now your layout your window's rows (layout) and then separately call Read.
- :param rows: (List[List[Element]]) The layout of the window
- :param non_blocking: (bool) if True the Read call will not block
+ :param rows: The layout of the window
+ :type rows: List[List[Element]]
+ :param non_blocking: if True the Read call will not block
+ :type non_blocking: (bool)
"""
raise DeprecationWarning(
'LayoutAndRead is no longer supported... change your call window.Layout(layout).Read()\nor window(title, layout).Read()')
@@ -5595,7 +6657,6 @@ class Window:
def LayoutAndShow(self, rows):
"""
Deprecated - do not use any longer. Layout your window and then call Read. Or can add a Finalize call before the Read
- :param rows:
"""
raise DeprecationWarning('LayoutAndShow is no longer supported... ')
@@ -5643,13 +6704,17 @@ class Window:
# ------------------------- SetIcon - set the window's fav icon ------------------------- #
def SetIcon(self, icon=None, pngbase64=None):
"""
- Sets the icon that is shown on the title bar and on the task bar. Can pass in:
- * a filename which must be a .ICO icon file for windows
- * a bytes object
- * a BASE64 encoded file held in a variable
+ Changes the icon that is shown on the title bar and on the task bar.
+ NOTE - The file type is IMPORTANT and depends on the OS!
+ Can pass in:
+ * filename which must be a .ICO icon file for windows, PNG file for Linux
+ * bytes object
+ * BASE64 encoded file held in a variable
- :param icon: (str) Filename or bytes object
- :param pngbase64: (str) Base64 encoded GIF or PNG file
+ :param icon: Filename or bytes object
+ :type icon: (str)
+ :param pngbase64: Base64 encoded image
+ :type pngbase64: (str)
"""
if type(icon) is bytes or pngbase64 is not None:
wicon = tkinter.PhotoImage(data=icon if icon is not None else pngbase64)
@@ -5664,9 +6729,9 @@ class Window:
self.WindowIcon = wicon
return
+ wicon = icon
try:
self.TKroot.iconbitmap(icon)
- wicon = icon
except:
try:
wicon = tkinter.PhotoImage(file=icon)
@@ -5699,7 +6764,8 @@ class Window:
"""
Returns the default elementSize
- :return: Tuple[int, int] (width, height) of the default element size
+ :return: (width, height) of the default element size
+ :rtype: Tuple[int, int]
"""
return self.DefaultElementSize
@@ -5735,20 +6801,47 @@ class Window:
self.FormRemainedOpen = True
self.TKroot.quit() # kick the users out of the mainloop
- def Read(self, timeout=None, timeout_key=TIMEOUT_KEY):
+ # @_timeit_summary
+ def Read(self, timeout=None, timeout_key=TIMEOUT_KEY, close=False):
+ # type: (int, Any, bool) -> Tuple[Any, Union[Dict, List]]
+ """
+ THE biggest deal method in the Window class! This is how you get all of your data from your Window.
+ Pass in a timeout (in milliseconds) to wait for a maximum of timeout milliseconds. Will return timeout_key
+ if no other GUI events happen first.
+
+ :param timeout: Milliseconds to wait until the Read will return IF no other GUI events happen first
+ :type timeout: (int)
+ :param timeout_key: The value that will be returned from the call if the timer expired
+ :type timeout_key: (Any)
+ :param close: if True the window will be closed prior to returning
+ :type close: (bool)
+ :return: (event, values)
+ :rtype: Tuple[(Any), Union[Dict[Any:Any]], List[Any], None]
+ """
+ results = self._read(timeout=timeout, timeout_key=timeout_key)
+ if close:
+ self.close()
+
+ return results
+
+
+ # @_timeit
+ def _read(self, timeout=None, timeout_key=TIMEOUT_KEY):
# type: (int, Any) -> Tuple[Any, Union[Dict, List]]
"""
THE biggest deal method in the Window class! This is how you get all of your data from your Window.
Pass in a timeout (in milliseconds) to wait for a maximum of timeout milliseconds. Will return timeout_key
if no other GUI events happen first.
- :param timeout: (int) Milliseconds to wait until the Read will return IF no other GUI events happen first
- :param timeout_key: (Any) The value that will be returned from the call if the timer expired
- :return: Tuple[(Any), Union[Dict[Any:Any]], List[Any], None] (event, values)
- (event or timeout_key or None, Dictionary of values or List of values from all elements in the Window)
+ :param timeout: Milliseconds to wait until the Read will return IF no other GUI events happen first
+ :type timeout: (int)
+ :param timeout_key: The value that will be returned from the call if the timer expired
+ :type timeout_key: (Any)
+ :return: (event, values) (event or timeout_key or None, Dictionary of values or List of values from all elements in the Window)
+ :rtype: Tuple[(Any), Union[Dict[Any:Any]], List[Any], None]
"""
# ensure called only 1 time through a single read cycle
- if not Window.read_call_from_debugger:
+ if not Window._read_call_from_debugger:
_refresh_debugger()
timeout = int(timeout) if timeout is not None else None
if timeout == 0: # timeout of zero runs the old readnonblocking
@@ -5784,7 +6877,7 @@ class Window:
rc = self.TKroot.update()
except:
self.TKrootDestroyed = True
- Window.DecrementOpenCount()
+ Window._DecrementOpenCount()
# _my_windows.Decrement()
# print('ROOT Destroyed')
results = _BuildResults(self, False, self)
@@ -5832,13 +6925,13 @@ class Window:
self.TKroot.destroy()
except:
pass
- Window.DecrementOpenCount()
+ Window._DecrementOpenCount()
# _my_windows.Decrement()
self.LastButtonClicked = None
return None, None
# if form was closed with X
if self.LastButtonClicked is None and self.LastKeyboardEvent is None and self.ReturnValues[0] is None:
- Window.DecrementOpenCount()
+ Window._DecrementOpenCount()
# _my_windows.Decrement()
# Determine return values
if self.LastKeyboardEvent is not None or self.LastButtonClicked is not None:
@@ -5876,14 +6969,14 @@ class Window:
rc = self.TKroot.update()
except:
self.TKrootDestroyed = True
- Window.DecrementOpenCount()
+ Window._DecrementOpenCount()
# _my_windows.Decrement()
# print("read failed")
# return None, None
if self.RootNeedsDestroying:
# print('*** DESTROYING LATE ***', self.ReturnValues)
self.TKroot.destroy()
- Window.DecrementOpenCount()
+ Window._DecrementOpenCount()
# _my_windows.Decrement()
self.Values = None
self.LastButtonClicked = None
@@ -5896,7 +6989,8 @@ class Window:
Read(timeout=0). It doesn't block and uses your layout to create tkinter widgets to represent the elements.
Lots of action!
- :return: (Window) Returns 'self' so that method "Chaining" can happen (read up about it as it's very cool!)
+ :return: Returns 'self' so that method "Chaining" can happen (read up about it as it's very cool!)
+ :rtype: (Window)
"""
if self.TKrootDestroyed:
@@ -5910,7 +7004,7 @@ class Window:
rc = self.TKroot.update()
except:
self.TKrootDestroyed = True
- Window.DecrementOpenCount()
+ Window._DecrementOpenCount()
print('** Finalize failed **')
# _my_windows.Decrement()
# return None, None
@@ -5922,7 +7016,8 @@ class Window:
Use this call when you want something to appear in your Window immediately (as soon as this function is called).
Without this call your changes to a Window will not be visible to the user until the next Read call
- :return: (Window) `self` so that method calls can be easily "chained"
+ :return: `self` so that method calls can be easily "chained"
+ :rtype: (Window)
"""
if self.TKrootDestroyed:
@@ -5937,8 +7032,10 @@ class Window:
"""
Fill in elements that are input fields with data based on a 'values dictionary'
- :param values_dict: (Dict[Any:Any]) {Element key : value} pairs
- :return: (Window) returns self so can be chained with other methods
+ :param values_dict: {Element key : value} pairs
+ :type values_dict: (Dict[Any:Any])
+ :return: returns self so can be chained with other methods
+ :rtype: (Window)
"""
FillFormWithValues(self, values_dict)
@@ -5965,13 +7062,12 @@ class Window:
Rememeber that this call will return None if no match is found which may cause your code to crash if not
checked for.
- :param key: (Any) Used with window.FindElement and with return values to uniquely identify this element
- :param silent_on_error: (bool) If True do not display popup nor print warning of key errors
-
- :return: Union[Element, Error Element, None] Return value can be:
- * the Element that matches the supplied key if found
- * an Error Element if silent_on_error is False
- * None if silent_on_error True
+ :param key: Used with window.FindElement and with return values to uniquely identify this element
+ :type key: (Any)
+ :param silent_on_error: If True do not display popup nor print warning of key errors
+ :type silent_on_error: (bool)
+ :return: Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
+ :rtype: Union[Element, Error Element, None]
"""
try:
element = self.AllKeysDict[key]
@@ -5979,11 +7075,13 @@ class Window:
element = None
if not silent_on_error:
warnings.warn(
- '*** WARNING = FindElement did not find the key. Please check your key\'s spelling key = %s ***' % key, UserWarning)
- PopupError('Keyword error in FindElement Call',
+ "*** WARNING = FindElement did not find the key. Please check your key's spelling. key = %s ***" % key, UserWarning)
+ PopupError('Key error in FindElement Call',
'Bad key = {}'.format(key),
'Your bad line of code may resemble this:',
- 'window.FindElement("{}")'.format(key))
+ 'window.FindElement("{}")'.format(key),
+ 'or window["{}"]'.format(key), keep_on_top=True
+ )
element = ErrorElement(key=key)
return element
@@ -5994,7 +7092,8 @@ class Window:
def FindElementWithFocus(self):
"""
Returns the Element that currently has focus as reported by tkinter. If no element is found None is returned!
- :return: Union[Element, None] An Element if one has been found with focus or None if no element found
+ :return: An Element if one has been found with focus or None if no element found
+ :rtype: Union[Element, None]
"""
element = _FindElementWithFocusInSubForm(self)
return element
@@ -6039,7 +7138,8 @@ class Window:
ELEM_TYPE_INPUT_SLIDER, ELEM_TYPE_GRAPH, ELEM_TYPE_IMAGE,
ELEM_TYPE_INPUT_CHECKBOX, ELEM_TYPE_INPUT_LISTBOX, ELEM_TYPE_INPUT_COMBO,
ELEM_TYPE_INPUT_MULTILINE, ELEM_TYPE_INPUT_OPTION_MENU, ELEM_TYPE_INPUT_SPIN,
- ELEM_TYPE_INPUT_RADIO, ELEM_TYPE_INPUT_TEXT, ELEM_TYPE_PROGRESS_BAR):
+ ELEM_TYPE_INPUT_RADIO, ELEM_TYPE_INPUT_TEXT, ELEM_TYPE_PROGRESS_BAR,
+ ELEM_TYPE_TAB_GROUP):
element.Key = top_window.DictionaryKeyCounter
top_window.DictionaryKeyCounter += 1
if element.Key is not None:
@@ -6053,12 +7153,56 @@ class Window:
key_dict[element.Key] = element
return key_dict
+
+ def element_list(self):
+ """
+ Returns a list of all elements in the window
+
+ :return: List of all elements in the window and container elements in the window
+ :rtype: List[Element]
+ """
+ return self._build_element_list()
+
+
+ def _build_element_list(self):
+ """
+ Used internally only! Not user callable
+ Builds a dictionary containing all elements with keys for this window.
+ """
+ elem_list = []
+ elem_list = self._build_element_list_for_form(self, self, elem_list)
+ return elem_list
+
+ def _build_element_list_for_form(self, top_window, window, elem_list):
+ """
+ Loop through all Rows and all Container Elements for this window and create a list
+ Note that the calls are recursive as all pathes must be walked
+
+ :param top_window: The highest level of the window
+ :type top_window: (Window)
+ :param window: The "sub-window" (container element) to be searched
+ :type window: Union[Column, Frame, TabGroup, Pane, Tab]
+ :param elem_list: The element list as it currently stands.... used as part of recursive call
+ :type elem_list: ???
+ :return: List of all elements in this sub-window
+ :rtype: List[Element]
+ """
+ for row_num, row in enumerate(window.Rows):
+ for col_num, element in enumerate(row):
+ elem_list.append(element)
+ if element.Type in (ELEM_TYPE_COLUMN, ELEM_TYPE_FRAME, ELEM_TYPE_TAB_GROUP, ELEM_TYPE_PANE, ELEM_TYPE_TAB):
+ elem_list = self._build_element_list_for_form(top_window, element, elem_list)
+ return elem_list
+
+
+
def SaveToDisk(self, filename):
"""
Saves the values contained in each of the input areas of the form. Basically saves what would be returned
from a call to Read. It takes these results and saves them to disk using pickle
- :param filename: (str) Filename to save the values to in pickled form
+ :param filename: Filename to save the values to in pickled form
+ :type filename: (str)
"""
try:
event, values = _BuildResults(self, False, self)
@@ -6077,7 +7221,8 @@ class Window:
"""
Restore values from a previous call to SaveToDisk which saves the returned values dictionary in Pickle format
- :param filename: (str) Pickle Filename to load
+ :param filename: Pickle Filename to load
+ :type filename: (str)
"""
try:
with open(filename, 'rb') as df:
@@ -6089,7 +7234,8 @@ class Window:
"""
Get the screen dimensions. NOTE - you must have a window already open for this to work (blame tkinter not me)
- :return: Union[Tuple[None, None], Tuple[width, height]] Tuple containing width and height of screen in pixels
+ :return: Tuple containing width and height of screen in pixels
+ :rtype: Union[Tuple[None, None], Tuple[width, height]]
"""
if self.TKrootDestroyed:
return Window.get_screen_size()
@@ -6100,8 +7246,10 @@ class Window:
def Move(self, x, y):
"""
Move the upper left corner of this window to the x,y coordinates provided
- :param x: (int) x coordinate in pixels
- :param y: (int) y coordinate in pixels
+ :param x: x coordinate in pixels
+ :type x: (int)
+ :param y: y coordinate in pixels
+ :type y: (int)
"""
try:
self.TKroot.geometry("+%s+%s" % (x, y))
@@ -6142,7 +7290,8 @@ class Window:
def _StartMove(self, event):
"""
Used by "Grab Anywhere" style windows. This function is bound to mouse-down. It marks the beginning of a drag.
- :param event: (event) event information passed in by tkinter. Contains x,y position of mouse
+ :param event: event information passed in by tkinter. Contains x,y position of mouse
+ :type event: (event)
"""
try:
self.TKroot.x = event.x
@@ -6155,7 +7304,8 @@ class Window:
"""
Used by "Grab Anywhere" style windows. This function is bound to mouse-up. It marks the ending of a drag.
Sets the position of the window to this final x,y coordinates
- :param event: (event) event information passed in by tkinter. Contains x,y position of mouse
+ :param event: event information passed in by tkinter. Contains x,y position of mouse
+ :type event: (event)
"""
try:
self.TKroot.x = None
@@ -6167,7 +7317,8 @@ class Window:
def _OnMotion(self, event):
"""
Used by "Grab Anywhere" style windows. This function is bound to mouse motion. It actually moves the window
- :param event: (event) event information passed in by tkinter. Contains x,y position of mouse
+ :param event: event information passed in by tkinter. Contains x,y position of mouse
+ :type event: (event)
"""
try:
deltax = event.x - self.TKroot.x
@@ -6184,7 +7335,8 @@ class Window:
Window keyboard callback. Called by tkinter. Will kick user out of the tkinter event loop. Should only be
called if user has requested window level keyboard events
- :param event: (event) object provided by tkinter that contains the key information
+ :param event: object provided by tkinter that contains the key information
+ :type event: (event)
"""
self.LastButtonClicked = None
self.FormRemainedOpen = True
@@ -6202,7 +7354,8 @@ class Window:
Called by tkinter when a mouse wheel event has happened. Only called if keyboard events for the window
have been enabled
- :param event: (event) object sent in by tkinter that has the wheel direction
+ :param event: object sent in by tkinter that has the wheel direction
+ :type event: (event)
"""
self.LastButtonClicked = None
self.FormRemainedOpen = True
@@ -6234,11 +7387,15 @@ class Window:
Closes window. Users can safely call even if window has been destroyed. Should always call when done with
a window so that resources are properly freed up within your thread.
"""
+ try:
+ self.TKroot.update() # On Linux must call update if the user closed with X or else won't actually close the window
+ except:
+ pass
if self.TKrootDestroyed:
return
try:
self.TKroot.destroy()
- Window.DecrementOpenCount()
+ Window._DecrementOpenCount()
except:
pass
# if down to 1 window, try and destroy the hidden window, if there is one
@@ -6319,7 +7476,8 @@ class Window:
"""
Sets the Alpha Channel for a window. Values are between 0 and 1 where 0 is completely transparent
- :param alpha: (float) 0 to 1. 0 is completely transparent. 1 is completely visible and solid (can't see through)
+ :param alpha: 0 to 1. 0 is completely transparent. 1 is completely visible and solid (can't see through)
+ :type alpha: (float)
"""
# Change the window's transparency
# :param alpha: From 0 to 1 with 0 being completely transparent
@@ -6339,7 +7497,8 @@ class Window:
"""
The setter method for this "property".
Planning on depricating so that a Set call is always used by users. This is more in line with the SDK
- :param alpha: (float) 0 to 1. 0 is completely transparent. 1 is completely visible and solid (can't see through)
+ :param alpha: 0 to 1. 0 is completely transparent. 1 is completely visible and solid (can't see through)
+ :type alpha: (float)
"""
self._AlphaChannel = alpha
self.TKroot.attributes('-alpha', alpha)
@@ -6349,10 +7508,19 @@ class Window:
Brings this window to the top of all other windows (perhaps may not be brought before a window made to "stay
on top")
"""
- try:
- self.TKroot.lift()
- except:
- pass
+ if sys.platform.startswith('win'):
+ try:
+ self.TKroot.wm_attributes("-topmost", 0)
+ self.TKroot.wm_attributes("-topmost", 1)
+ if not self.KeepOnTop:
+ self.TKroot.wm_attributes("-topmost", 0)
+ except:
+ pass
+ else:
+ try:
+ self.TKroot.lift()
+ except:
+ pass
def SendToBack(self):
"""
@@ -6367,7 +7535,8 @@ class Window:
"""
Get the current location of the window's top left corner
- :return: Tuple[(int), (int)] The x and y location in tuple form (x,y)
+ :return: The x and y location in tuple form (x,y)
+ :rtype: Tuple[(int), (int)]
"""
return int(self.TKroot.winfo_x()), int(self.TKroot.winfo_y())
@@ -6376,7 +7545,8 @@ class Window:
"""
Return the current size of the window in pixels
- :return: Tuple[(int), (int)] the (width, height) of the window
+ :return: (width, height) of the window
+ :rtype: Tuple[(int), (int)]
"""
win_width = self.TKroot.winfo_width()
win_height = self.TKroot.winfo_height()
@@ -6387,7 +7557,8 @@ class Window:
"""
Changes the size of the window, if possible
- :param size: Tuple[int, int] (width, height) of the desired window size
+ :param size: (width, height) of the desired window size
+ :type size: Tuple[int, int]
"""
try:
self.TKroot.geometry("%sx%s" % (size[0], size[1]))
@@ -6408,7 +7579,8 @@ class Window:
"""
Set the color that will be transparent in your window. Areas with this color will be SEE THROUGH.
- :param color: (str) Color string that defines the transparent color
+ :param color: Color string that defines the transparent color
+ :type color: (str)
"""
try:
self.TKroot.attributes('-transparentcolor', color)
@@ -6456,7 +7628,9 @@ class Window:
Used to add tkinter events to a Window.
The tkinter specific data is in the Window's member variable user_bind_event
:param bind_string: The string tkinter expected in its bind function
+ :type bind_string: (str)
:param key: The event that will be generated when the tkinter event occurs
+ :type key: Any
"""
self.TKroot.bind(bind_string, lambda evt: self._user_bind_callback(bind_string, evt))
self.user_bind_dict[bind_string] = key
@@ -6515,8 +7689,10 @@ class Window:
This is "called" by writing code as thus:
window['element key'].Update
- :param key: (Any) The key to find
- :return: Union[Element, None] The element found or None if no element was found
+ :param key: The key to find
+ :type key: (Any)
+ :return: The element found or None if no element was found
+ :rtype: Union[Element, None]
"""
try:
return self.FindElement(key)
@@ -6530,9 +7706,8 @@ class Window:
window() == window.Read()
window(timeout=50) == window.Read(timeout=50)
- :param args:
- :param kwargs:
- :return: Tuple[Any, Dict[Any:Any]] The famous event, values that Read returns.
+ :return: The famous event, values that Read returns.
+ :rtype: Tuple[Any, Dict[Any:Any]]
"""
return self.Read(*args, **kwargs)
@@ -6588,7 +7763,6 @@ class Window:
# return False
#
# def __del__(self):
- # """ """
# # print('DELETING WINDOW')
# for row in self.Rows:
# for element in row:
@@ -6603,6 +7777,291 @@ Window.CloseNonBlockingForm = Window.Close
Window.CloseNonBlocking = Window.Close
+# ------------------------------------------------------------------------- #
+# SystemTray - class for implementing a psyeudo tray #
+# ------------------------------------------------------------------------- #
+
+# -------------------------------- System Tray Begins Here -------------------------------- #
+# Feb 2020 - Just starting on this so code commented out for now. Basing on PySimpleGUIQt's implementation / call format
+
+
+# -------------------------------------------------------------------
+# fade in/out info and default window alpha
+SYSTEM_TRAY_WIN_MARGINS = 160, 60 # from right edge of screen, from bottom of screen
+SYSTEM_TRAY_MESSAGE_MAX_LINE_LENGTH = 50
+# colors
+SYSTEM_TRAY_MESSAGE_WIN_COLOR = "#282828"
+SYSTEM_TRAY_MESSAGE_TEXT_COLOR = "#ffffff"
+
+SYSTEM_TRAY_MESSAGE_DISPLAY_DURATION_IN_MILLISECONDS = 3000 # how long to display the window
+SYSTEM_TRAY_MESSAGE_FADE_IN_DURATION = 1000 # how long to fade in / fade out the window
+
+EVENT_SYSTEM_TRAY_ICON_DOUBLE_CLICKED = '__DOUBLE_CLICKED__'
+EVENT_SYSTEM_TRAY_ICON_ACTIVATED = '__ACTIVATED__'
+EVENT_SYSTEM_TRAY_MESSAGE_CLICKED = '__MESSAGE_CLICKED__'
+
+
+
+# Base64 Images to use as icons in the window
+_tray_icon_error = b'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAADlAAAA5QGP5Zs8AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAIpQTFRF////20lt30Bg30pg4FJc409g4FBe4E9f4U9f4U9g4U9f4E9g31Bf4E9f4E9f4E9f4E9f4E9f4FFh4Vdm4lhn42Bv5GNx5W575nJ/6HqH6HyI6YCM6YGM6YGN6oaR8Kev9MPI9cbM9snO9s3R+Nfb+dzg+d/i++vt/O7v/fb3/vj5//z8//7+////KofnuQAAABF0Uk5TAAcIGBktSYSXmMHI2uPy8/XVqDFbAAAA8UlEQVQ4y4VT15LCMBBTQkgPYem9d9D//x4P2I7vILN68kj2WtsAhyDO8rKuyzyLA3wjSnvi0Eujf3KY9OUP+kno651CvlB0Gr1byQ9UXff+py5SmRhhIS0oPj4SaUUCAJHxP9+tLb/ezU0uEYDUsCc+l5/T8smTIVMgsPXZkvepiMj0Tm5txQLENu7gSF7HIuMreRxYNkbmHI0u5Hk4PJOXkSMz5I3nyY08HMjbpOFylF5WswdJPmYeVaL28968yNfGZ2r9gvqFalJNUy2UWmq1Wa7di/3Kxl3tF1671YHRR04dWn3s9cXRV09f3vb1fwPD7z9j1WgeRgAAAABJRU5ErkJggg=='
+_tray_icon_success = b'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAAEKAAABCgEWpLzLAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAHJQTFRF////ZsxmbbZJYL9gZrtVar9VZsJcbMRYaMZVasFYaL9XbMFbasRZaMFZacRXa8NYasFaasJaasFZasJaasNZasNYasJYasJZasJZasJZasJZasJZasJYasJZasJZasJZasJZasJaasJZasJZasJZasJZ2IAizQAAACV0Uk5TAAUHCA8YGRobHSwtPEJJUVtghJeYrbDByNjZ2tvj6vLz9fb3/CyrN0oAAADnSURBVDjLjZPbWoUgFIQnbNPBIgNKiwwo5v1fsQvMvUXI5oqPf4DFOgCrhLKjC8GNVgnsJY3nKm9kgTsduVHU3SU/TdxpOp15P7OiuV/PVzk5L3d0ExuachyaTWkAkLFtiBKAqZHPh/yuAYSv8R7XE0l6AVXnwBNJUsE2+GMOzWL8k3OEW7a/q5wOIS9e7t5qnGExvF5Bvlc4w/LEM4Abt+d0S5BpAHD7seMcf7+ZHfclp10TlYZc2y2nOqc6OwruxUWx0rDjNJtyp6HkUW4bJn0VWdf/a7nDpj1u++PBOR694+Ftj/8PKNdnDLn/V8YAAAAASUVORK5CYII='
+_tray_icon_halt = b'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQAAANswNuMPDO8HBO8FCe0HCu4IBu4IB+oLDeoLDu8JC+wKCu4JDO4LDOwKEe4OEO4OEeUQDewQDe0QDucVEuYcG+ccHOsQFuwWHe4fH/EGAvMEBfMFBvAHBPMGBfEGBvYCAfYDAvcDA/cDBPcDBfUDBvYEAPYEAfYEAvYEA/QGAPQGAfQGAvYEBPUEBvYFB/QGBPQGBfQHB/EFCvIHCPMHCfIHC/IFDfMHDPQGCPQGCfQGCvEIBPIIBfAIB/UIB/QICPYICfoBAPoBAfoBAvsBA/kCAPkCAfkCAvkCA/oBBPkCBPkCBfkCBvgCB/gEAPkEAfgEAvkEA/gGAfkGAvkEBPgEBfkEBv0AAP0AAfwAAvwAA/wCAPwCAfwCAvwCA/wABP0ABfwCBfwEAPwFA/ASD/ESFPAUEvAUE/EXFvAdH+kbIOobIeofIfEfIOcmKOohIukgJOggJesiKuwiKewoLe0tLO0oMOQ3OO43Oew4OfAhIPAhIfAiIPEiI+dDRe9ES+lQTOdSWupSUOhTUehSV+hUVu1QUO1RUe1SV+tTWe5SWOxXWOpYV+pZWelYXexaW+xaXO9aX+lZYeNhYOxjZ+lna+psbOttbehsbupscepucuxtcuxucep3fet7e+p/ffB6gOmKiu2Iie2Sk+2Qle2QluySlOyTleuYmvKFivCOjgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIxGNZsAAAEAdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wBT9wclAAAACXBIWXMAAA7DAAAOwwHHb6hkAAACVElEQVQ4T22S93PTMBhADQdl791SSsuRARTKKHsn+STZBptAi6zIacous+w9yyxl7z1T1h8ptHLhrrzLD5+/987R2XZElZ/39tZsbGg42NdvF4pqcGMs4XEcozAB/oQeu6wGr5fkAZcKOUIIRgQXR723wgaXt/NSgcwlO1r3oARkATfhbmNMMCnlMZdz5J8RN9fVhglS5JA/pJUOJiYXoShCkz/flheDvpzlBCBmya5KcDG1sMSB+r/VQtG+YoFXlwN0Us4yeBXujPmWCOqNlVwX5zHntLH5iQ420YiqX9pqTZFSCrBGBc+InBUDAsbwLRlMC40fGJT8YLRwfnhY3v6/AUtDc9m5z0tRJBOAvHUaFchdY6+zDzEghHv1tUnrNCaIOw84Q2WQmkeO/Xopj1xFBREFr8ZZjuRhA++PEB+t05ggwBucpbH8i/n5C1ZU0EEEmRZnSMxoIYcarKigA0Cb1zpHAyZnGj21xqICAA9dcvo4UgEdZ41FBZSTzEOn30f6QeE3Vhl0gLN+2RGDzZPMHLHKoAO3MFy+ix4sDxFlvMXfrdNgFezy7qrXPaaJg0u27j5nneKrCjJ4pf4e3m4DVMcjNNNKxWnpo6jtnfnkunExB4GbuGKk5FNanpB1nJCjCsThJPAAJ8lVdSF5sSrklM2ZqmYdiC40G7Dfnhp57ZsQz6c3hylEO6ZoZQJxqiVgbhoQK3T6AIgU4rbjxthAPF6NAwAOAcS+ixlp/WBFJRDi0fj2RtcjWRwif8Qdu/w3EKLcu3/YslnrZzwo24UQQvwFCrp/iM1NnHwAAAAASUVORK5CYII='
+_tray_icon_notallowed = b'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQAAAPcICPcLC/cMDPcQEPcSEvcXF/cYGPcaGvcbG/ccHPgxMfgyMvg0NPg5Ofg6Ovg7O/hBQfhCQvlFRflGRvljY/pkZPplZfpnZ/p2dgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMgEwNYAAAEAdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wBT9wclAAAACXBIWXMAAA7DAAAOwwHHb6hkAAABE0lEQVQ4T4WT65bDIAiExWbbtN0m3Uua+P4P6g4jGtN4NvNL4DuCCC5WWobe++uwmEmtwNxJUTebcwWCt5jJBwsYcKf3NE4hTOOJxj1FEnBTz4NH6qH2jUcCGr/QLLpkQgHe/6VWJXVqFgBB4yI/KVCkBCoFgPrPHw0CWbwCL8RibBFwzQDQH62/QeAtHQBeADUIDbkF/UnmnkB1ixtERrN3xCgyuF5kMntHTCJXh2vyv+wIdMhvgTeCQJ0C2hBMgSKfZlM1wSLXZ5oqgs8sjSpaCQ2VVlfKhLU6fdZGSvyWz9JMb+NE4jt/Nwfm0yJZSkBpYDg7TcJGrjm0Z7jK0B6P/fHiHK8e9Pp/eSmuf1+vf4x/ralnCN9IrncAAAAASUVORK5CYII='
+_tray_icon_stop = b'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQAAANsAANsBAdsCAtwEBNwFBdwHB9wICNwLC90MDN0NDd0PD90REd0SEt4TE94UFN4WFt4XF94ZGeAjI+AlJeEnJ+EpKeEqKuErK+EsLOEuLuIvL+IyMuIzM+M1NeM2NuM3N+M6OuM8POQ9PeQ+PuQ/P+RAQOVISOVJSeVKSuZLS+ZOTuZQUOZRUedSUudVVehbW+lhYeljY+poaOtvb+twcOtxcetzc+t0dOx3d+x4eOx6eu19fe1+fu2AgO2Cgu6EhO6Ghu6Hh+6IiO6Jie+Kiu+Li++MjO+Nje+Oju+QkPCUlPCVlfKgoPKkpPKlpfKmpvOrq/SurvSxsfSysvW4uPW6uvW7u/W8vPa9vfa+vvbAwPbCwvfExPfFxffGxvfHx/fIyPfJyffKyvjLy/jNzfjQ0PjR0fnS0vnU1PnY2Pvg4Pvi4vvj4/vl5fvm5vzo6Pzr6/3u7v3v7/3x8f3z8/309P719f729v739/74+P75+f76+v77+//8/P/9/f/+/v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPHCyoUAAAEAdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wBT9wclAAAACXBIWXMAAA7DAAAOwwHHb6hkAAABnUlEQVQ4T33S50PTQBgG8D6lzLbsIUv2kD0FFWTvPWTvISDIUBGV1ecvj+8luZTR9P1wSe755XK5O4+hK4gn5bc7DcMBz/InQoMXeVjY4FXuCAtEyLUwQcTcFgq45JYQ4JqbwhMtV8IjeUJDjQ+5paqCyG9srEsGgoUlpeXpIjxA1nfyi2+Jqmo7Q9JeV+ODerpvBQTM8/ySzQ3t+xxoL7h7nJve5jd85M7wJq9McHaT8o6TwBTfIIfHQGzoAZ/YiSTSq8D5dSDQVqFADrJ5KFMLPaKLHQiQMQoscClezdgCB4CXD/jM90izR8g85UaKA3YAn4AejhV189acA5LX+DVOg00gnvfoVX/BRQsgbplNGqzLusgIffx1tDchiyRgdRbVHNdgRRZHQD9H1asm+PMzYyYMtoBU/sYgRxxgrmGtBRL/cnf5RL4zzCEHZF2QE14LoOWf6B9vMcJBG/iBxKo8dVtYnyStv6yuUq7FLfmqTzbLEOFest1GNGEemCjCPnKuwjm0LsLMbRBJWLkGr4WdO+Cl0HkYPBc6N4z//HcQqVwcOuIAAAAASUVORK5CYII='
+_tray_icon_exclamation = b'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQAAAN0zM900NN01Nd02Nt03N944ON45Od46Ot47O98/P99BQd9CQt9DQ+FPT+JSUuJTU+JUVOJVVeJWVuNbW+ReXuVjY+Zra+dxceh4eOl7e+l8fOl+ful/f+qBgeqCguqDg+qFheuJieuLi+yPj+yQkO2Wlu+cnO+hofGqqvGtrfre3vrf3/ri4vvn5/75+f76+v/+/v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMQ8SQkAAAEAdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wBT9wclAAAACXBIWXMAAA7DAAAOwwHHb6hkAAABJElEQVQ4T4WS63KCMBBGsyBai62X0otY0aq90ZZa3v/dtpvsJwTijOfXt7tnILOJYY9tNonjNCtQOlqhuKKG0RrNVjgkmIHBHgMId+h7zHSiwg2a9FNVVYScupETmjkd67o+CWpYwft+R6CpCgeUlq5AOyf45+8JsRUKFI6eQLkI3n5CIREBUekLxGaLpATCymRISiAszARJCYSxiZGUQKDLQoqgnPnFhUPOTWeRoZD3FvVZlmVHkE2OEM9iV71GVoZDBGUpAg9QWN5/jx+Ilsi9hz0q4VHOWD+hEF70yc1QEr1a4Q0F0S3eJDfLuv8T4QEFXduZE1rj+et7g6hzCDxF08N+X4DAu+6lUSTnc5wE5tx73ckSTV8QVoux3N88Rykw/wP3i+vwPKk17AAAAABJRU5ErkJggg=='
+_tray_icon_none = None
+
+
+SYSTEM_TRAY_MESSAGE_ICON_INFORMATION = _tray_icon_success
+SYSTEM_TRAY_MESSAGE_ICON_WARNING = _tray_icon_exclamation
+SYSTEM_TRAY_MESSAGE_ICON_CRITICAL = _tray_icon_stop
+SYSTEM_TRAY_MESSAGE_ICON_NOICON = _tray_icon_none
+
+
+# ------------------------------------------------------------------------- #
+# Tray CLASS #
+# ------------------------------------------------------------------------- #
+class SystemTray:
+ """
+ A "Simulated System Tray" that duplicates the API calls available to PySimpleGUIWx and PySimpleGUIQt users.
+
+ All of the functionality works. The icon is displayed ABOVE the system tray rather than inside of it.
+ """
+
+ def __init__(self, menu=None, filename=None, data=None, data_base64=None, tooltip=None, metadata=None):
+ """
+ SystemTray - create an icon in the system tray
+ :param menu: Menu definition
+ :type menu: ???
+ :param filename: filename for icon
+ :type filename: ????
+ :param data: in-ram image for icon
+ :type data: ???
+ :param data_base64: basee-64 data for icon
+ :type data_base64: ???
+ :param tooltip: tooltip string
+ :type tooltip: (str)
+ :param metadata: User metadata that can be set to ANYTHING
+ :type metadata: Any
+ """
+ self.Menu = menu
+ self.TrayIcon = None
+ self.Shown = False
+ self.MenuItemChosen = TIMEOUT_KEY
+ self.metadata = metadata
+ self.last_message_event = None
+
+ screen_size = Window.get_screen_size()
+
+ if filename:
+ image_elem = Image(filename=filename, background_color='red', enable_events=True, tooltip=tooltip, key='-IMAGE-')
+ elif data_base64:
+ image_elem = Image(data=data_base64, background_color='red', enable_events=True, tooltip=tooltip, key='-IMAGE-')
+ elif data:
+ image_elem = Image(data=data, background_color='red', enable_events=True, tooltip=tooltip, key='-IMAGE-')
+ else:
+ image_elem = Image(background_color='red', enable_events=True, tooltip=tooltip, key='-IMAGE-')
+ layout = [
+ [image_elem],
+ ]
+ self.window = Window('Window Title', layout, element_padding=(0, 0), margins=(0, 0), grab_anywhere=True, no_titlebar=True, transparent_color='red', keep_on_top=True, right_click_menu=menu, location=(screen_size[0] - 100, screen_size[1] - 100), finalize=True)
+
+ self.window['-IMAGE-'].bind('', '+DOUBLE_CLICK')
+
+
+ def Read(self, timeout=None):
+ """
+ Reads the context menu
+ :param timeout: Optional. Any value other than None indicates a non-blocking read
+ :return:
+ """
+ if self.last_message_event != TIMEOUT_KEY and self.last_message_event is not None:
+ event = self.last_message_event
+ self.last_message_event = None
+ return event
+ event, values = self.window.read(timeout=timeout)
+ if event.endswith('DOUBLE_CLICK'):
+ return EVENT_SYSTEM_TRAY_ICON_DOUBLE_CLICKED
+ elif event == '-IMAGE-':
+ return EVENT_SYSTEM_TRAY_ICON_ACTIVATED
+
+ return event
+
+
+ def Hide(self):
+ """
+ Hides the icon
+ """
+ self.window.hide()
+
+
+ def UnHide(self):
+ """
+ Restores a previously hidden icon
+ """
+ self.window.un_hide()
+
+
+ def ShowMessage(self, title, message, filename=None, data=None, data_base64=None, messageicon=None, time=(SYSTEM_TRAY_MESSAGE_FADE_IN_DURATION, SYSTEM_TRAY_MESSAGE_DISPLAY_DURATION_IN_MILLISECONDS)):
+ """
+ Shows a balloon above icon in system tray
+ :param title: Title shown in balloon
+ :type title:
+ :param message: Message to be displayed
+ :type message:
+ :param filename: Optional icon filename
+ :type filename:
+ :param data: Optional in-ram icon
+ :type data:
+ :param data_base64: Optional base64 icon
+ :type data_base64:
+ :param time: Amount of time to display message in milliseconds. If tuple, first item is fade in/out duration
+ :type time: Union[int, Tuple[int, int]]
+ :return: The event that happened during the display such as user clicked on message
+ :rtype: (Any)
+ """
+
+ if isinstance(time, tuple):
+ fade_duraction, display_duration = time
+ else:
+ fade_duration = SYSTEM_TRAY_MESSAGE_FADE_IN_DURATION
+ display_duration = time
+
+ user_icon = data_base64 or filename or data or messageicon
+
+ event = self.notify(title, message, icon=user_icon, fade_in_duration=fade_duraction, display_duration_in_ms=display_duration)
+ self.last_message_event = event
+ return event
+
+ def Close(self):
+ """
+ Close the system tray window
+ """
+ self.window.close()
+
+
+ def Update(self, menu=None, tooltip=None,filename=None, data=None, data_base64=None,):
+ """
+ Updates the menu, tooltip or icon
+ :param menu: menu defintion
+ :type menu: ???
+ :param tooltip: string representing tooltip
+ :type tooltip: ???
+ :param filename: icon filename
+ :type filename: ???
+ :param data: icon raw image
+ :type data: ???
+ :param data_base64: icon base 64 image
+ :type data_base64: ???
+ """
+ # Menu
+ if menu is not None:
+ top_menu = tk.Menu(self.window.TKroot, tearoff=False)
+ AddMenuItem(top_menu, menu[1], self.window['-IMAGE-'])
+ self.window['-IMAGE-'].TKRightClickMenu = top_menu
+
+ if filename:
+ self.window['-IMAGE-'].update(filename=filename)
+ elif data_base64:
+ self.window['-IMAGE-'].update(data=data_base64)
+ elif data:
+ self.window['-IMAGE-'].update(data=data)
+
+ if tooltip:
+ self.window['-IMAGE-'].set_tooltip(tooltip)
+
+
+ @classmethod
+ def notify(cls, title, message, icon=_tray_icon_success, display_duration_in_ms=SYSTEM_TRAY_MESSAGE_DISPLAY_DURATION_IN_MILLISECONDS,
+ fade_in_duration=SYSTEM_TRAY_MESSAGE_FADE_IN_DURATION, alpha=0.9, location=None):
+ """
+ Displays a "notification window", usually in the bottom right corner of your display. Has an icon, a title, and a message
+ The window will slowly fade in and out if desired. Clicking on the window will cause it to move through the end the current "phase". For example, if the window was fading in and it was clicked, then it would immediately stop fading in and instead be fully visible. It's a way for the user to quickly dismiss the window.
+ :param title: Text to be shown at the top of the window in a larger font
+ :type title: (str)
+ :param message: Text message that makes up the majority of the window
+ :type message: (str)
+ :param icon: A base64 encoded PNG/GIF image or PNG/GIF filename that will be displayed in the window
+ :type icon: Union[bytes, str]
+ :param display_duration_in_ms: Number of milliseconds to show the window
+ :type display_duration_in_ms: (int)
+ :param fade_in_duration: Number of milliseconds to fade window in and out
+ :type fade_in_duration: (int)
+ :param alpha: Alpha channel. 0 - invisible 1 - fully visible
+ :type alpha: (float)
+ :param location: Location on the screen to display the window
+ :type location: Tuple[int, int]
+ :return: (int) reason for returning
+ :rtype: (int)
+ """
+
+ messages = message.split('\n')
+ full_msg = ''
+ for m in messages:
+ m_wrap = textwrap.fill(m, SYSTEM_TRAY_MESSAGE_MAX_LINE_LENGTH)
+ full_msg += m_wrap + '\n'
+ message = full_msg[:-1]
+
+ win_msg_lines = message.count("\n") + 1
+ max_line = max(message.split('\n'))
+
+ screen_res_x, screen_res_y = Window.get_screen_size()
+ win_margin = SYSTEM_TRAY_WIN_MARGINS # distance from screen edges
+ win_width, win_height = 364, 66 + (14.8 * win_msg_lines)
+
+ layout = [[Graph(canvas_size=(win_width, win_height), graph_bottom_left=(0, win_height), graph_top_right=(win_width, 0), key="-GRAPH-",
+ background_color=SYSTEM_TRAY_MESSAGE_WIN_COLOR, enable_events=True)]]
+
+ win_location = location if location is not None else (screen_res_x - win_width - win_margin[0], screen_res_y - win_height - win_margin[1])
+ window = Window(title, layout, background_color=SYSTEM_TRAY_MESSAGE_WIN_COLOR, no_titlebar=True,
+ location=win_location, keep_on_top=True, alpha_channel=0, margins=(0, 0), element_padding=(0, 0), grab_anywhere=True, finalize=True)
+
+ window["-GRAPH-"].draw_rectangle((win_width, win_height), (-win_width, -win_height), fill_color=SYSTEM_TRAY_MESSAGE_WIN_COLOR, line_color=SYSTEM_TRAY_MESSAGE_WIN_COLOR)
+ if type(icon) is bytes:
+ window["-GRAPH-"].draw_image(data=icon, location=(20, 20))
+ elif icon is not None:
+ window["-GRAPH-"].draw_image(filename=icon, location=(20, 20))
+ window["-GRAPH-"].draw_text(title, location=(64, 20), color=SYSTEM_TRAY_MESSAGE_TEXT_COLOR, font=("Helvetica", 12, "bold"), text_location=TEXT_LOCATION_TOP_LEFT)
+ window["-GRAPH-"].draw_text(message, location=(64, 44), color=SYSTEM_TRAY_MESSAGE_TEXT_COLOR, font=("Helvetica", 9), text_location=TEXT_LOCATION_TOP_LEFT)
+ window["-GRAPH-"].set_cursor('hand2')
+
+ if fade_in_duration:
+ for i in range(1, int(alpha * 100)): # fade in
+ window.set_alpha(i / 100)
+ event, values = window.read(timeout=fade_in_duration // 100)
+ if event != TIMEOUT_KEY:
+ window.set_alpha(1)
+ break
+ if event != TIMEOUT_KEY:
+ window.close()
+ return EVENT_SYSTEM_TRAY_MESSAGE_CLICKED if event == '-GRAPH-' else event
+ event, values = window(timeout=display_duration_in_ms)
+ if event == TIMEOUT_KEY:
+ for i in range(int(alpha * 100), 1, -1): # fade out
+ window.set_alpha(i / 100)
+ event, values = window.read(timeout=fade_in_duration // 100)
+ if event != TIMEOUT_KEY:
+ break
+ else:
+ window.set_alpha(alpha)
+ event, values = window(timeout=display_duration_in_ms)
+ window.close()
+
+ return EVENT_SYSTEM_TRAY_MESSAGE_CLICKED if event == '-GRAPH-' else event
+
+ close = Close
+ hide = Hide
+ read = Read
+ show_message = ShowMessage
+ un_hide = UnHide
+ update = Update
+
+
+
+
+
+
+
# ################################################################################
# ################################################################################
# END OF ELEMENT DEFINITIONS
@@ -6610,6 +8069,10 @@ Window.CloseNonBlocking = Window.Close
# ################################################################################
+
+
+
+
# =========================================================================== #
# Button Lazy Functions so the caller doesn't have to define a bunch of stuff #
# =========================================================================== #
@@ -6620,8 +8083,11 @@ def Sizer(h_pixels=0, v_pixels=0):
"Pushes" out the size of whatever it is placed inside of. This includes Columns, Frames, Tabs and Windows
:param h_pixels: (int) number of horizontal pixels
+ :type h_pixels: (int)
:param v_pixels: (int) number of vertical pixels
+ :type v_pixels: (int)
:return: (Column) A column element that has a pad setting set according to parameters
+ :rtype: (Column)
"""
return Column([[]], pad=((h_pixels, 0), (v_pixels, 0)))
@@ -6633,10 +8099,15 @@ def FolderBrowse(button_text='Browse', target=(ThisRow, -1), initial_folder=None
font=None, pad=None, key=None, metadata=None):
"""
:param button_text: text in the button (Default value = 'Browse')
- :param target: key or (row,col) target for the button (Default value = (ThisRow, -1))
+ :type button_text: (str)
+ :param target: target for the button (Default value = (ThisRow, -1))
+ :type target: key or (row,col)
:param initial_folder: starting path for folders and files
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :type initial_folder: (str)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
:param button_color: button color (foreground, background)
:param disabled: set disable state for element (Default = False)
@@ -6665,17 +8136,26 @@ def FileBrowse(button_text='Browse', target=(ThisRow, -1), file_types=(("ALL Fil
:param target: key or (row,col) target for the button (Default value = (ThisRow, -1))
:param file_types: (Default value = (("ALL Files", "*.*")))
:param initial_folder: starting path for folders and files
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param change_submits: If True, pressing Enter key submits window (Default = False)
:param enable_events: Turns on the element specific events.(Default = False)
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param disabled: set disable state for element (Default = False)
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
- :return: (Button)
+ :type disabled: (bool)
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
+ :return: returns a button
+ :rtype: (Button)
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_BROWSE_FILE, target=target, file_types=file_types,
initial_folder=initial_folder, tooltip=tooltip, size=size, auto_size_button=auto_size_button,
@@ -6696,17 +8176,26 @@ def FilesBrowse(button_text='Browse', target=(ThisRow, -1), file_types=(("ALL Fi
:param target: key or (row,col) target for the button (Default value = (ThisRow, -1))
:param file_types: (Default value = (("ALL Files", "*.*")))
:param disabled: set disable state for element (Default = False)
+ :type disabled: (bool)
:param initial_folder: starting path for folders and files
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param change_submits: If True, pressing Enter key submits window (Default = False)
:param enable_events: Turns on the element specific events.(Default = False)
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
- :return: (Button)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
+ :return: returns a button
+ :rtype: (Button)
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_BROWSE_FILES, target=target, file_types=file_types,
initial_folder=initial_folder, change_submits=change_submits, enable_events=enable_events,
@@ -6726,16 +8215,25 @@ def FileSaveAs(button_text='Save As...', target=(ThisRow, -1), file_types=(("ALL
:param file_types: (Default value = (("ALL Files", "*.*")))
:param initial_folder: starting path for folders and files
:param disabled: set disable state for element (Default = False)
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :type disabled: (bool)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param change_submits: If True, pressing Enter key submits window (Default = False)
:param enable_events: Turns on the element specific events.(Default = False)
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
- :return: (Button)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
+ :return: returns a button
+ :rtype: (Button)
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_SAVEAS_FILE, target=target, file_types=file_types,
initial_folder=initial_folder, tooltip=tooltip, size=size, disabled=disabled,
@@ -6755,16 +8253,25 @@ def SaveAs(button_text='Save As...', target=(ThisRow, -1), file_types=(("ALL Fil
:param file_types: (Default value = (("ALL Files", "*.*")))
:param initial_folder: starting path for folders and files
:param disabled: set disable state for element (Default = False)
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :type disabled: (bool)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param change_submits: If True, pressing Enter key submits window (Default = False)
:param enable_events: Turns on the element specific events.(Default = False)
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
- :return: (Button)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
+ :return: returns a button
+ :rtype: (Button)
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_SAVEAS_FILE, target=target, file_types=file_types,
initial_folder=initial_folder, tooltip=tooltip, size=size, disabled=disabled,
@@ -6779,16 +8286,25 @@ def Save(button_text='Save', size=(None, None), auto_size_button=None, button_co
:param button_text: text in the button (Default value = 'Save')
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param bind_return_key: (Default = True)
:param disabled: set disable state for element (Default = False)
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :type disabled: (bool)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
- :return: (Button)
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
+ :return: returns a button
+ :rtype: (Button)
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
@@ -6802,16 +8318,25 @@ def Submit(button_text='Submit', size=(None, None), auto_size_button=None, butto
:param button_text: text in the button (Default value = 'Submit')
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param disabled: set disable state for element (Default = False)
+ :type disabled: (bool)
:param bind_return_key: (Default = True)
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
- :return: (Button)
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
+ :return: returns a button
+ :rtype: (Button)
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
@@ -6826,15 +8351,23 @@ def Open(button_text='Open', size=(None, None), auto_size_button=None, button_co
:param button_text: text in the button (Default value = 'Open')
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param disabled: set disable state for element (Default = False)
+ :type disabled: (bool)
:param bind_return_key: (Default = True)
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
@@ -6849,16 +8382,25 @@ def OK(button_text='OK', size=(None, None), auto_size_button=None, button_color=
:param button_text: text in the button (Default value = 'OK')
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param disabled: set disable state for element (Default = False)
+ :type disabled: (bool)
:param bind_return_key: (Default = True)
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
- :return: (Button)
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
+ :return: returns a button
+ :rtype: (Button)
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
@@ -6872,16 +8414,25 @@ def Ok(button_text='Ok', size=(None, None), auto_size_button=None, button_color=
:param button_text: text in the button (Default value = 'Ok')
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param disabled: set disable state for element (Default = False)
+ :type disabled: (bool)
:param bind_return_key: (Default = True)
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
- :return: (Button)
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
+ :return: returns a button
+ :rtype: (Button)
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
@@ -6895,15 +8446,23 @@ def Cancel(button_text='Cancel', size=(None, None), auto_size_button=None, butto
:param button_text: text in the button (Default value = 'Cancel')
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param disabled: set disable state for element (Default = False)
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :type disabled: (bool)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param bind_return_key: (Default = False)
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
@@ -6918,16 +8477,25 @@ def Quit(button_text='Quit', size=(None, None), auto_size_button=None, button_co
:param button_text: text in the button (Default value = 'Quit')
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param disabled: set disable state for element (Default = False)
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :type disabled: (bool)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param bind_return_key: (Default = False)
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
- :return: (Button)
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
+ :return: returns a button
+ :rtype: (Button)
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
@@ -6941,15 +8509,23 @@ def Exit(button_text='Exit', size=(None, None), auto_size_button=None, button_co
:param button_text: text in the button (Default value = 'Exit')
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param disabled: set disable state for element (Default = False)
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :type disabled: (bool)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param bind_return_key: (Default = False)
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
@@ -6964,16 +8540,25 @@ def Yes(button_text='Yes', size=(None, None), auto_size_button=None, button_colo
:param button_text: text in the button (Default value = 'Yes')
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param disabled: set disable state for element (Default = False)
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :type disabled: (bool)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param bind_return_key: (Default = True)
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
- :return: (Button)
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
+ :return: returns a button
+ :rtype: (Button)
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
@@ -6987,15 +8572,23 @@ def No(button_text='No', size=(None, None), auto_size_button=None, button_color=
:param button_text: text in the button (Default value = 'No')
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param disabled: set disable state for element (Default = False)
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :type disabled: (bool)
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param bind_return_key: (Default = False)
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
@@ -7010,16 +8603,25 @@ def Help(button_text='Help', size=(None, None), auto_size_button=None, button_co
:param button_text: text in the button (Default value = 'Help')
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param disabled: set disable state for element (Default = False)
+ :type disabled: (bool)
:param font: specifies the font family, size, etc
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :type font: Union[str, Tuple[str, int]]
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param bind_return_key: (Default = False)
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
- :return: (Button)
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
+ :return: returns a button
+ :rtype: (Button)
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
@@ -7033,16 +8635,25 @@ def Debug(button_text='', size=(None, None), auto_size_button=None, button_color
:param button_text: text in the button (Default value = '')
:param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param disabled: set disable state for element (Default = False)
+ :type disabled: (bool)
:param font: specifies the font family, size, etc
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :type font: Union[str, Tuple[str, int]]
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param bind_return_key: (Default = False)
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
- :return: (Button)
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
+ :return: returns a button
+ :rtype: (Button)
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_SHOW_DEBUGGER, tooltip=tooltip, size=size,
auto_size_button=auto_size_button, button_color=COLOR_SYSTEM_DEFAULT, font=font, disabled=disabled,
@@ -7057,22 +8668,32 @@ def SimpleButton(button_text, image_filename=None, image_data=None, image_size=(
"""
:param button_text: text in the button
+ :type button_text: (str)
:param image_filename: image filename if there is a button image
:param image_data: in-RAM image to be displayed on button
:param image_size: size of button image in pixels
:param image_subsample:amount to reduce the size of the image
:param border_width: width of border around element
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param size: (w,h) w=characters-wide, h=rows-high (Default = (None))
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param bind_return_key: (Default = False)
:param disabled: set disable state for element (Default = False)
+ :type disabled: (bool)
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
- :return: (Button)
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
+ :return: returns a button
+ :rtype: (Button)
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_CLOSES_WIN, image_filename=image_filename,
image_data=image_data, image_size=image_size, image_subsample=image_subsample,
@@ -7088,22 +8709,32 @@ def CloseButton(button_text, image_filename=None, image_data=None, image_size=(N
"""
:param button_text: text in the button
+ :type button_text: (str)
:param image_filename: image filename if there is a button image
:param image_data: in-RAM image to be displayed on button
:param image_size: size of button image in pixels
:param image_subsample:amount to reduce the size of the image
:param border_width: width of border around element
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param size: (w,h) w=characters-wide, h=rows-high (Default = (None))
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param bind_return_key: (Default = False)
:param disabled: set disable state for element (Default = False)
+ :type disabled: (bool)
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
- :return: (Button)
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
+ :return: returns a button
+ :rtype: (Button)
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_CLOSES_WIN, image_filename=image_filename,
image_data=image_data, image_size=image_size, image_subsample=image_subsample,
@@ -7122,21 +8753,30 @@ def ReadButton(button_text, image_filename=None, image_data=None, image_size=(No
"""
:param button_text: text in the button
+ :type button_text: (str)
:param image_filename: image filename if there is a button image
:param image_data: in-RAM image to be displayed on button
:param image_size: size of button image in pixels
:param image_subsample:amount to reduce the size of the image
:param border_width: width of border around element
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param size: (w,h) w=characters-wide, h=rows-high (Default = (None))
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param bind_return_key: (Default = False)
:param disabled: set disable state for element (Default = False)
+ :type disabled: (bool)
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, image_filename=image_filename,
@@ -7157,21 +8797,30 @@ def RealtimeButton(button_text, image_filename=None, image_data=None, image_size
"""
:param button_text: text in the button
+ :type button_text: (str)
:param image_filename: image filename if there is a button image
:param image_data: in-RAM image to be displayed on button
:param image_size: size of button image in pixels
:param image_subsample:amount to reduce the size of the image
:param border_width: width of border around element
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param size: (w,h) w=characters-wide, h=rows-high (Default = (None))
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param disabled: set disable state for element (Default = False)
+ :type disabled: (bool)
:param bind_return_key: (Default = False)
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_REALTIME, image_filename=image_filename,
@@ -7188,22 +8837,32 @@ def DummyButton(button_text, image_filename=None, image_data=None, image_size=(N
"""
:param button_text: text in the button
+ :type button_text: (str)
:param image_filename: image filename if there is a button image
:param image_data: in-RAM image to be displayed on button
:param image_size: size of button image in pixels
:param image_subsample:amount to reduce the size of the image
:param border_width: width of border around element
- :param tooltip: (str) text, that will appear when mouse hovers over the element
- :param size: (w,h) w=characters-wide, h=rows-high (Default = (None))
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
+ :param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param disabled: set disable state for element (Default = False)
+ :type disabled: (bool)
:param bind_return_key: (Default = False)
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
- :return: (Button)
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
+ :return: returns a button
+ :rtype: (Button)
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_CLOSES_WIN_ONLY, image_filename=image_filename,
image_data=image_data, image_size=image_size, image_subsample=image_subsample,
@@ -7221,28 +8880,37 @@ def CalendarButton(button_text, target=(None, None), close_when_date_chosen=True
"""
:param button_text: text in the button
+ :type button_text: (str)
:param target:
:param close_when_date_chosen: (Default = True)
:param default_date_m_d_y: (Default = (None))
- :param None:
:param image_filename: image filename if there is a button image
:param image_data: in-RAM image to be displayed on button
:param image_size: (Default = (None))
:param image_subsample:amount to reduce the size of the image
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param border_width: width of border around element
- :param size: (w,h) w=characters-wide, h=rows-high (Default = (None))
+ :param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param disabled: set disable state for element (Default = False)
+ :type disabled: (bool)
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param bind_return_key: (Default = False)
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
:param locale:
:param format:
- :return: (Button)
+ :return: returns a button
+ :rtype: (Button)
"""
button = Button(button_text=button_text, button_type=BUTTON_TYPE_CALENDAR_CHOOSER, target=target,
image_filename=image_filename, image_data=image_data, image_size=image_size,
@@ -7264,23 +8932,33 @@ def ColorChooserButton(button_text, target=(None, None), image_filename=None, im
"""
:param button_text: text in the button
+ :type button_text: (str)
:param target:
:param image_filename: image filename if there is a button image
:param image_data: in-RAM image to be displayed on button
:param image_size: (Default = (None))
:param image_subsample:amount to reduce the size of the image
- :param tooltip: (str) text, that will appear when mouse hovers over the element
+ :param tooltip: text, that will appear when mouse hovers over the element
+ :type tooltip: (str)
:param border_width: width of border around element
- :param size: (w,h) w=characters-wide, h=rows-high (Default = (None))
+ :param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
:param auto_size_button: True if button size is determined by button text
+ :type auto_size_button: (bool)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param disabled: set disable state for element (Default = False)
+ :type disabled: (bool)
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param bind_return_key: (Default = False)
:param focus: if focus should be set to this
- :param pad: Amount of padding to put around element
- :param key: Used with window.FindElement and with return values to uniquely identify this element
- :return: (Button)
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+ :param key: key for uniquely identify this element (for window.FindElement)
+ :type key: Union[str, int, tuple]
+ :return: returns a button
+ :rtype: (Button)
"""
return Button(button_text=button_text, button_type=BUTTON_TYPE_COLOR_CHOOSER, target=target,
image_filename=image_filename, image_data=image_data, image_size=image_size,
@@ -7292,13 +8970,6 @@ def ColorChooserButton(button_text, target=(None, None), image_filename=None, im
##################################### ----- RESULTS ------ ##################################################
def AddToReturnDictionary(form, element, value):
- """
-
- :param form:
- :param element:
- :param value:
-
- """
form.ReturnValuesDictionary[element.Key] = value
# if element.Key is None:
# form.ReturnValuesDictionary[form.DictionaryKeyCounter] = value
@@ -7309,23 +8980,12 @@ def AddToReturnDictionary(form, element, value):
def AddToReturnList(form, value):
- """
-
- :param form:
- :param value:
-
- """
form.ReturnValuesList.append(value)
# ----------------------------------------------------------------------------#
# ------- FUNCTION InitializeResults. Sets up form results matrix --------#
def InitializeResults(form):
- """
-
- :param form:
-
- """
_BuildResults(form, True, form)
return
@@ -7333,11 +8993,6 @@ def InitializeResults(form):
# ===== Radio Button RadVar encoding and decoding =====#
# ===== The value is simply the row * 1000 + col =====#
def DecodeRadioRowCol(RadValue):
- """
-
- :param RadValue:
-
- """
container = RadValue // 100000
row = RadValue // 1000
col = RadValue % 1000
@@ -7345,13 +9000,6 @@ def DecodeRadioRowCol(RadValue):
def EncodeRadioRowCol(container, row, col):
- """
-
- :param container:
- :param row:
- :param col:
-
- """
RadValue = container * 100000 + row * 1000 + col
return RadValue
@@ -7360,13 +9008,6 @@ def EncodeRadioRowCol(container, row, col):
# format of return values is
# (Button Pressed, input_values)
def _BuildResults(form, initialize_only, top_level_form):
- """
-
- :param form:
- :param initialize_only:
- :param top_level_form:
-
- """
# Results for elements are:
# TEXT - Nothing
# INPUT - Read value from TK
@@ -7383,13 +9024,6 @@ def _BuildResults(form, initialize_only, top_level_form):
def _BuildResultsForSubform(form, initialize_only, top_level_form):
- """
-
- :param form:
- :param initialize_only:
- :param top_level_form:
-
- """
button_pressed_text = top_level_form.LastButtonClicked
for row_num, row in enumerate(form.Rows):
for col_num, element in enumerate(row):
@@ -7605,8 +9239,10 @@ def FillFormWithValues(window, values_dict):
"""
Fills a window with values provided in a values dictionary { element_key : new_value }
- :param window: (Window) The window object to fill
- :param values_dict: (Dict[Any:Any]) A dictionary with element keys as key and value is values parm for Update call
+ :param window: The window object to fill
+ :type window: (Window)
+ :param values_dict: A dictionary with element keys as key and value is values parm for Update call
+ :type values_dict: (Dict[Any:Any])
"""
for element_key in values_dict:
@@ -7621,7 +9257,9 @@ def _FindElementWithFocusInSubForm(form):
Searches through a "sub-form" (can be a window or container) for the current element with focus
:param form: a Window, Column, Frame, or TabGroup (container elements)
- :return: Union[Element, None]
+ :type form: container elements
+ :return: Element
+ :rtyp0e: Union[Element, None]
"""
for row_num, row in enumerate(form.Rows):
for col_num, element in enumerate(row):
@@ -7668,9 +9306,9 @@ if sys.version_info[0] >= 3:
def AddMenuItem(top_menu, sub_menu_info, element, is_sub_menu=False, skip=False):
"""
Only to be used internally. Not user callable
- :param top_menu:
- :param sub_menu_info:
- :param element:
+ :param top_menu: ???
+ :param sub_menu_info: ???
+ :param element: ???
:param is_sub_menu: (Default = False)
:param skip: (Default = False)
@@ -7705,6 +9343,8 @@ if sys.version_info[0] >= 3:
if i != len(sub_menu_info) - 1:
if type(sub_menu_info[i + 1]) == list:
new_menu = tk.Menu(top_menu, tearoff=element.Tearoff)
+ if element.Font is not None:
+ new_menu.config(font=element.Font)
return_val = new_menu
pos = sub_menu_info[i].find('&')
if pos != -1:
@@ -7727,9 +9367,9 @@ else:
def AddMenuItem(top_menu, sub_menu_info, element, is_sub_menu=False, skip=False):
"""
- :param top_menu:
- :param sub_menu_info:
- :param element:
+ :param top_menu: ???
+ :param sub_menu_info: ???
+ :param element: ???
:param is_sub_menu: (Default = False)
:param skip: (Default = False)
@@ -7806,19 +9446,27 @@ else:
# ======================== TK CODE STARTS HERE ========================================= #
-
+# @_timeit
def PackFormIntoFrame(form, containing_frame, toplevel_form):
"""
- :param form: (Window)
- :param containing_frame:
- :param toplevel_form: (Window)
+ :param form: a window class
+ :type form: (Window)
+ :param containing_frame: ???
+ :type containing_frame: ???
+ :param toplevel_form: ???
+ :type toplevel_form: (Window)
"""
- def CharWidthInPixels():
- """ """
- return tkinter.font.Font().measure('A') # single character width
+ def _char_width_in_pixels(font):
+ return tkinter.font.Font(font=font).measure('A') # single character width
+
+ def _char_height_in_pixels(font):
+ return tkinter.font.Font(font=font).metrics('linespace')
+
+ def _string_width_in_pixels(font, string):
+ return tkinter.font.Font(font=font).measure(string) # single character width
border_depth = toplevel_form.BorderDepth if toplevel_form.BorderDepth is not None else DEFAULT_BORDER_WIDTH
# --------------------------------------------------------------------------- #
@@ -7854,6 +9502,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
# Set foreground color
text_color = element.TextColor
elementpad = element.Pad if element.Pad is not None else toplevel_form.ElementPadding
+ element.pad_used = elementpad # store the value used back into the element
# Determine Element size
element_size = element.Size
if (element_size == (None, None) and element_type not in (
@@ -7999,9 +9648,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
justification = toplevel_form.TextJustification
else:
justification = DEFAULT_TEXT_JUSTIFICATION
- justify = tk.LEFT if justification == 'left' else tk.CENTER if justification == 'center' else tk.RIGHT
- anchor = tk.NW if justification == 'left' else tk.N if justification == 'center' else tk.NE
-
+ justify = tk.LEFT if justification.startswith('l') else tk.CENTER if justification.startswith('c') else tk.RIGHT
+ anchor = tk.NW if justification.startswith('l') else tk.N if justification.startswith('c') else tk.NE
tktext_label = element.Widget = tk.Label(tk_row_frame, textvariable=stringvar, width=width,
height=height, justify=justify, bd=bd, font=font)
# Set wrap-length for text (in PIXELS) == PAIN IN THE ASS
@@ -8169,7 +9817,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
if element.DisabledButtonColor[1] is not None:
button_style.map(style_name, background=[('disabled', element.DisabledButtonColor[1])])
if height > 1:
- button_style.configure(style_name, padding=height * CharWidthInPixels())
+ button_style.configure(style_name, padding=height * _char_width_in_pixels(font))
wraplen = tkbutton.winfo_reqwidth() # width of widget in Pixels
if width != 0:
button_style.configure(style_name, wraplength=wraplen) # set wrap to width of widget
@@ -8306,7 +9954,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
justification = element.Justification
else:
justification = DEFAULT_TEXT_JUSTIFICATION
- justify = tk.LEFT if justification == 'left' else tk.CENTER if justification == 'center' else tk.RIGHT
+ justify = tk.LEFT if justification.startswith('l') else tk.CENTER if justification.startswith('c') else tk.RIGHT
# anchor = tk.NW if justification == 'left' else tk.N if justification == 'center' else tk.NE
element.TKEntry = element.Widget = tk.Entry(tk_row_frame, width=element_size[0],
textvariable=element.TKStringVar, bd=bd,
@@ -8494,18 +10142,18 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
# ------------------------- MULTILINE placement element ------------------------- #
elif element_type == ELEM_TYPE_INPUT_MULTILINE:
element = element # type: Multiline
- default_text = element.DefaultText
width, height = element_size
bd = element.BorderWidth
element.TKText = element.Widget = tk.scrolledtext.ScrolledText(tk_row_frame, width=width, height=height,
wrap='word', bd=bd, font=font,
relief=RELIEF_SUNKEN)
- element.TKText.insert(1.0, default_text) # set the default text
+ if element.DefaultText:
+ element.TKText.insert(1.0, element.DefaultText) # set the default text
element.TKText.config(highlightthickness=0)
if element.BackgroundColor is not None and element.BackgroundColor != COLOR_SYSTEM_DEFAULT:
element.TKText.configure(background=element.BackgroundColor)
- if DEFAULT_SCROLLBAR_COLOR not in (None, COLOR_SYSTEM_DEFAULT):
- element.TKText.vbar.config(troughcolor=DEFAULT_SCROLLBAR_COLOR)
+ # if DEFAULT_SCROLLBAR_COLOR not in (None, COLOR_SYSTEM_DEFAULT): # only works on Linux so not including it
+ # element.TKText.vbar.config(troughcolor=DEFAULT_SCROLLBAR_COLOR)
element.TKText.pack(side=tk.LEFT, padx=elementpad[0], pady=elementpad[1])
if element.Visible is False:
element.TKText.pack_forget()
@@ -8529,8 +10177,9 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
element.TKRightClickMenu = top_menu
element.TKText.bind('', element._RightClickMenuCallback)
# row_should_expand = True
- # ------------------------- CHECKBOX element ------------------------- #
+ # ------------------------- CHECKBOX pleacement element ------------------------- #
elif element_type == ELEM_TYPE_INPUT_CHECKBOX:
+ element = element # type: Checkbox
width = 0 if auto_size_text else element_size[0]
default_value = element.InitialState
element.TKIntVar = tk.IntVar()
@@ -8550,7 +10199,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
element.TKCheckbutton.configure(state='disable')
if element.BackgroundColor is not None and element.BackgroundColor != COLOR_SYSTEM_DEFAULT:
element.TKCheckbutton.configure(background=element.BackgroundColor)
- element.TKCheckbutton.configure(selectcolor=element.BackgroundColor)
+ element.TKCheckbutton.configure(selectcolor=element.CheckboxBackgroundColor) # The background of the checkbox
element.TKCheckbutton.configure(activebackground=element.BackgroundColor)
if text_color is not None and text_color != COLOR_SYSTEM_DEFAULT:
element.TKCheckbutton.configure(fg=text_color)
@@ -8614,7 +10263,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
bd=border_depth, font=font)
if not element.BackgroundColor in (None, COLOR_SYSTEM_DEFAULT):
element.TKRadio.configure(background=element.BackgroundColor)
- element.TKRadio.configure(selectcolor=element.BackgroundColor)
+ element.TKRadio.configure(selectcolor=element.CircleBackgroundColor)
element.TKRadio.configure(activebackground=element.BackgroundColor)
if text_color is not None and text_color != COLOR_SYSTEM_DEFAULT:
element.TKRadio.configure(fg=text_color)
@@ -8673,7 +10322,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
element.TKRightClickMenu = top_menu
element._TKOut.bind('', element._RightClickMenuCallback)
# row_should_expand = True
- # ------------------------- IMAGE element ------------------------- #
+ # ------------------------- IMAGE placement element ------------------------- #
elif element_type == ELEM_TYPE_IMAGE:
element = element # type: Image
if element.Filename is not None:
@@ -8783,6 +10432,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
for menu_entry in menu_def:
# print(f'Adding a Menubar ENTRY {menu_entry}')
baritem = tk.Menu(menubar, tearoff=element.Tearoff)
+ if element.Font is not None:
+ baritem.config(font=element.Font)
pos = menu_entry[0].find('&')
# print(pos)
if pos != -1:
@@ -8866,7 +10517,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
elif element_type == ELEM_TYPE_TAB_GROUP:
element = element # type: TabGroup
custom_style = str(element.Key) + 'customtab.TNotebook'
- style = ttk.Style(tk_row_frame)
+ style = ttk.Style()
style.theme_use(toplevel_form.TtkTheme)
if element.TabLocation is not None:
position_dict = {'left': 'w', 'right': 'e', 'top': 'n', 'bottom': 's', 'lefttop': 'wn',
@@ -8907,11 +10558,11 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
# ------------------------- SLIDER placement element ------------------------- #
elif element_type == ELEM_TYPE_INPUT_SLIDER:
element = element # type: Slider
- slider_length = element_size[0] * CharWidthInPixels()
+ slider_length = element_size[0] * _char_width_in_pixels(font)
slider_width = element_size[1]
element.TKIntVar = tk.IntVar()
element.TKIntVar.set(element.DefaultValue)
- if element.Orientation[0] == 'v':
+ if element.Orientation.startswith('v'):
range_from = element.Range[1]
range_to = element.Range[0]
slider_length += DEFAULT_MARGINS[1] * (element_size[0] * 2) # add in the padding
@@ -8958,9 +10609,9 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
frame = tk.Frame(tk_row_frame)
element.table_frame = frame
height = element.NumRows
- if element.Justification == 'left':
+ if element.Justification.startswith('l'):
anchor = tk.W
- elif element.Justification == 'right':
+ elif element.Justification.startswith('r'):
anchor = tk.E
else:
anchor = tk.CENTER
@@ -8999,19 +10650,19 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
treeview = element.TKTreeview
if element.DisplayRowNumbers:
treeview.heading(element.RowHeaderText, text=element.RowHeaderText) # make a dummy heading
- treeview.column(element.RowHeaderText, width=50, minwidth=10, anchor=anchor, stretch=0)
+ treeview.column(element.RowHeaderText, width=_string_width_in_pixels(font, element.RowHeaderText)+10, minwidth=10, anchor=anchor, stretch=0)
headings = element.ColumnHeadings if element.ColumnHeadings is not None else element.Values[0]
for i, heading in enumerate(headings):
treeview.heading(heading, text=heading)
if element.AutoSizeColumns:
- width = max(column_widths[i], len(heading))
+ width = max(column_widths[i], _string_width_in_pixels(font, heading) + 10)
else:
try:
- width = element.ColumnWidths[i]
+ width = element.ColumnWidths[i] * _char_width_in_pixels(font)
except:
- width = element.DefaultColumnWidth
- treeview.column(heading, width=width * CharWidthInPixels(), minwidth=10, anchor=anchor, stretch=0)
+ width = element.DefaultColumnWidth * _char_width_in_pixels(font)
+ treeview.column(heading, width=width, minwidth=10, anchor=anchor, stretch=0)
# Insert values into the tree
for i, value in enumerate(element.Values):
@@ -9038,6 +10689,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
table_style.configure(style_name, foreground=element.TextColor)
if element.RowHeight is not None:
table_style.configure(style_name, rowheight=element.RowHeight)
+ else:
+ table_style.configure(style_name, rowheight=_char_height_in_pixels(font))
if element.HeaderTextColor is not None and element.HeaderTextColor != COLOR_SYSTEM_DEFAULT:
table_style.configure(style_name+'.Heading', foreground=element.HeaderTextColor)
if element.HeaderBackgroundColor is not None and element.HeaderBackgroundColor != COLOR_SYSTEM_DEFAULT:
@@ -9050,10 +10703,10 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
treeview.configure(style=style_name)
# scrollable_frame.pack(side=tk.LEFT, padx=elementpad[0], pady=elementpad[1], expand=True, fill='both')
- treeview.bind("<>", element.treeview_selected)
+ treeview.bind("<>", element._treeview_selected)
if element.BindReturnKey:
- treeview.bind('', element.treeview_double_click)
- treeview.bind('', element.treeview_double_click)
+ treeview.bind('', element._treeview_double_click)
+ treeview.bind('', element._treeview_double_click)
if not element.HideVerticalScroll:
scrollbar = tk.Scrollbar(frame)
@@ -9086,9 +10739,9 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
frame = tk.Frame(tk_row_frame)
height = element.NumRows
- if element.Justification == 'left': # justification
+ if element.Justification.startswith('l'): # justification
anchor = tk.W
- elif element.Justification == 'right':
+ elif element.Justification.startswith('r'):
anchor = tk.E
else:
anchor = tk.CENTER
@@ -9116,7 +10769,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
width = element.ColumnWidths[i]
except:
width = element.DefaultColumnWidth
- treeview.column(heading, width=width * CharWidthInPixels(), anchor=anchor)
+ treeview.column(heading, width=width * _char_width_in_pixels(font), anchor=anchor)
def add_treeview_data(node):
"""
@@ -9146,7 +10799,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
add_treeview_data(node)
add_treeview_data(element.TreeData.root_node)
- treeview.column('#0', width=element.Col0Width * CharWidthInPixels(), anchor=anchor)
+ treeview.column('#0', width=element.Col0Width * _char_width_in_pixels(font), anchor=anchor)
# ----- configure colors -----
style_name = str(element.Key) + '.Treeview'
tree_style = ttk.Style()
@@ -9176,7 +10829,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
if element.Visible is False:
element.TKTreeview.pack_forget()
frame.pack(side=tk.LEFT, expand=True, padx=0, pady=0)
- treeview.bind("<>", element.treeview_selected)
+ treeview.bind("<>", element._treeview_selected)
if element.Tooltip is not None: # tooltip
element.TooltipObject = ToolTip(element.TKTreeview, text=element.Tooltip,
timeout=DEFAULT_TOOLTIP_TIME)
@@ -9218,8 +10871,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
justification = toplevel_form.TextJustification
else:
justification = DEFAULT_TEXT_JUSTIFICATION
- justify = tk.LEFT if justification == 'left' else tk.CENTER if justification == 'center' else tk.RIGHT
- anchor = tk.NW if justification == 'left' else tk.N if justification == 'center' else tk.NE
+ justify = tk.LEFT if justification.startswith('l') else tk.CENTER if justification.startswith('c') else tk.RIGHT
+ anchor = tk.NW if justification.startswith('l') else tk.N if justification.startswith('c') else tk.NE
# tktext_label = tk.Label(tk_row_frame, textvariable=stringvar, width=width, height=height,
# justify=justify, bd=border_depth, font=font)
tktext_label = element.Widget = tk.Label(tk_row_frame, textvariable=stringvar, width=width,
@@ -9271,21 +10924,19 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
# row_should_expand = False
- tk_row_frame.pack(side=tk.TOP, anchor=anchor, padx=toplevel_form.Margins[0],
+ tk_row_frame.pack(side=tk.TOP, anchor=anchor, padx=0, pady=0,
expand=row_should_expand, fill=tk.BOTH if row_should_expand else tk.NONE)
if form.BackgroundColor is not None and form.BackgroundColor != COLOR_SYSTEM_DEFAULT:
tk_row_frame.configure(background=form.BackgroundColor)
- toplevel_form.TKroot.configure(padx=toplevel_form.Margins[0], pady=toplevel_form.Margins[1])
return
def ConvertFlexToTK(MyFlexForm):
"""
- :param MyFlexForm:
+ :param MyFlexForm: (Window)
"""
- MyFlexForm # type: Window
master = MyFlexForm.TKroot
master.title(MyFlexForm.Title)
InitializeResults(MyFlexForm)
@@ -9297,7 +10948,11 @@ def ConvertFlexToTK(MyFlexForm):
MyFlexForm.TKroot.wm_overrideredirect(True)
except:
pass
+
PackFormIntoFrame(MyFlexForm, master, MyFlexForm)
+
+ MyFlexForm.TKroot.configure(padx=MyFlexForm.Margins[0], pady=MyFlexForm.Margins[1])
+
# ....................................... DONE creating and laying out window ..........................#
if MyFlexForm._Size != (None, None):
master.geometry("%sx%s" % (MyFlexForm._Size[0], MyFlexForm._Size[1]))
@@ -9347,7 +11002,7 @@ def StartupTK(my_flex_form):
# if first window being created, make a throwaway, hidden master root. This stops one user
# window from becoming the child of another user window. All windows are children of this
# hidden window
- Window.IncrementOpenCount()
+ Window._IncrementOpenCount()
Window.hidden_master_root = tk.Tk()
Window.hidden_master_root.attributes('-alpha', 0) # HIDE this window really really really
Window.hidden_master_root.wm_overrideredirect(True)
@@ -9368,7 +11023,7 @@ def StartupTK(my_flex_form):
pass
if my_flex_form.BackgroundColor is not None and my_flex_form.BackgroundColor != COLOR_SYSTEM_DEFAULT:
root.configure(background=my_flex_form.BackgroundColor)
- Window.IncrementOpenCount()
+ Window._IncrementOpenCount()
my_flex_form.TKroot = root
# Make moveable window
@@ -9428,7 +11083,7 @@ def StartupTK(my_flex_form):
my_flex_form.TimerCancelled = True
# print('..... BACK from MainLoop')
if not my_flex_form.FormRemainedOpen:
- Window.DecrementOpenCount()
+ Window._DecrementOpenCount()
# _my_windows.Decrement()
if my_flex_form.RootNeedsDestroying:
try:
@@ -9443,12 +11098,6 @@ def StartupTK(my_flex_form):
# Helper function for determining how to wrap text #
# ===================================================#
def _GetNumLinesNeeded(text, max_line_width):
- """
-
- :param text:
- :param max_line_width:
-
- """
if max_line_width == 0:
return 1
lines = text.split('\n')
@@ -9493,7 +11142,6 @@ METER_STOPPED = False
class QuickMeter(object):
- """ """
active_meters = {}
exit_reasons = {}
@@ -9502,17 +11150,27 @@ class QuickMeter(object):
"""
:param title: text to display in eleemnt
+ :type title: (str)
:param current_value: current value
+ :type current_value: (int)
:param max_value: max value of QuickMeter
+ :type max_value: (int)
:param key: Used with window.FindElement and with return values to uniquely identify this element
+ :type key: Union[str, int, tuple]
:param *args: stuff to output
- :param orientation: 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical')(Default value = 'v')
- :param bar_color: ???????????????????????????????????
+ :type *args: (Any)
+ :param orientation: 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical' / 'v')
+ :type orientation: (str)
+ :param bar_color: color of a bar line
+ :type bar_color: str
:param button_color: button color (foreground, background)
- :param size: Tuple[int, int] (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE)
+ :type button_color: Tuple[str, str]
+ :param size: (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE)
+ :type size: Tuple[int, int]
:param border_width: width of border around element
- :param grab_anywhere: If True can grab anywhere to move the window (Default = False)
-
+ :type border_width: (int)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
"""
self.start_time = datetime.datetime.utcnow()
self.key = key
@@ -9529,11 +11187,6 @@ class QuickMeter(object):
self.window = self.BuildWindow(*args)
def BuildWindow(self, *args):
- """
-
- :param *args:
-
- """
layout = []
if self.orientation.lower().startswith('h'):
col = []
@@ -9559,13 +11212,7 @@ class QuickMeter(object):
return self.window
def UpdateMeter(self, current_value, max_value, *args): ### support for *args when updating
- """
- :param current_value:
- :param max_value:
- :param *args:
-
- """
self.current_value = current_value
self.max_value = max_value
self.window.Element('_PROG_').UpdateBar(self.current_value, self.max_value)
@@ -9582,7 +11229,6 @@ class QuickMeter(object):
return METER_OK
def ComputeProgressStats(self):
- """ """
utc = datetime.datetime.utcnow()
time_delta = utc - self.start_time
total_seconds = time_delta.total_seconds()
@@ -9614,19 +11260,30 @@ class QuickMeter(object):
def OneLineProgressMeter(title, current_value, max_value, key, *args, orientation='v', bar_color=(None, None),
button_color=None, size=DEFAULT_PROGRESS_BAR_SIZE, border_width=None, grab_anywhere=False):
"""
-
- :param title: text to display
- :param current_value: current progressbar value
- :param max_value: max value of progressbar
+ :param title: text to display in eleemnt
+ :type title: (str)
+ :param current_value: current value
+ :type current_value: (int)
+ :param max_value: max value of QuickMeter
+ :type max_value: (int)
:param key: Used with window.FindElement and with return values to uniquely identify this element
- :param *args: stuff to output.
- :param orientation: 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical')(Default value = 'v')
- :param bar_color:
+ :type key: Union[str, int, tuple]
+ :param *args: stuff to output
+ :type *args: (Any)
+ :param orientation: 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical' / 'v')
+ :type orientation: (str)
+ :param bar_color: color of a bar line
+ :type bar_color: str
:param button_color: button color (foreground, background)
- :param size: Tuple[int, int] (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE)
+ :type button_color: Tuple[str, str]
+ :param size: (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE)
+ :type size: Tuple[int, int]
:param border_width: width of border around element
- :param grab_anywhere: If True can grab anywhere to move the window (Default = False)
-
+ :type border_width: (int)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :return: True if updated successfully. False if user closed the meter with the X or Cancel button
+ :rtype: (bool)
"""
if key not in QuickMeter.active_meters:
meter = QuickMeter(title, current_value, max_value, key, *args, orientation=orientation, bar_color=bar_color,
@@ -9642,9 +11299,9 @@ def OneLineProgressMeter(title, current_value, max_value, key, *args, orientatio
def OneLineProgressMeterCancel(key):
"""
+ Cancels and closes a previously created One Line Progress Meter window
- :param key: Used with window.FindElement and with return values to uniquely identify this element
-
+ :param key: Key used when meter was created
"""
try:
meter = QuickMeter.active_meters[key]
@@ -9658,11 +11315,6 @@ def OneLineProgressMeterCancel(key):
# input is #RRGGBB
# output is #RRGGBB
def GetComplimentaryHex(color):
- """
-
- :param color:
-
- """
# strip the # from the beginning
color = color[1:]
# convert the string into hex
@@ -9677,22 +11329,32 @@ def GetComplimentaryHex(color):
# ======================== EasyPrint =====#
# ===================================================#
-class DebugWin():
- """ """
+class _DebugWin():
debug_window = None
def __init__(self, size=(None, None), location=(None, None), font=None, no_titlebar=False, no_button=False,
grab_anywhere=False, keep_on_top=False, do_not_reroute_stdout=True):
"""
- :param size: Tuple[int, int] (w,h) w=characters-wide, h=rows-high
- :param location: (Default = (None))
+ :param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
:param font: specifies the font family, size, etc
- :param no_titlebar: (Default = False)
- :param no_button: (Default = False)
- :param grab_anywhere: If True can grab anywhere to move the window (Default = False)
- :param location: Location on screen to display
- :param do_not_reroute_stdout: (Default = True)
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+
+ :param no_button: show button
+ :type no_button: (bool)
+
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
+ :param do_not_reroute_stdout: ??? (Default = True)
+ :type do_not_reroute_stdout: (bool)
"""
# Show a form that's a running counter
@@ -9706,30 +11368,20 @@ class DebugWin():
self.do_not_reroute_stdout = do_not_reroute_stdout
win_size = size if size != (None, None) else DEFAULT_DEBUG_WINDOW_SIZE
- self.window = Window('Debug Window', no_titlebar=no_titlebar, auto_size_text=True, location=location,
- font=font or ('Courier New', 10), grab_anywhere=grab_anywhere, keep_on_top=keep_on_top)
self.output_element = Multiline(size=win_size, autoscroll=True,
key='_MULTILINE_') if do_not_reroute_stdout else Output(size=win_size)
-
if no_button:
self.layout = [[self.output_element]]
else:
- self.layout = [
- [self.output_element],
- [DummyButton('Quit'), Stretch()]
- ]
- self.window.AddRows(self.layout)
- self.window.Read(timeout=0) # Show a non-blocking form, returns immediately
+ self.layout = [ [self.output_element],
+ [DummyButton('Quit'), Stretch()]]
+
+ self.window = Window('Debug Window', self.layout, no_titlebar=no_titlebar, auto_size_text=True, location=location,
+ font=font or ('Courier New', 10), grab_anywhere=grab_anywhere, keep_on_top=keep_on_top, finalize=False)
+ # self.window.NonBlocking = True # if finalizing this window, then need to uncommment this line
return
def Print(self, *args, end=None, sep=None, text_color=None, background_color=None):
- """
-
- :param *args:
- :param end:
- :param sep:
-
- """
sepchar = sep if sep is not None else ' '
endchar = end if end is not None else '\n'
@@ -9743,6 +11395,8 @@ class DebugWin():
self.__init__(size=self.size, location=self.location, font=self.font, no_titlebar=self.no_titlebar,
no_button=self.no_button, grab_anywhere=self.grab_anywhere, keep_on_top=self.keep_on_top,
do_not_reroute_stdout=self.do_not_reroute_stdout)
+ event, values = self.window.Read(timeout=0)
+ # print(f'Printing {ObjToStringSingleObj(self.output_element)}')
if self.do_not_reroute_stdout:
outstring = ''
for arg in args:
@@ -9753,39 +11407,53 @@ class DebugWin():
print(*args, sep=sepchar, end=endchar)
def Close(self):
- """ """
+ if self.window.XFound: # increment the number of open windows to get around a bug with debug windows
+ Window._IncrementOpenCount()
self.window.Close()
- del self.window
self.window = None
def PrintClose():
- """ """
EasyPrintClose()
def EasyPrint(*args, size=(None, None), end=None, sep=None, location=(None, None), font=None, no_titlebar=False,
no_button=False, grab_anywhere=False, keep_on_top=False, do_not_reroute_stdout=True, text_color=None, background_color=None):
"""
-
- :param *args:
- :param size: Tuple[int, int] (w,h) w=characters-wide, h=rows-high
- :param end:
- :param sep:
- :param location: (Default = (None))
+ :param *args: stuff to output
+ :type *args: (Any)
+ :param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
+ :param sep: end character
+ :type end: (str)
+ :param sep: separator character
+ :type sep: (str)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
:param font: specifies the font family, size, etc
- :param no_titlebar: (Default = False)
- :param no_button: (Default = False)
- :param grab_anywhere: If True can grab anywhere to move the window (Default = False)
- :param location: Location on screen to display
- :param do_not_reroute_stdout: (Default = True)
-
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+ :param no_button: don't show button
+ :type no_button: (bool)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param keep_on_top: If True the window will remain above all current windows
+ :type keep_on_top: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
+ :param do_not_reroute_stdout: do not reroute stdout
+ :type do_not_reroute_stdout: (bool)
"""
- if DebugWin.debug_window is None:
- DebugWin.debug_window = DebugWin(size=size, location=location, font=font, no_titlebar=no_titlebar,
- no_button=no_button, grab_anywhere=grab_anywhere, keep_on_top=keep_on_top,
- do_not_reroute_stdout=do_not_reroute_stdout)
- DebugWin.debug_window.Print(*args, end=end, sep=sep, text_color=text_color, background_color=background_color)
+ if _DebugWin.debug_window is None:
+ _DebugWin.debug_window = _DebugWin(size=size, location=location, font=font, no_titlebar=no_titlebar,
+ no_button=no_button, grab_anywhere=grab_anywhere, keep_on_top=keep_on_top,
+ do_not_reroute_stdout=do_not_reroute_stdout)
+ _DebugWin.debug_window.Print(*args, end=end, sep=sep, text_color=text_color, background_color=background_color)
Print = EasyPrint
@@ -9793,10 +11461,39 @@ eprint = EasyPrint
def EasyPrintClose():
- """ """
- if DebugWin.debug_window is not None:
- DebugWin.debug_window.Close()
- DebugWin.debug_window = None
+ if _DebugWin.debug_window is not None:
+ _DebugWin.debug_window.Close()
+ _DebugWin.debug_window = None
+
+# ------------------------------------------------------------------------------------------------ #
+# A print-like call that can be used to output to a multiline element as if it's an Output element #
+# ------------------------------------------------------------------------------------------------ #
+
+def _print_to_element(multiline_element, *args, end=None, sep=None, text_color=None, background_color=None):
+ """
+ Print like Python normally prints except route the output to a multline element and also add colors if desired
+
+ :param multiline_element: The multiline element to be output to
+ :type multiline_element: (Multiline)
+ :param args: The arguments to print
+ :type args: List[Any]
+ :param end: The end char to use just like print uses
+ :type end: (str)
+ :param sep: The separation character like print uses
+ :type sep: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param background_color: The background color of the line
+ :type background_color: (str)
+ """
+ sepchar = sep if sep is not None else ' '
+ endchar = end if end is not None else '\n'
+
+ outstring = ''
+ for arg in args:
+ outstring += str(arg) + sepchar
+ outstring += endchar
+ multiline_element.update(outstring, append=True, text_color_for_value=text_color, background_color_for_value=background_color)
# ============================== SetGlobalIcon ======#
@@ -9810,7 +11507,7 @@ def SetGlobalIcon(icon):
:param icon: Union[bytes, str] Either a Base64 byte string or a filename
"""
- Window.user_defined_icon = icon
+ Window._user_defined_icon = icon
# ============================== SetOptions =========#
@@ -9828,43 +11525,73 @@ def SetOptions(icon=None, button_color=None, element_size=(None, None), button_e
scrollbar_color=None, text_color=None, element_text_color=None, debug_win_size=(None, None),
window_location=(None, None), error_button_color=(None, None), tooltip_time=None, use_ttk_buttons=None, ttk_theme=None):
"""
-
- :param icon: filename of icon used for taskbar and title bar
- :param button_color: button color (foreground, background)
- :param element_size: Tuple[int, int] element size (width, height) in characters
- :param button_element_size: Tuple[int, int]
- :param margins: tkinter margins around outsize (Default = (None))
- :param element_padding: (Default = (None))
- :param auto_size_text: True if size should fit the text length
- :param auto_size_buttons:
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
+ :param button_color: Color of the button (text, background)
+ :type button_color: Tuple[str, str]
+ :param element_size: element size (width, height) in characters
+ :type element_size: Tuple[int, int]
+ :param button_element_size: Size of button
+ :type button_element_size: Tuple[int, int]
+ :param margins: (left/right, top/bottom) tkinter margins around outsize. Amount of pixels to leave inside the window's frame around the edges before your elements are shown.
+ :type margins: Tuple[int, int]
+ :param element_padding: Default amount of padding to put around elements in window (left/right, top/bottom) or ((left, right), (top, bottom))
+ :type element_padding: Tuple[int, int] or ((int, int),(int,int))
+ :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
+ :param auto_size_buttons: True if Buttons in this Window should be sized to exactly fit the text on this.
+ :type auto_size_buttons: (bool)
:param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param border_width: width of border around element
- :param slider_border_width:
- :param slider_relief:
- :param slider_orientation:
- :param autoclose_time:
- :param message_box_line_width:
- :param progress_meter_border_depth:
- :param progress_meter_style:
+ :type border_width: (int)
+ :param slider_border_width: ???
+ :type slider_border_width: ???
+ :param slider_relief: ???
+ :type slider_relief: ???
+ :param slider_orientation: ???
+ :type slider_orientation: ???
+ :param autoclose_time: ???
+ :type autoclose_time: ???
+ :param message_box_line_width: ???
+ :type message_box_line_width: ???
+ :param progress_meter_border_depth: ???
+ :type progress_meter_border_depth: ???
+
+ :param progress_meter_style: You can no longer set a progress bar style. All ttk styles must be the same for the window
+ :type progress_meter_style: ---
+
:param progress_meter_relief:
:param progress_meter_color:
- :param progress_meter_size: Tuple[int, int]
- :param text_justification:
+ :param progress_meter_size:
+ :param text_justification: Union ['left', 'right', 'center'] Default text justification for all Text Elements in window
+ :type text_justification: (str)
:param background_color: color of background
- :param element_background_color:
- :param text_element_background_color:
+ :type background_color: (str)
+ :param element_background_color: element background color
+ :type element_background_color: (str)
+ :param text_element_background_color: text element background color
+ :type text_element_background_color: (str)
:param input_elements_background_color:
:param input_text_color:
:param scrollbar_color:
:param text_color: color of the text
- :param element_text_color:
- :param debug_win_size: Tuple[int, int] (Default = (None))
+ :type text_color: (str)
+ :param element_text_color: ???
+ :type element_text_color: ???
+ :param debug_win_size: (Default = (None))
+ :type debug_win_size: Tuple[int, int]
:param window_location: (Default = (None))
+ :type window_location: ???
:param error_button_color: (Default = (None))
+ :type error_button_color: ???
:param tooltip_time: time in milliseconds to wait before showing a tooltip. Default is 400ms
- :param use_ttk_buttons: (bool) if True will cause all buttons to be ttk buttons
+ :type tooltip_time: (int)
+ :param use_ttk_buttons: if True will cause all buttons to be ttk buttons
+ :type use_ttk_buttons: (bool)
:param ttk_theme: (str) Theme to use with ttk widgets. Choices (on Windows) include - 'default', 'winnative', 'clam', 'alt', 'classic', 'vista', 'xpnative'
-
+ :type ttk_theme: (str)
+ ==============
"""
global DEFAULT_ELEMENT_SIZE
global DEFAULT_BUTTON_ELEMENT_SIZE
@@ -9903,8 +11630,8 @@ def SetOptions(icon=None, button_color=None, element_size=(None, None), button_e
# global _my_windows
if icon:
- Window.user_defined_icon = icon
- # _my_windows.user_defined_icon = icon
+ Window._user_defined_icon = icon
+ # _my_windows._user_defined_icon = icon
if button_color != None:
DEFAULT_BUTTON_COLOR = button_color
@@ -10011,6 +11738,19 @@ def SetOptions(icon=None, button_color=None, element_size=(None, None), button_e
return True
+# ----------------------------------------------------------------- #
+
+# .########.##.....##.########.##.....##.########..######.
+# ....##....##.....##.##.......###...###.##.......##....##
+# ....##....##.....##.##.......####.####.##.......##......
+# ....##....#########.######...##.###.##.######....######.
+# ....##....##.....##.##.......##.....##.##.............##
+# ....##....##.....##.##.......##.....##.##.......##....##
+# ....##....##.....##.########.##.....##.########..######.
+
+# ----------------------------------------------------------------- #
+
+# The official Theme code
#################### ChangeLookAndFeel #######################
# Predefined settings that will change the colors and styles #
@@ -10038,6 +11778,17 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'BORDER': 1, 'SLIDER_DEPTH': 1,
'PROGRESS_DEPTH': 0},
+ 'SystemDefault1':
+ {'BACKGROUND': COLOR_SYSTEM_DEFAULT,
+ 'TEXT': COLOR_SYSTEM_DEFAULT,
+ 'INPUT': COLOR_SYSTEM_DEFAULT,
+ 'TEXT_INPUT': COLOR_SYSTEM_DEFAULT,
+ 'SCROLL': COLOR_SYSTEM_DEFAULT,
+ 'BUTTON': COLOR_SYSTEM_DEFAULT,
+ 'PROGRESS': COLOR_SYSTEM_DEFAULT,
+ 'BORDER': 1, 'SLIDER_DEPTH': 1,
+ 'PROGRESS_DEPTH': 0},
+
'Material1': {'BACKGROUND': '#E3F2FD',
'TEXT': '#000000',
'INPUT': '#86A8FF',
@@ -10069,7 +11820,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'INPUT': '#dae0e6',
'TEXT_INPUT': '#222222',
'SCROLL': '#a5a4a4',
- 'BUTTON': ('white', '#0079d3'),
+ 'BUTTON': ('#FFFFFF', '#0079d3'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10094,30 +11845,30 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'GreenTan': {'BACKGROUND': '#9FB8AD',
'TEXT': COLOR_SYSTEM_DEFAULT,
- 'INPUT': '#F7F3EC', 'TEXT_INPUT': 'black',
+ 'INPUT': '#F7F3EC', 'TEXT_INPUT': '#000000',
'SCROLL': '#F7F3EC',
- 'BUTTON': ('white', '#475841'),
+ 'BUTTON': ('#FFFFFF', '#475841'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'Dark': {'BACKGROUND': '#404040',
- 'TEXT': 'white',
+ 'TEXT': '#FFFFFF',
'INPUT': '#4D4D4D',
- 'TEXT_INPUT': 'white',
+ 'TEXT_INPUT': '#FFFFFF',
'SCROLL': '#707070',
- 'BUTTON': ('white', '#004F00'),
+ 'BUTTON': ('#FFFFFF', '#004F00'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'LightGreen': {'BACKGROUND': '#B7CECE',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#FDFFF7',
- 'TEXT_INPUT': 'black',
+ 'TEXT_INPUT': '#000000',
'SCROLL': '#FDFFF7',
- 'BUTTON': ('white', '#658268'),
+ 'BUTTON': ('#FFFFFF', '#658268'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10127,22 +11878,22 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'PROGRESS_DEPTH': 0},
'Dark2': {'BACKGROUND': '#404040',
- 'TEXT': 'white',
- 'INPUT': 'white',
- 'TEXT_INPUT': 'black',
+ 'TEXT': '#FFFFFF',
+ 'INPUT': '#FFFFFF',
+ 'TEXT_INPUT': '#000000',
'SCROLL': '#707070',
- 'BUTTON': ('white', '#004F00'),
+ 'BUTTON': ('#FFFFFF', '#004F00'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
- 'Black': {'BACKGROUND': 'black',
- 'TEXT': 'white',
+ 'Black': {'BACKGROUND': '#000000',
+ 'TEXT': '#FFFFFF',
'INPUT': '#4D4D4D',
- 'TEXT_INPUT': 'white',
+ 'TEXT_INPUT': '#FFFFFF',
'SCROLL': '#707070',
- 'BUTTON': ('black', 'white'),
+ 'BUTTON': ('#000000', '#FFFFFF'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10153,7 +11904,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'INPUT': '#eee8d5',
'TEXT_INPUT': '#6c71c3',
'SCROLL': '#eee8d5',
- 'BUTTON': ('white', '#063542'),
+ 'BUTTON': ('#FFFFFF', '#063542'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10164,7 +11915,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'INPUT': '#f9f8f4',
'TEXT_INPUT': '#242834',
'SCROLL': '#eee8d5',
- 'BUTTON': ('white', '#063289'),
+ 'BUTTON': ('#FFFFFF', '#063289'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10173,9 +11924,9 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'DarkTanBlue': {'BACKGROUND': '#242834',
'TEXT': '#dfe6f8',
'INPUT': '#97755c',
- 'TEXT_INPUT': 'white',
+ 'TEXT_INPUT': '#FFFFFF',
'SCROLL': '#a9afbb',
- 'BUTTON': ('white', '#063289'),
+ 'BUTTON': ('#FFFFFF', '#063289'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10186,7 +11937,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'INPUT': '#705e52',
'TEXT_INPUT': '#fdcb52',
'SCROLL': '#705e52',
- 'BUTTON': ('black', '#fdcb52'),
+ 'BUTTON': ('#000000', '#fdcb52'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10197,28 +11948,28 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'INPUT': '#335267',
'TEXT_INPUT': '#acc2d0',
'SCROLL': '#1b6497',
- 'BUTTON': ('black', '#fafaf8'),
+ 'BUTTON': ('#000000', '#fafaf8'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'Reds': {'BACKGROUND': '#280001',
- 'TEXT': 'white',
+ 'TEXT': '#FFFFFF',
'INPUT': '#d8d584',
- 'TEXT_INPUT': 'black',
+ 'TEXT_INPUT': '#000000',
'SCROLL': '#763e00',
- 'BUTTON': ('black', '#daad28'),
+ 'BUTTON': ('#000000', '#daad28'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'Green': {'BACKGROUND': '#82a459',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#d8d584',
- 'TEXT_INPUT': 'black',
+ 'TEXT_INPUT': '#000000',
'SCROLL': '#e3ecf3',
- 'BUTTON': ('white', '#517239'),
+ 'BUTTON': ('#FFFFFF', '#517239'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10227,86 +11978,86 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'BluePurple': {'BACKGROUND': '#A5CADD',
'TEXT': '#6E266E',
'INPUT': '#E0F5FF',
- 'TEXT_INPUT': 'black',
+ 'TEXT_INPUT': '#000000',
'SCROLL': '#E0F5FF',
- 'BUTTON': ('white', '#303952'),
+ 'BUTTON': ('#FFFFFF', '#303952'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'Purple': {'BACKGROUND': '#B0AAC2',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#F2EFE8',
'SCROLL': '#F2EFE8',
- 'TEXT_INPUT': 'black',
- 'BUTTON': ('black', '#C2D4D8'),
+ 'TEXT_INPUT': '#000000',
+ 'BUTTON': ('#000000', '#C2D4D8'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'BlueMono': {'BACKGROUND': '#AAB6D3',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#F1F4FC',
'SCROLL': '#F1F4FC',
- 'TEXT_INPUT': 'black',
- 'BUTTON': ('white', '#7186C7'),
+ 'TEXT_INPUT': '#000000',
+ 'BUTTON': ('#FFFFFF', '#7186C7'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'GreenMono': {'BACKGROUND': '#A8C1B4',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#DDE0DE',
'SCROLL': '#E3E3E3',
- 'TEXT_INPUT': 'black',
- 'BUTTON': ('white', '#6D9F85'),
+ 'TEXT_INPUT': '#000000',
+ 'BUTTON': ('#FFFFFF', '#6D9F85'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'BrownBlue': {'BACKGROUND': '#64778d',
- 'TEXT': 'white',
+ 'TEXT': '#FFFFFF',
'INPUT': '#f0f3f7',
'SCROLL': '#A6B2BE',
- 'TEXT_INPUT': 'black',
- 'BUTTON': ('white', '#283b5b'),
+ 'TEXT_INPUT': '#000000',
+ 'BUTTON': ('#FFFFFF', '#283b5b'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'BrightColors': {'BACKGROUND': '#b4ffb4',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#ffff64',
'SCROLL': '#ffb482',
- 'TEXT_INPUT': 'black',
- 'BUTTON': ('black', '#ffa0dc'),
+ 'TEXT_INPUT': '#000000',
+ 'BUTTON': ('#000000', '#ffa0dc'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'NeutralBlue': {'BACKGROUND': '#92aa9d',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#fcfff6',
'SCROLL': '#fcfff6',
- 'TEXT_INPUT': 'black',
- 'BUTTON': ('black', '#d0dbbd'),
+ 'TEXT_INPUT': '#000000',
+ 'BUTTON': ('#000000', '#d0dbbd'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'Kayak': {'BACKGROUND': '#a7ad7f',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#e6d3a8',
'SCROLL': '#e6d3a8',
- 'TEXT_INPUT': 'black',
- 'BUTTON': ('white', '#5d907d'),
+ 'TEXT_INPUT': '#000000',
+ 'BUTTON': ('#FFFFFF', '#5d907d'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10317,17 +12068,17 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'INPUT': '#e6d3a8',
'SCROLL': '#e6d3a8',
'TEXT_INPUT': '#012f2f',
- 'BUTTON': ('white', '#046380'),
+ 'BUTTON': ('#FFFFFF', '#046380'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'TealMono': {'BACKGROUND': '#a8cfdd',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#dfedf2',
'SCROLL': '#dfedf2',
- 'TEXT_INPUT': 'black',
- 'BUTTON': ('white', '#183440'),
+ 'TEXT_INPUT': '#000000',
+ 'BUTTON': ('#FFFFFF', '#183440'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10397,7 +12148,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'INPUT': '#dae0e6',
'TEXT_INPUT': '#222222',
'SCROLL': '#a5a4a4',
- 'BUTTON': ('white', '#0079d3'),
+ 'BUTTON': ('#FFFFFF', '#0079d3'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10422,30 +12173,30 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'LightGreen1': {'BACKGROUND': '#9FB8AD',
'TEXT': COLOR_SYSTEM_DEFAULT,
- 'INPUT': '#F7F3EC', 'TEXT_INPUT': 'black',
+ 'INPUT': '#F7F3EC', 'TEXT_INPUT': '#000000',
'SCROLL': '#F7F3EC',
- 'BUTTON': ('white', '#475841'),
+ 'BUTTON': ('#FFFFFF', '#475841'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'DarkGrey': {'BACKGROUND': '#404040',
- 'TEXT': 'white',
+ 'TEXT': '#FFFFFF',
'INPUT': '#4D4D4D',
- 'TEXT_INPUT': 'white',
+ 'TEXT_INPUT': '#FFFFFF',
'SCROLL': '#707070',
- 'BUTTON': ('white', '#004F00'),
+ 'BUTTON': ('#FFFFFF', '#004F00'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'LightGreen2': {'BACKGROUND': '#B7CECE',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#FDFFF7',
- 'TEXT_INPUT': 'black',
+ 'TEXT_INPUT': '#000000',
'SCROLL': '#FDFFF7',
- 'BUTTON': ('white', '#658268'),
+ 'BUTTON': ('#FFFFFF', '#658268'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10455,22 +12206,22 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'PROGRESS_DEPTH': 0},
'DarkGrey1': {'BACKGROUND': '#404040',
- 'TEXT': 'white',
- 'INPUT': 'white',
- 'TEXT_INPUT': 'black',
+ 'TEXT': '#FFFFFF',
+ 'INPUT': '#FFFFFF',
+ 'TEXT_INPUT': '#000000',
'SCROLL': '#707070',
- 'BUTTON': ('white', '#004F00'),
+ 'BUTTON': ('#FFFFFF', '#004F00'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
- 'DarkBlack': {'BACKGROUND': 'black',
- 'TEXT': 'white',
+ 'DarkBlack': {'BACKGROUND': '#000000',
+ 'TEXT': '#FFFFFF',
'INPUT': '#4D4D4D',
- 'TEXT_INPUT': 'white',
+ 'TEXT_INPUT': '#FFFFFF',
'SCROLL': '#707070',
- 'BUTTON': ('black', 'white'),
+ 'BUTTON': ('#000000', '#FFFFFF'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10481,7 +12232,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'INPUT': '#eee8d5',
'TEXT_INPUT': '#6c71c3',
'SCROLL': '#eee8d5',
- 'BUTTON': ('white', '#063542'),
+ 'BUTTON': ('#FFFFFF', '#063542'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10492,7 +12243,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'INPUT': '#f9f8f4',
'TEXT_INPUT': '#242834',
'SCROLL': '#eee8d5',
- 'BUTTON': ('white', '#063289'),
+ 'BUTTON': ('#FFFFFF', '#063289'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10501,9 +12252,9 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'DarkBlue1': {'BACKGROUND': '#242834',
'TEXT': '#dfe6f8',
'INPUT': '#97755c',
- 'TEXT_INPUT': 'white',
+ 'TEXT_INPUT': '#FFFFFF',
'SCROLL': '#a9afbb',
- 'BUTTON': ('white', '#063289'),
+ 'BUTTON': ('#FFFFFF', '#063289'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10514,7 +12265,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'INPUT': '#705e52',
'TEXT_INPUT': '#fdcb52',
'SCROLL': '#705e52',
- 'BUTTON': ('black', '#fdcb52'),
+ 'BUTTON': ('#000000', '#fdcb52'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10525,28 +12276,28 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'INPUT': '#335267',
'TEXT_INPUT': '#acc2d0',
'SCROLL': '#1b6497',
- 'BUTTON': ('black', '#fafaf8'),
+ 'BUTTON': ('#000000', '#fafaf8'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'DarkBrown2': {'BACKGROUND': '#280001',
- 'TEXT': 'white',
+ 'TEXT': '#FFFFFF',
'INPUT': '#d8d584',
- 'TEXT_INPUT': 'black',
+ 'TEXT_INPUT': '#000000',
'SCROLL': '#763e00',
- 'BUTTON': ('black', '#daad28'),
+ 'BUTTON': ('#000000', '#daad28'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'DarkGreen': {'BACKGROUND': '#82a459',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#d8d584',
- 'TEXT_INPUT': 'black',
+ 'TEXT_INPUT': '#000000',
'SCROLL': '#e3ecf3',
- 'BUTTON': ('white', '#517239'),
+ 'BUTTON': ('#FFFFFF', '#517239'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10555,86 +12306,86 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'LightBlue1': {'BACKGROUND': '#A5CADD',
'TEXT': '#6E266E',
'INPUT': '#E0F5FF',
- 'TEXT_INPUT': 'black',
+ 'TEXT_INPUT': '#000000',
'SCROLL': '#E0F5FF',
- 'BUTTON': ('white', '#303952'),
+ 'BUTTON': ('#FFFFFF', '#303952'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'LightPurple': {'BACKGROUND': '#B0AAC2',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#F2EFE8',
'SCROLL': '#F2EFE8',
- 'TEXT_INPUT': 'black',
- 'BUTTON': ('black', '#C2D4D8'),
+ 'TEXT_INPUT': '#000000',
+ 'BUTTON': ('#000000', '#C2D4D8'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'LightBlue2': {'BACKGROUND': '#AAB6D3',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#F1F4FC',
'SCROLL': '#F1F4FC',
- 'TEXT_INPUT': 'black',
- 'BUTTON': ('white', '#7186C7'),
+ 'TEXT_INPUT': '#000000',
+ 'BUTTON': ('#FFFFFF', '#7186C7'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'LightGreen3': {'BACKGROUND': '#A8C1B4',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#DDE0DE',
'SCROLL': '#E3E3E3',
- 'TEXT_INPUT': 'black',
- 'BUTTON': ('white', '#6D9F85'),
+ 'TEXT_INPUT': '#000000',
+ 'BUTTON': ('#FFFFFF', '#6D9F85'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'DarkBlue3': {'BACKGROUND': '#64778d',
- 'TEXT': 'white',
+ 'TEXT': '#FFFFFF',
'INPUT': '#f0f3f7',
'SCROLL': '#A6B2BE',
- 'TEXT_INPUT': 'black',
- 'BUTTON': ('white', '#283b5b'),
+ 'TEXT_INPUT': '#000000',
+ 'BUTTON': ('#FFFFFF', '#283b5b'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'LightGreen4': {'BACKGROUND': '#b4ffb4',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#ffff64',
'SCROLL': '#ffb482',
- 'TEXT_INPUT': 'black',
- 'BUTTON': ('black', '#ffa0dc'),
+ 'TEXT_INPUT': '#000000',
+ 'BUTTON': ('#000000', '#ffa0dc'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'LightGreen5': {'BACKGROUND': '#92aa9d',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#fcfff6',
'SCROLL': '#fcfff6',
- 'TEXT_INPUT': 'black',
- 'BUTTON': ('black', '#d0dbbd'),
+ 'TEXT_INPUT': '#000000',
+ 'BUTTON': ('#000000', '#d0dbbd'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'LightBrown2': {'BACKGROUND': '#a7ad7f',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#e6d3a8',
'SCROLL': '#e6d3a8',
- 'TEXT_INPUT': 'black',
- 'BUTTON': ('white', '#5d907d'),
+ 'TEXT_INPUT': '#000000',
+ 'BUTTON': ('#FFFFFF', '#5d907d'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10645,17 +12396,17 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'INPUT': '#e6d3a8',
'SCROLL': '#e6d3a8',
'TEXT_INPUT': '#012f2f',
- 'BUTTON': ('white', '#046380'),
+ 'BUTTON': ('#FFFFFF', '#046380'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0},
'LightBlue3': {'BACKGROUND': '#a8cfdd',
- 'TEXT': 'black',
+ 'TEXT': '#000000',
'INPUT': '#dfedf2',
'SCROLL': '#dfedf2',
- 'TEXT_INPUT': 'black',
- 'BUTTON': ('white', '#183440'),
+ 'TEXT_INPUT': '#000000',
+ 'BUTTON': ('#FFFFFF', '#183440'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR,
'BORDER': 1,
'SLIDER_DEPTH': 0,
@@ -10665,11 +12416,11 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
#
'LightBrown4': {'BACKGROUND': '#d7c79e', 'TEXT': '#a35638', 'INPUT': '#9dab86', 'TEXT_INPUT': '#000000', 'SCROLL': '#a35638',
- 'BUTTON': ('white', '#a35638'),
+ 'BUTTON': ('#FFFFFF', '#a35638'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#a35638', '#9dab86', '#e08f62', '#d7c79e'], },
'DarkTeal': {'BACKGROUND': '#003f5c', 'TEXT': '#fb5b5a', 'INPUT': '#bc4873', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#bc4873',
- 'BUTTON': ('white', '#fb5b5a'),
+ 'BUTTON': ('#FFFFFF', '#fb5b5a'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#003f5c', '#472b62', '#bc4873', '#fb5b5a'], },
'DarkPurple': {'BACKGROUND': '#472b62', 'TEXT': '#fb5b5a', 'INPUT': '#bc4873', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#bc4873',
@@ -10677,7 +12428,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#003f5c', '#472b62', '#bc4873', '#fb5b5a'], },
'LightGreen6': {'BACKGROUND': '#eafbea', 'TEXT': '#1f6650', 'INPUT': '#6f9a8d', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#1f6650',
- 'BUTTON': ('white', '#1f6650'),
+ 'BUTTON': ('#FFFFFF', '#1f6650'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#1f6650', '#6f9a8d', '#ea5e5e', '#eafbea'], },
'DarkGrey2': {'BACKGROUND': '#2b2b28', 'TEXT': '#f8f8f8', 'INPUT': '#f1d6ab', 'TEXT_INPUT': '#000000', 'SCROLL': '#f1d6ab',
@@ -10685,7 +12436,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#2b2b28', '#e3b04b', '#f1d6ab', '#f8f8f8'], },
'LightBrown6': {'BACKGROUND': '#f9b282', 'TEXT': '#8f4426', 'INPUT': '#de6b35', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#8f4426',
- 'BUTTON': ('white', '#8f4426'),
+ 'BUTTON': ('#FFFFFF', '#8f4426'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#8f4426', '#de6b35', '#64ccda', '#f9b282'], },
'DarkTeal1': {'BACKGROUND': '#396362', 'TEXT': '#ffe7d1', 'INPUT': '#f6c89f', 'TEXT_INPUT': '#000000', 'SCROLL': '#f6c89f',
@@ -10693,7 +12444,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#396362', '#4b8e8d', '#f6c89f', '#ffe7d1'], },
'LightBrown7': {'BACKGROUND': '#f6c89f', 'TEXT': '#396362', 'INPUT': '#4b8e8d', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#396362',
- 'BUTTON': ('white', '#396362'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
+ 'BUTTON': ('#FFFFFF', '#396362'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#396362', '#4b8e8d', '#f6c89f', '#ffe7d1'], },
'DarkPurple1': {'BACKGROUND': '#0c093c', 'TEXT': '#fad6d6', 'INPUT': '#eea5f6', 'TEXT_INPUT': '#000000', 'SCROLL': '#eea5f6',
@@ -10713,7 +12464,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#494ca2', '#8186d5', '#c6cbef', '#e3e7f1'], },
'LightBlue4': {'BACKGROUND': '#5c94bd', 'TEXT': '#470938', 'INPUT': '#1a3e59', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#470938',
- 'BUTTON': ('white', '#470938'),
+ 'BUTTON': ('#FFFFFF', '#470938'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#470938', '#1a3e59', '#5c94bd', '#f2d6eb'], },
'DarkTeal2': {'BACKGROUND': '#394a6d', 'TEXT': '#c0ffb3', 'INPUT': '#52de97', 'TEXT_INPUT': '#000000', 'SCROLL': '#52de97',
@@ -10729,7 +12480,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#730068', '#434982', '#01d28e', '#f6f078'], },
'DarkPurple2': {'BACKGROUND': '#202060', 'TEXT': '#b030b0', 'INPUT': '#602080', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#602080',
- 'BUTTON': ('white', '#202040'),
+ 'BUTTON': ('#FFFFFF', '#202040'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#202040', '#202060', '#602080', '#b030b0'], },
'DarkBlue5': {'BACKGROUND': '#000272', 'TEXT': '#ff6363', 'INPUT': '#a32f80', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#a32f80',
@@ -10761,7 +12512,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#6e2142', '#943855', '#e16363', '#ffd692'], },
'LightBrown10': {'BACKGROUND': '#ffd692', 'TEXT': '#6e2142', 'INPUT': '#943855', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#6e2142',
- 'BUTTON': ('white', '#6e2142'),
+ 'BUTTON': ('#FFFFFF', '#6e2142'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#6e2142', '#943855', '#e16363', '#ffd692'], },
'DarkPurple4': {'BACKGROUND': '#200f21', 'TEXT': '#f638dc', 'INPUT': '#5a3d5c', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#5a3d5c',
@@ -10769,7 +12520,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#200f21', '#382039', '#5a3d5c', '#f638dc'], },
'LightBlue5': {'BACKGROUND': '#b2fcff', 'TEXT': '#3e64ff', 'INPUT': '#5edfff', 'TEXT_INPUT': '#000000', 'SCROLL': '#3e64ff',
- 'BUTTON': ('white', '#3e64ff'),
+ 'BUTTON': ('#FFFFFF', '#3e64ff'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#3e64ff', '#5edfff', '#b2fcff', '#ecfcff'], },
'DarkTeal4': {'BACKGROUND': '#464159', 'TEXT': '#c7f0db', 'INPUT': '#8bbabb', 'TEXT_INPUT': '#000000', 'SCROLL': '#8bbabb',
@@ -10777,7 +12528,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#464159', '#6c7b95', '#8bbabb', '#c7f0db'], },
'LightTeal': {'BACKGROUND': '#c7f0db', 'TEXT': '#464159', 'INPUT': '#6c7b95', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#464159',
- 'BUTTON': ('white', '#464159'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
+ 'BUTTON': ('#FFFFFF', '#464159'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#464159', '#6c7b95', '#8bbabb', '#c7f0db'], },
'DarkTeal5': {'BACKGROUND': '#8bbabb', 'TEXT': '#464159', 'INPUT': '#6c7b95', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#464159',
@@ -10793,11 +12544,11 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#672f2f', '#99b19c', '#d7d1c9', '#faf5ef'], },
'LightGrey5': {'BACKGROUND': '#d7d1c9', 'TEXT': '#672f2f', 'INPUT': '#99b19c', 'TEXT_INPUT': '#672f2f', 'SCROLL': '#672f2f',
- 'BUTTON': ('white', '#672f2f'),
+ 'BUTTON': ('#FFFFFF', '#672f2f'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#672f2f', '#99b19c', '#d7d1c9', '#faf5ef'], },
'DarkBrown3': {'BACKGROUND': '#a0855b', 'TEXT': '#f9f6f2', 'INPUT': '#f1d6ab', 'TEXT_INPUT': '#000000', 'SCROLL': '#f1d6ab',
- 'BUTTON': ('white', '#38470b'),
+ 'BUTTON': ('#FFFFFF', '#38470b'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#38470b', '#a0855b', '#f1d6ab', '#f9f6f2'], },
'LightBrown11': {'BACKGROUND': '#f1d6ab', 'TEXT': '#38470b', 'INPUT': '#a0855b', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#38470b',
@@ -10809,11 +12560,11 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#44000d', '#83142c', '#ad1d45', '#f9d276'], },
'DarkTeal6': {'BACKGROUND': '#204969', 'TEXT': '#fff7f7', 'INPUT': '#dadada', 'TEXT_INPUT': '#000000', 'SCROLL': '#dadada',
- 'BUTTON': ('black', '#fff7f7'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
+ 'BUTTON': ('#000000', '#fff7f7'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#204969', '#08ffc8', '#dadada', '#fff7f7'], },
'DarkBrown4': {'BACKGROUND': '#252525', 'TEXT': '#ff0000', 'INPUT': '#af0404', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#af0404',
- 'BUTTON': ('white', '#252525'),
+ 'BUTTON': ('#FFFFFF', '#252525'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#252525', '#414141', '#af0404', '#ff0000'], },
'LightYellow': {'BACKGROUND': '#f4ff61', 'TEXT': '#27aa80', 'INPUT': '#32ff6a', 'TEXT_INPUT': '#000000', 'SCROLL': '#27aa80',
@@ -10826,16 +12577,16 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'COLOR_LIST': ['#2b580c', '#afa939', '#f7b71d', '#fdef96'], },
'LightGreen8': {'BACKGROUND': '#c8dad3', 'TEXT': '#63707e', 'INPUT': '#93b5b3', 'TEXT_INPUT': '#000000', 'SCROLL': '#63707e',
- 'BUTTON': ('white', '#63707e'),
+ 'BUTTON': ('#FFFFFF', '#63707e'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#63707e', '#93b5b3', '#c8dad3', '#f2f6f5'], },
'DarkTeal7': {'BACKGROUND': '#248ea9', 'TEXT': '#fafdcb', 'INPUT': '#aee7e8', 'TEXT_INPUT': '#000000', 'SCROLL': '#aee7e8',
- 'BUTTON': ('black', '#fafdcb'),
+ 'BUTTON': ('#000000', '#fafdcb'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#248ea9', '#28c3d4', '#aee7e8', '#fafdcb'], },
'DarkBlue8': {'BACKGROUND': '#454d66', 'TEXT': '#d9d872', 'INPUT': '#58b368', 'TEXT_INPUT': '#000000', 'SCROLL': '#58b368',
- 'BUTTON': ('black', '#009975'),
+ 'BUTTON': ('#000000', '#009975'),
'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
'COLOR_LIST': ['#009975', '#454d66', '#58b368', '#d9d872'], },
'DarkBlue9': {'BACKGROUND': '#263859', 'TEXT': '#ff6768', 'INPUT': '#6b778d', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#6b778d',
@@ -10874,7 +12625,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'LightGray1': {'BACKGROUND': '#f2f2f2', 'TEXT': '#222831', 'INPUT': '#393e46', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#222831',
'BUTTON': ('#f2f2f2', '#222831'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#222831', '#393e46', '#f96d00', '#f2f2f2'],
- 'DESCRIPTION': ['Black', 'Grey', 'Orange', 'Grey', 'Autumn']},
+ 'DESCRIPTION': ['#000000', 'Grey', 'Orange', 'Grey', 'Autumn']},
'DarkGrey4': {'BACKGROUND': '#52524e', 'TEXT': '#e9e9e5', 'INPUT': '#d4d6c8', 'TEXT_INPUT': '#000000', 'SCROLL': '#d4d6c8',
'BUTTON': ('#FFFFFF', '#9a9b94'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#52524e', '#9a9b94', '#d4d6c8', '#e9e9e5'],
@@ -10886,7 +12637,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'DarkPurple6': {'BACKGROUND': '#070739', 'TEXT': '#e1e099', 'INPUT': '#c327ab', 'TEXT_INPUT': '#e1e099', 'SCROLL': '#c327ab',
'BUTTON': ('#e1e099', '#521477'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#070739', '#521477', '#c327ab', '#e1e099'],
- 'DESCRIPTION': ['Black', 'Purple', 'Yellow', 'Dark']},
+ 'DESCRIPTION': ['#000000', 'Purple', 'Yellow', 'Dark']},
'DarkBlue13': {'BACKGROUND': '#203562', 'TEXT': '#e3e8f8', 'INPUT': '#c0c5cd', 'TEXT_INPUT': '#000000', 'SCROLL': '#c0c5cd',
'BUTTON': ('#FFFFFF', '#3e588f'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#203562', '#3e588f', '#c0c5cd', '#e3e8f8'],
@@ -10898,11 +12649,11 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'DarkGreen3': {'BACKGROUND': '#062121', 'TEXT': '#eeeeee', 'INPUT': '#e4dcad', 'TEXT_INPUT': '#000000', 'SCROLL': '#e4dcad',
'BUTTON': ('#eeeeee', '#181810'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#062121', '#181810', '#e4dcad', '#eeeeee'],
- 'DESCRIPTION': ['Black', 'Black', 'Brown', 'Grey']},
+ 'DESCRIPTION': ['#000000', '#000000', 'Brown', 'Grey']},
'DarkBlack1': {'BACKGROUND': '#181810', 'TEXT': '#eeeeee', 'INPUT': '#e4dcad', 'TEXT_INPUT': '#000000', 'SCROLL': '#e4dcad',
- 'BUTTON': ('white', '#062121'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
+ 'BUTTON': ('#FFFFFF', '#062121'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#062121', '#181810', '#e4dcad', '#eeeeee'],
- 'DESCRIPTION': ['Black', 'Black', 'Brown', 'Grey']},
+ 'DESCRIPTION': ['#000000', '#000000', 'Brown', 'Grey']},
'DarkGrey5': {'BACKGROUND': '#343434', 'TEXT': '#f3f3f3', 'INPUT': '#e9dcbe', 'TEXT_INPUT': '#000000', 'SCROLL': '#e9dcbe',
'BUTTON': ('#FFFFFF', '#8e8b82'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#343434', '#8e8b82', '#e9dcbe', '#f3f3f3'], 'DESCRIPTION': ['Grey', 'Brown']},
@@ -10916,15 +12667,15 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'DarkBlue14': {'BACKGROUND': '#21273d', 'TEXT': '#f1f6f8', 'INPUT': '#b9d4f1', 'TEXT_INPUT': '#000000', 'SCROLL': '#b9d4f1',
'BUTTON': ('#FFFFFF', '#6a759b'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#21273d', '#6a759b', '#b9d4f1', '#f1f6f8'],
- 'DESCRIPTION': ['Blue', 'Black', 'Grey', 'Cold', 'Winter']},
+ 'DESCRIPTION': ['Blue', '#000000', 'Grey', 'Cold', 'Winter']},
'LightBlue6': {'BACKGROUND': '#f1f6f8', 'TEXT': '#21273d', 'INPUT': '#6a759b', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#21273d',
'BUTTON': ('#f1f6f8', '#6a759b'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#21273d', '#6a759b', '#b9d4f1', '#f1f6f8'],
- 'DESCRIPTION': ['Blue', 'Black', 'Grey', 'Cold', 'Winter']},
+ 'DESCRIPTION': ['Blue', '#000000', 'Grey', 'Cold', 'Winter']},
'DarkGreen4': {'BACKGROUND': '#044343', 'TEXT': '#e4e4e4', 'INPUT': '#045757', 'TEXT_INPUT': '#e4e4e4', 'SCROLL': '#045757',
'BUTTON': ('#e4e4e4', '#045757'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#222222', '#044343', '#045757', '#e4e4e4'],
- 'DESCRIPTION': ['Black', 'Turquoise', 'Grey', 'Dark']},
+ 'DESCRIPTION': ['#000000', 'Turquoise', 'Grey', 'Dark']},
'DarkGreen5': {'BACKGROUND': '#1b4b36', 'TEXT': '#e0e7f1', 'INPUT': '#aebd77', 'TEXT_INPUT': '#000000', 'SCROLL': '#aebd77',
'BUTTON': ('#FFFFFF', '#538f6a'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#1b4b36', '#538f6a', '#aebd77', '#e0e7f1'], 'DESCRIPTION': ['Green', 'Grey']},
@@ -10941,7 +12692,7 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#3e3e3e', '#405559', '#68868c', '#ededed'],
'DESCRIPTION': ['Grey', 'Turquoise', 'Winter']},
'LightBlue7': {'BACKGROUND': '#9ed0e0', 'TEXT': '#19483f', 'INPUT': '#5c868e', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#19483f',
- 'BUTTON': ('white', '#19483f'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
+ 'BUTTON': ('#FFFFFF', '#19483f'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#19483f', '#5c868e', '#ff6a38', '#9ed0e0'],
'DESCRIPTION': ['Orange', 'Blue', 'Turquoise']},
'LightGreen10': {'BACKGROUND': '#d8ebb5', 'TEXT': '#205d67', 'INPUT': '#639a67', 'TEXT_INPUT': '#FFFFFF', 'SCROLL': '#205d67',
@@ -10961,15 +12712,15 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#004a7c', '#005691', '#e8f1f5', '#fafafa'],
'DESCRIPTION': ['Grey', 'Blue', 'Cold', 'Winter']},
'LightBrown13': {'BACKGROUND': '#ebf5ee', 'TEXT': '#921224', 'INPUT': '#bdc6b8', 'TEXT_INPUT': '#921224', 'SCROLL': '#921224',
- 'BUTTON': ('white', '#921224'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
+ 'BUTTON': ('#FFFFFF', '#921224'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#921224', '#bdc6b8', '#bce0da', '#ebf5ee'],
'DESCRIPTION': ['Red', 'Blue', 'Grey', 'Vintage', 'Wedding']},
'DarkBlue17': {'BACKGROUND': '#21294c', 'TEXT': '#f9f2d7', 'INPUT': '#f2dea8', 'TEXT_INPUT': '#000000', 'SCROLL': '#f2dea8',
'BUTTON': ('#f9f2d7', '#141829'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#141829', '#21294c', '#f2dea8', '#f9f2d7'],
- 'DESCRIPTION': ['Black', 'Blue', 'Yellow']},
+ 'DESCRIPTION': ['#000000', 'Blue', 'Yellow']},
'DarkBrown6': {'BACKGROUND': '#785e4d', 'TEXT': '#f2eee3', 'INPUT': '#baaf92', 'TEXT_INPUT': '#000000', 'SCROLL': '#baaf92',
- 'BUTTON': ('white', '#785e4d'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
+ 'BUTTON': ('#FFFFFF', '#785e4d'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#785e4d', '#ff8426', '#baaf92', '#f2eee3'],
'DESCRIPTION': ['Grey', 'Brown', 'Orange', 'Autumn']},
'DarkGreen6': {'BACKGROUND': '#5c715e', 'TEXT': '#f2f9f1', 'INPUT': '#ddeedf', 'TEXT_INPUT': '#000000', 'SCROLL': '#ddeedf',
@@ -10987,8 +12738,8 @@ LOOK_AND_FEEL_TABLE = {'SystemDefault':
'LightGrey6': {'BACKGROUND': '#e3e3e3', 'TEXT': '#233142', 'INPUT': '#455d7a', 'TEXT_INPUT': '#e3e3e3', 'SCROLL': '#233142',
'BUTTON': ('#e3e3e3', '#455d7a'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0, 'COLOR_LIST': ['#233142', '#455d7a', '#f95959', '#e3e3e3'],
- 'DESCRIPTION': ['Black', 'Blue', 'Red', 'Grey']},
- 'HotDogStand': {'BACKGROUND': 'red', 'TEXT': 'yellow', 'INPUT': 'yellow', 'TEXT_INPUT': 'black', 'SCROLL': 'yellow',
+ 'DESCRIPTION': ['#000000', 'Blue', 'Red', 'Grey']},
+ 'HotDogStand': {'BACKGROUND': 'red', 'TEXT': 'yellow', 'INPUT': 'yellow', 'TEXT_INPUT': '#000000', 'SCROLL': 'yellow',
'BUTTON': ('red', 'yellow'), 'PROGRESS': DEFAULT_PROGRESS_BAR_COLOR, 'BORDER': 1, 'SLIDER_DEPTH': 0,
'PROGRESS_DEPTH': 0,
},
@@ -11007,8 +12758,8 @@ def theme(new_theme=None):
"""
Sets / Gets the current Theme. If none is specified then returns the current theme.
This call replaces the ChangeLookAndFeel / change_look_and_feel call which only sets the theme.
-
:param new_theme: (str) the new theme name to use
+ :type new_theme: (str)
:return: (str) the currently selected theme
"""
if new_theme is not None:
@@ -11016,58 +12767,150 @@ def theme(new_theme=None):
return CURRENT_LOOK_AND_FEEL
-def theme_background_color():
+def theme_background_color(color=None):
"""
- Returns the background color specified by the current color theme
+ Sets/Returns the background color currently in use
+ Used for Windows and containers (Column, Frame, Tab) and tables
- :return: (str) - color string of the background color defined by current theme
+ :return: (str) - color string of the background color currently in use
"""
- return LOOK_AND_FEEL_TABLE[theme()]['BACKGROUND']
+ if color is not None:
+ set_options(background_color=color)
+ return DEFAULT_BACKGROUND_COLOR
-def theme_text_color():
+def theme_element_background_color(color=None):
"""
- Returns the text color specified by the current color theme
+ Sets/Returns the background color currently in use for all elements except containers
- :return: (str) - color string of the text color defined by current theme
+ :return: (str) - color string of the element background color currently in use
"""
- return LOOK_AND_FEEL_TABLE[theme()]['TEXT']
+ if color is not None:
+ set_options(element_background_color=color)
+ return DEFAULT_ELEMENT_BACKGROUND_COLOR
-def theme_input_background_color():
+def theme_text_color(color=None):
"""
- Returns the input element background color specified by the current color theme
+ Sets/Returns the text color currently in use
- :return: (str) - color string of the input element background color defined by current theme
+ :return: (str) - color string of the text color currently in use
"""
- return LOOK_AND_FEEL_TABLE[theme()]['INPUT']
+ if color is not None:
+ set_options(text_color=color)
+ return DEFAULT_TEXT_COLOR
-def theme_input_text_color():
+def theme_text_element_background_color(color=None):
"""
- Returns the input element text color specified by the current color theme
+ Sets/Returns the background color for text elements
- :return: (str) - color string of the input element text color defined by current theme
+ :return: (str) - color string of the text background color currently in use
"""
- return LOOK_AND_FEEL_TABLE[theme()]['TEXT_INPUT']
+ if color is not None:
+ set_options(text_element_background_color=color)
+ return DEFAULT_TEXT_ELEMENT_BACKGROUND_COLOR
-
-def theme_text_color():
+def theme_input_background_color(color=None):
"""
- Returns the text color specified by the current color theme
+ Sets/Returns the input element background color currently in use
- :return: (str) - color string of the text color defined by current theme
+ :return: (str) - color string of the input element background color currently in use
"""
- return LOOK_AND_FEEL_TABLE[theme()]['TEXT']
+ if color is not None:
+ set_options(input_elements_background_color=color)
+ return DEFAULT_INPUT_ELEMENTS_COLOR
-def theme_button_color():
+def theme_input_text_color(color=None):
"""
- Returns the button color specified by the current color theme
+ Sets/Returns the input element entry color (not the text but the thing that's displaying the text)
- :return: Tuple[str, str] - TUPLE with color strings of the button color defined by current theme (button text color, button background color)
+ :return: (str) - color string of the input element color currently in use
"""
- return LOOK_AND_FEEL_TABLE[theme()]['BUTTON']
+ if color is not None:
+ set_options(input_text_color=color)
+ return DEFAULT_INPUT_TEXT_COLOR
+
+
+
+def theme_button_color(color=None):
+ """
+ Sets/Returns the button color currently in use
+
+ :return: Tuple[str, str] - TUPLE with color strings of the button color currently in use (button text color, button background color)
+ """
+ if color is not None:
+ set_options(button_color=color)
+ return DEFAULT_BUTTON_COLOR
+
+
+def theme_progress_bar_color(color=None):
+ """
+ Sets/Returns the progress bar colors by the current color theme
+
+ :return: Tuple[str, str] - TUPLE with color strings of the ProgressBar color currently in use(button text color, button background color)
+ """
+ if color is not None:
+ set_options(progress_meter_color=color)
+ return DEFAULT_PROGRESS_BAR_COLOR
+
+
+def theme_slider_color(color=None):
+ """
+ Sets/Returns the slider color (used for sliders)
+
+ :return: (str) - color string of the slider color currently in use
+ """
+ if color is not None:
+ set_options(scrollbar_color=color)
+ return DEFAULT_SCROLLBAR_COLOR
+
+
+def theme_border_width(border_width=None):
+ """
+ Sets/Returns the border width currently in use
+ Used by non ttk elements at the moment
+
+ :return: (int) - border width currently in use
+ """
+ if border_width is not None:
+ set_options(border_width=border_width)
+ return DEFAULT_BORDER_WIDTH
+
+
+def theme_slider_border_width(border_width=None):
+ """
+ Sets/Returns the slider border width currently in use
+
+ :return: (int) - border width currently in use
+ """
+ if border_width is not None:
+ set_options(slider_border_width=border_width)
+ return DEFAULT_SLIDER_BORDER_WIDTH
+
+
+def theme_progress_bar_border_width(border_width=None):
+ """
+ Sets/Returns the progress meter border width currently in use
+
+ :return: (int) - border width currently in use
+ """
+ if border_width is not None:
+ set_options(progress_meter_border_depth=border_width)
+ return DEFAULT_PROGRESS_BAR_BORDER_WIDTH
+
+
+
+def theme_element_text_color(color=None):
+ """
+ Sets/Returns the text color used by elements that have text as part of their display (Tables, Trees and Sliders)
+
+ :return: (str) - color string currently in use
+ """
+ if color is not None:
+ set_options(element_text_color=color)
+ return DEFAULT_ELEMENT_TEXT_COLOR
def theme_list():
@@ -11101,8 +12944,10 @@ def ChangeLookAndFeel(index, force=False):
The number will vary for each pair. There are more DarkGrey entries than there are LightYellow for example.
Default = The default settings (only button color is different than system default)
Default1 = The full system default including the button (everything's gray... how sad... don't be all gray... please....)
- :param index: (str) the name of the index into the Look and Feel table (does not have to be exact, can be "fuzzy")
- :param force: (bool) no longer used
+ :param index: the name of the index into the Look and Feel table (does not have to be exact, can be "fuzzy")
+ :type index: (str)
+ :param force: no longer used
+ :type force: (bool)
"""
global CURRENT_LOOK_AND_FEEL
@@ -11130,7 +12975,7 @@ def ChangeLookAndFeel(index, force=False):
ix = lf_values.index(opt2)
else:
ix = randint(0, len(lf_values) - 1)
- print('** Warning - {} Look and Feel value not valid. Change your ChangeLookAndFeel call. **'.format(index))
+ print('** Warning - {} Theme is not a valid theme. Change your theme call. **'.format(index))
print('valid values are', list_of_look_and_feel_values())
print('Instead, please enjoy a random Theme named {}'.format(list_of_look_and_feel_values()[ix]))
@@ -11163,7 +13008,7 @@ def ChangeLookAndFeel(index, force=False):
element_text_color=colors['TEXT'],
input_text_color=colors['TEXT_INPUT'])
except: # most likely an index out of range
- print('** Warning - Look and Feel value not valid. Change your ChangeLookAndFeel call. **')
+ print('** Warning - Theme value not valid. Change your theme call. **')
print('valid values are', list_of_look_and_feel_values())
@@ -11175,17 +13020,17 @@ def preview_all_look_and_feel_themes(columns=12):
"""
# Show a "splash" type message so the user doesn't give up waiting
- popup_quick_message('Hang on for a moment, this will take a bit to create....', background_color='red', text_color='white', auto_close=True, non_blocking=True)
+ popup_quick_message('Hang on for a moment, this will take a bit to create....', background_color='red', text_color='#FFFFFF', auto_close=True, non_blocking=True)
web = False
- WINDOW_BACKGROUND = 'lightblue'
+ win_bg = 'black'
def sample_layout():
return [[Text('Text element'), InputText('Input data here', size=(10, 1))],
[Button('Ok'), Button('Cancel'), Slider((1, 10), orientation='h', size=(5, 15))]]
- layout = [[Text('Here is a complete list of themes', font='Default 18', background_color=WINDOW_BACKGROUND)]]
+ layout = [[Text('Here is a complete list of themes', font='Default 18', background_color=win_bg)]]
names = list_of_look_and_feel_values()
names.sort()
@@ -11199,12 +13044,75 @@ def preview_all_look_and_feel_themes(columns=12):
if row:
layout += [row]
- window = Window('Preview of all Look and Feel choices', layout, background_color=WINDOW_BACKGROUND)
+ window = Window('Preview of all Look and Feel choices', layout, background_color=win_bg)
window.read()
window.close()
- del window
+# ------------------------ Color processing functions ------------------------
+
+def _hex_to_hsl(hex):
+ r,g,b = _hex_to_rgb(hex)
+ return _rgb_to_hsl(r,g,b)
+
+def _hex_to_rgb(hex):
+ hex = hex.lstrip('#')
+ hlen = len(hex)
+ return tuple(int(hex[i:i + hlen // 3], 16) for i in range(0, hlen, hlen // 3))
+
+
+def _rgb_to_hsl(r, g, b):
+ r = float(r)
+ g = float(g)
+ b = float(b)
+ high = max(r, g, b)
+ low = min(r, g, b)
+ h, s, v = ((high + low) / 2,)*3
+ if high == low:
+ h = s = 0.0
+ else:
+ d = high - low
+ l = (high + low) / 2
+ s = d / (2 - high - low) if l > 0.5 else d / (high + low)
+ h = {
+ r: (g - b) / d + (6 if g < b else 0),
+ g: (b - r) / d + 2,
+ b: (r - g) / d + 4,
+ }[high]
+ h /= 6
+ return h, s, v
+
+
+def _hsl_to_rgb(h, s, l):
+ def hue_to_rgb(p, q, t):
+ t += 1 if t < 0 else 0
+ t -= 1 if t > 1 else 0
+ if t < 1/6: return p + (q - p) * 6 * t
+ if t < 1/2: return q
+ if t < 2/3: p + (q - p) * (2/3 - t) * 6
+ return p
+
+ if s == 0:
+ r, g, b = l, l, l
+ else:
+ q = l * (1 + s) if l < 0.5 else l + s - l * s
+ p = 2 * l - q
+ r = hue_to_rgb(p, q, h + 1/3)
+ g = hue_to_rgb(p, q, h)
+ b = hue_to_rgb(p, q, h - 1/3)
+
+ return r, g, b
+
+def _hsv_to_hsl(h, s, v):
+ l = 0.5 * v * (2 - s)
+ s = v * s / (1 - fabs(2*l-1))
+ return h, s, l
+
+def _hsl_to_hsv(h, s, l):
+ v = (2*l + s*(1- fabs(2*l-1)))/2
+ s = 2*(v-l)/v
+ return h, s, v
+
# Converts an object's contents into a nice printable string. Great for dumping debug data
def ObjToStringSingleObj(obj):
"""
@@ -11222,9 +13130,12 @@ def ObjToStringSingleObj(obj):
def ObjToString(obj, extra=' '):
"""
Dumps an Object's values as a formatted string. Very nicely done. Great way to display an object's member variables in human form
- :param obj: (Any) The object to display
+ :param obj: The object to display
+ :type obj: (Any)
:param extra: (Default value = ' ')
- returns (str) Formatted output of the object's values
+ :type extra: (str)
+ :return: Formatted output of the object's values
+ :rtype: (str)
"""
if obj is None:
return 'None'
@@ -11235,15 +13146,6 @@ def ObjToString(obj, extra=' '):
for item in sorted(obj.__dict__)))
-def test_func(parm):
- """
-
- :param parm:
- :return:
- """
- return 'my return'
-
-
######
# # #### ##### # # ##### ####
# # # # # # # # # # #
@@ -11265,23 +13167,40 @@ def Popup(*args, title=None, button_color=None, background_color=None, text_colo
Popup - Display a popup Window with as many parms as you wish to include. This is the GUI equivalent of the
"print" statement. It's also great for "pausing" your program's flow until the user can read some error messages.
- :param *args: (Any) Variable number of your arguments. Load up the call with stuff to see!
- :param title: (str) Optional title for the window. If none provided, the first arg will be used instead.
- :param button_color: Tuple[str, str] Color of the buttons shown (text color, button color)
- :param background_color: (str) Window's background color
- :param text_color: (str) text color
- :param button_type: (enum) NOT USER SET! Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). There are many Popup functions and they call Popup, changing this parameter to get the desired effect.
- :param auto_close: (bool) If True the window will automatically close
- :param auto_close_duration: (int) time in seconds to keep window open before closing it automatically
- :param custom_text: Union[Tuple[str, str], str] A string or pair of strings that contain the text to display on the buttons
- :param non_blocking: (bool) If True then will immediately return from the function without waiting for the user's input.
- :param icon: Union[str, bytes] icon to display on the window. Same format as a Window call
- :param line_width: (int) Width of lines in characters. Defaults to MESSAGE_BOX_LINE_WIDTH
- :param font: Union[str, tuple(font name, size, modifiers) specifies the font family, size, etc
- :param no_titlebar: (bool) If True will not show the frame around the window and the titlebar across the top
- :param grab_anywhere: (bool) If True can grab anywhere to move the window. If no_titlebar is True, grab_anywhere should likely be enabled too
- :param location: Tuple[int, int] Location on screen to display the top left corner of window. Defaults to window centered on screen
- :return: Union[str, None] Returns text of the button that was pressed. None will be returned if user closed window with X
+ :param *args: Variable number of your arguments. Load up the call with stuff to see!
+ :type *args: (Any)
+ :param title: Optional title for the window. If none provided, the first arg will be used instead.
+ :type title: (str)
+ :param button_color: Color of the buttons shown (text color, button color)
+ :type button_color: Tuple[str, str]
+ :param background_color: Window's background color
+ :type background_color: (str)
+ :param text_color: text color
+ :type text_color: (str)
+ :param button_type: NOT USER SET! Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). There are many Popup functions and they call Popup, changing this parameter to get the desired effect.
+ :type button_type: (enum)
+ :param auto_close: If True the window will automatically close
+ :type auto_close: (bool)
+ :param auto_close_duration: time in seconds to keep window open before closing it automatically
+ :type auto_close_duration: (int)
+ :param custom_text: A string or pair of strings that contain the text to display on the buttons
+ :type custom_text: Union[Tuple[str, str], str]
+ :param non_blocking: If True then will immediately return from the function without waiting for the user's input.
+ :type non_blocking: (bool)
+ :param icon: icon to display on the window. Same format as a Window call
+ :type icon: Union[str, bytes]
+ :param line_width: Width of lines in characters. Defaults to MESSAGE_BOX_LINE_WIDTH
+ :type line_width: (int)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, tuple(font name, size, modifiers]
+ :param no_titlebar: If True will not show the frame around the window and the titlebar across the top
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True can grab anywhere to move the window. If no_titlebar is True, grab_anywhere should likely be enabled too
+ :type grab_anywhere: (bool)
+ :param location: Location on screen to display the top left corner of window. Defaults to window centered on screen
+ :type location: Tuple[int, int]
+ :return: Returns text of the button that was pressed. None will be returned if user closed window with X
+ :rtype: Union[str, None]
"""
if not args:
@@ -11381,16 +13300,26 @@ def PopupScrolled(*args, title=None, button_color=None, background_color=None, t
Show a scrolled Popup window containing the user's text that was supplied. Use with as many items to print as you
want, just like a print statement.
- :param *args: (Any) Variable number of items to display
- :param title: (str) Title to display in the window.
- :param button_color: Tuple[str, str] button color (foreground, background)
- :param yes_no: (bool) If True, displays Yes and No buttons instead of Ok
- :param auto_close: (bool) if True window will close itself
- :param auto_close_duration: Union[int, float] Older versions only accept int. Time in seconds until window will close
- :param size: Tuple[int, int] (w,h) w=characters-wide, h=rows-high
- :param location: Tuple[int, int] Location on the screen to place the upper left corner of the window
- :param non_blocking: (bool) if True the call will immediately return rather than waiting on user input
- :return: Union[str, None, TIMEOUT_KEY] Returns text of the button that was pressed. None will be returned if user closed window with X
+ :param *args: Variable number of items to display
+ :type *args: (Any)
+ :param title: Title to display in the window.
+ :type title: (str)
+ :param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
+ :param yes_no: If True, displays Yes and No buttons instead of Ok
+ :type yes_no: (bool)
+ :param auto_close: if True window will close itself
+ :type auto_close: (bool)
+ :param auto_close_duration: Older versions only accept int. Time in seconds until window will close
+ :type auto_close_duration: Union[int, float]
+ :param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
+ :param location: Location on the screen to place the upper left corner of the window
+ :type location: Tuple[int, int]
+ :param non_blocking: if True the call will immediately return rather than waiting on user input
+ :type non_blocking: (bool)
+ :return: Returns text of the button that was pressed. None will be returned if user closed window with X
+ :rtype: Union[str, None, TIMEOUT_KEY]
"""
if not args: return
width, height = size
@@ -11446,29 +13375,39 @@ sprint = ScrolledTextBox
# --------------------------- PopupNoButtons ---------------------------
-def PopupNoButtons(*args, title=None, button_color=None, background_color=None, text_color=None, auto_close=False,
+def PopupNoButtons(*args, title=None, background_color=None, text_color=None, auto_close=False,
auto_close_duration=None, non_blocking=False, icon=None, line_width=None, font=None,
no_titlebar=False, grab_anywhere=False, keep_on_top=False, location=(None, None)):
"""Show a Popup but without any buttons
- :param *args:
- :param title:
- :param button_color: button color (foreground, background)
+ :param *args: Variable number of items to display
+ :type *args: (Any)
+ :param title: Title to display in the window.
+ :type title: (str)
:param background_color: color of background
+ :type background_color: (str)
:param text_color: color of the text
- :param auto_close: (Default = False)
- :param auto_close_duration:
- :param non_blocking: (Default = False)
- :param icon: Icon to display
+ :type text_color: (str)
+ :param auto_close: if True window will close itself
+ :type auto_close: (bool)
+ :param auto_close_duration: Older versions only accept int. Time in seconds until window will close
+ :type auto_close_duration: Union[int, float]
+ :param non_blocking: If True then will immediately return from the function without waiting for the user's input. (Default = False)
+ :type non_blocking: (bool)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
:param line_width: Width of lines in characters
+ :type line_width: (int)
:param font: specifies the font family, size, etc
- :param no_titlebar: (Default = False)
- :param grab_anywhere: If True can grab anywhere to move the window (Default = False)
- :param location: Location on screen to display
- :param location:
-
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True, than can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
"""
- Popup(*args, title=title, button_color=button_color, background_color=background_color, text_color=text_color,
+ Popup(*args, title=title, button_color=None, background_color=background_color, text_color=text_color,
button_type=POPUP_BUTTONS_NO_BUTTONS,
auto_close=auto_close, auto_close_duration=auto_close_duration, non_blocking=non_blocking, icon=icon,
line_width=line_width,
@@ -11484,23 +13423,36 @@ def PopupNonBlocking(*args, title=None, button_type=POPUP_BUTTONS_OK, button_col
"""
Show Popup window and immediately return (does not block)
- :param *args:
- :param title:
- :param button_type: (Default value = POPUP_BUTTONS_OK)
+ :param *args: Variable number of items to display
+ :type *args: (Any)
+ :param title: Title to display in the window.
+ :type title: (str)
+ :param button_type: Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK).
+ :type button_type: (enum)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param background_color: color of background
+ :type background_color: (str)
:param text_color: color of the text
- :param auto_close: (Default = False)
- :param auto_close_duration:
- :param non_blocking: (Default = True)
- :param icon: Icon to display
+ :type text_color: (str)
+ :param auto_close: if True window will close itself
+ :type auto_close: (bool)
+ :param auto_close_duration: Older versions only accept int. Time in seconds until window will close
+ :type auto_close_duration: Union[int, float]
+ :param non_blocking: if True the call will immediately return rather than waiting on user input
+ :type non_blocking: (bool)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
:param line_width: Width of lines in characters
+ :type line_width: (int)
:param font: specifies the font family, size, etc
- :param no_titlebar: (Default = False)
- :param grab_anywhere: If True can grab anywhere to move the window (Default = False)
- :param location: Location on screen to display
- :param location:
-
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
"""
Popup(*args, title=title, button_color=button_color, background_color=background_color, text_color=text_color,
button_type=button_type,
@@ -11520,23 +13472,36 @@ def PopupQuick(*args, title=None, button_type=POPUP_BUTTONS_OK, button_color=Non
"""
Show Popup box that doesn't block and closes itself
- :param *args:
- :param title:
- :param button_type: (Default value = POPUP_BUTTONS_OK)
+ :param *args: Variable number of items to display
+ :type *args: (Any)
+ :param title: Title to display in the window.
+ :type title: (str)
+ :param button_type: Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK).
+ :type button_type: (enum)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param background_color: color of background
+ :type background_color: (str)
:param text_color: color of the text
- :param auto_close: (Default = True)
- :param auto_close_duration: (Default value = 2)
- :param non_blocking: (Default = True)
- :param icon: Icon to display
+ :type text_color: (str)
+ :param auto_close: if True window will close itself
+ :type auto_close: (bool)
+ :param auto_close_duration: Older versions only accept int. Time in seconds until window will close
+ :type auto_close_duration: Union[int, float]
+ :param non_blocking: if True the call will immediately return rather than waiting on user input
+ :type non_blocking: (bool)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
:param line_width: Width of lines in characters
+ :type line_width: (int)
:param font: specifies the font family, size, etc
- :param no_titlebar: (Default = False)
- :param grab_anywhere: If True can grab anywhere to move the window (Default = False)
- :param location: Location on screen to display
- :param location:
- :param location:
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
"""
Popup(*args, title=title, button_color=button_color, background_color=background_color, text_color=text_color,
@@ -11555,22 +13520,36 @@ def PopupQuickMessage(*args, title=None, button_type=POPUP_BUTTONS_NO_BUTTONS, b
"""
Show Popup window with no titlebar, doesn't block, and auto closes itself.
- :param *args:
- :param title:
- :param button_type: (Default value = POPUP_BUTTONS_NO_BUTTONS)
+ :param *args: Variable number of items to display
+ :type *args: (Any)
+ :param title: Title to display in the window.
+ :type title: (str)
+ :param button_type: Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK).
+ :type button_type: (enum)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param background_color: color of background
+ :type background_color: (str)
:param text_color: color of the text
- :param auto_close: (Default = True)
- :param auto_close_duration: (Default value = 2)
- :param non_blocking: (Default = True)
- :param icon: Icon to display
+ :type text_color: (str)
+ :param auto_close: if True window will close itself
+ :type auto_close: (bool)
+ :param auto_close_duration: Older versions only accept int. Time in seconds until window will close
+ :type auto_close_duration: Union[int, float]
+ :param non_blocking: if True the call will immediately return rather than waiting on user input
+ :type non_blocking: (bool)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
:param line_width: Width of lines in characters
+ :type line_width: (int)
:param font: specifies the font family, size, etc
- :param no_titlebar: (Default = True)
- :param grab_anywhere: If True can grab anywhere to move the window (Default = False)
- :param location: Location on screen to display
- :param location:
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
"""
Popup(*args, title=title, button_color=button_color, background_color=background_color, text_color=text_color,
button_type=button_type,
@@ -11587,22 +13566,36 @@ def PopupNoTitlebar(*args, title=None, button_type=POPUP_BUTTONS_OK, button_colo
"""
Display a Popup without a titlebar. Enables grab anywhere so you can move it
- :param *args:
- :param title:
- :param button_type: (Default value = POPUP_BUTTONS_OK)
+ :param *args: Variable number of items to display
+ :type *args: (Any)
+ :param title: Title to display in the window.
+ :type title: (str)
+ :param button_type: Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK).
+ :type button_type: (enum)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param background_color: color of background
+ :type background_color: (str)
:param text_color: color of the text
- :param auto_close: (Default = False)
- :param auto_close_duration:
- :param non_blocking: (Default = False)
- :param icon: Icon to display
+ :type text_color: (str)
+ :param auto_close: if True window will close itself
+ :type auto_close: (bool)
+ :param auto_close_duration: Older versions only accept int. Time in seconds until window will close
+ :type auto_close_duration: Union[int, float]
+ :param non_blocking: if True the call will immediately return rather than waiting on user input
+ :type non_blocking: (bool)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
:param line_width: Width of lines in characters
+ :type line_width: (int)
:param font: specifies the font family, size, etc
- :param grab_anywhere: (Default = True)
- :param location: Location on screen to display
- :param location:
-
+ :type font: Union[str, Tuple[str, int]]
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param keep_on_top: If True the window will remain above all current windows
+ :type keep_on_top: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
"""
Popup(*args, title=title, button_color=button_color, background_color=background_color, text_color=text_color,
button_type=button_type,
@@ -11624,22 +13617,40 @@ def PopupAutoClose(*args, title=None, button_type=POPUP_BUTTONS_OK, button_color
location=(None, None)):
"""Popup that closes itself after some time period
- :param *args:
- :param title:
- :param button_type: (Default value = POPUP_BUTTONS_OK)
+ :param *args: Variable number of items to display
+ :type *args: (Any)
+ :param title: Title to display in the window.
+ :type title: (str)
+ :param button_type: Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK).
+ :type button_type: (enum)
+
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param background_color: color of background
+ :type background_color: (str)
:param text_color: color of the text
- :param auto_close: (Default = True)
- :param auto_close_duration:
- :param non_blocking: (Default = False)
- :param icon: Icon to display
+ :type text_color: (str)
+
+ :param auto_close: if True window will close itself
+ :type auto_close: (bool)
+ :param auto_close_duration: Older versions only accept int. Time in seconds until window will close
+ :type auto_close_duration: Union[int, float]
+ :param non_blocking: if True the call will immediately return rather than waiting on user input
+ :type non_blocking: (bool)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
:param line_width: Width of lines in characters
+ :type line_width: (int)
:param font: specifies the font family, size, etc
- :param no_titlebar: (Default = False)
- :param grab_anywhere: If True can grab anywhere to move the window (Default = False)
- :param location: Location on screen to display
- :param location:
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param keep_on_top: If True the window will remain above all current windows
+ :type keep_on_top: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
"""
Popup(*args, title=title, button_color=button_color, background_color=background_color, text_color=text_color,
@@ -11659,21 +13670,36 @@ def PopupError(*args, title=None, button_color=(None, None), background_color=No
"""
Popup with colored button and 'Error' as button text
- :param *args:
- :param title:
+ :param *args: Variable number of items to display
+ :type *args: (Any)
+ :param title: Title to display in the window.
+ :type title: (str)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param background_color: color of background
+ :type background_color: (str)
:param text_color: color of the text
- :param auto_close: (Default = False)
- :param auto_close_duration:
- :param non_blocking: (Default = False)
- :param icon: Icon to display
+ :type text_color: (str)
+ :param auto_close: if True window will close itself
+ :type auto_close: (bool)
+ :param auto_close_duration: Older versions only accept int. Time in seconds until window will close
+ :type auto_close_duration: Union[int, float]
+ :param non_blocking: if True the call will immediately return rather than waiting on user input
+ :type non_blocking: (bool)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
:param line_width: Width of lines in characters
+ :type line_width: (int)
:param font: specifies the font family, size, etc
- :param no_titlebar: (Default = False)
- :param grab_anywhere: If True can grab anywhere to move the window (Default = False)
- :param location: Location on screen to display
- :param location: (Default = (None))
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param keep_on_top: If True the window will remain above all current windows
+ :type keep_on_top: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
"""
tbutton_color = DEFAULT_ERROR_BUTTON_COLOR if button_color == (None, None) else button_color
return Popup(*args, title=title, button_type=POPUP_BUTTONS_ERROR, background_color=background_color, text_color=text_color,
@@ -11690,22 +13716,36 @@ def PopupCancel(*args, title=None, button_color=None, background_color=None, tex
"""
Display Popup with "cancelled" button text
- :param *args:
- :param title:
+ :param *args: Variable number of items to display
+ :type *args: (Any)
+ :param title: Title to display in the window.
+ :type title: (str)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param background_color: color of background
+ :type background_color: (str)
:param text_color: color of the text
- :param auto_close: (Default = False)
- :param auto_close_duration:
- :param non_blocking: (Default = False)
- :param icon: Icon to display
+ :type text_color: (str)
+ :param auto_close: if True window will close itself
+ :type auto_close: (bool)
+ :param auto_close_duration: Older versions only accept int. Time in seconds until window will close
+ :type auto_close_duration: Union[int, float]
+ :param non_blocking: if True the call will immediately return rather than waiting on user input
+ :type non_blocking: (bool)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
:param line_width: Width of lines in characters
+ :type line_width: (int)
:param font: specifies the font family, size, etc
- :param no_titlebar: (Default = False)
- :param grab_anywhere: If True can grab anywhere to move the window (Default = False)
- :param location: Location on screen to display
- :param location:
-
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param keep_on_top: If True the window will remain above all current windows
+ :type keep_on_top: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
"""
return Popup(*args, title=title, button_type=POPUP_BUTTONS_CANCELLED, background_color=background_color,
text_color=text_color,
@@ -11721,21 +13761,36 @@ def PopupOK(*args, title=None, button_color=None, background_color=None, text_co
"""
Display Popup with OK button only
- :param *args:
- :param title:
+ :param *args: Variable number of items to display
+ :type *args: (Any)
+ :param title: Title to display in the window.
+ :type title: (str)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param background_color: color of background
+ :type background_color: (str)
:param text_color: color of the text
- :param auto_close: (Default = False)
- :param auto_close_duration:
- :param non_blocking: (Default = False)
- :param icon: Icon to display
+ :type text_color: (str)
+ :param auto_close: if True window will close itself
+ :type auto_close: (bool)
+ :param auto_close_duration: Older versions only accept int. Time in seconds until window will close
+ :type auto_close_duration: Union[int, float]
+ :param non_blocking: if True the call will immediately return rather than waiting on user input
+ :type non_blocking: (bool)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
:param line_width: Width of lines in characters
+ :type line_width: (int)
:param font: specifies the font family, size, etc
- :param no_titlebar: (Default = False)
- :param grab_anywhere: If True can grab anywhere to move the window (Default = False)
- :param location: Location on screen to display
- :param location:
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param keep_on_top: If True the window will remain above all current windows
+ :type keep_on_top: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
"""
return Popup(*args, title=title, button_type=POPUP_BUTTONS_OK, background_color=background_color, text_color=text_color,
non_blocking=non_blocking, icon=icon, line_width=line_width, button_color=button_color, auto_close=auto_close,
@@ -11750,21 +13805,38 @@ def PopupOKCancel(*args, title=None, button_color=None, background_color=None, t
"""
Display popup with OK and Cancel buttons
- :param *args:
- :param title:
+ :param *args: Variable number of items to display
+ :type *args: (Any)
+ :param title: Title to display in the window.
+ :type title: (str)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param background_color: color of background
+ :type background_color: (str)
:param text_color: color of the text
- :param auto_close: (Default = False)
- :param auto_close_duration:
- :param non_blocking: (Default = False)
- :param icon: Icon to display
+ :type text_color: (str)
+ :param auto_close: if True window will close itself
+ :type auto_close: (bool)
+ :param auto_close_duration: Older versions only accept int. Time in seconds until window will close
+ :type auto_close_duration: Union[int, float]
+ :param non_blocking: if True the call will immediately return rather than waiting on user input
+ :type non_blocking: (bool)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
:param line_width: Width of lines in characters
+ :type line_width: (int)
:param font: specifies the font family, size, etc
- :param no_titlebar: (Default = False)
- :param grab_anywhere: If True can grab anywhere to move the window (Default = False)
- :param location: Location on screen to display
- :return: Union["OK", "Cancel", None]
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param keep_on_top: If True the window will remain above all current windows
+ :type keep_on_top: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
+ :return: clicked button
+ :rtype: Union["OK", "Cancel", None]
"""
return Popup(*args, title=title, button_type=POPUP_BUTTONS_OK_CANCEL, background_color=background_color,
text_color=text_color,
@@ -11780,21 +13852,38 @@ def PopupYesNo(*args, title=None, button_color=None, background_color=None, text
"""
Display Popup with Yes and No buttons
- :param *args:
- :param title:
+ :param *args: Variable number of items to display
+ :type *args: (Any)
+ :param title: Title to display in the window.
+ :type title: (str)
:param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
:param background_color: color of background
+ :type background_color: (str)
:param text_color: color of the text
- :param auto_close: (Default = False)
- :param auto_close_duration:
- :param non_blocking: (Default = False)
- :param icon: Icon to display
+ :type text_color: (str)
+ :param auto_close: if True window will close itself
+ :type auto_close: (bool)
+ :param auto_close_duration: Older versions only accept int. Time in seconds until window will close
+ :type auto_close_duration: Union[int, float]
+ :param non_blocking: if True the call will immediately return rather than waiting on user input
+ :type non_blocking: (bool)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
:param line_width: Width of lines in characters
+ :type line_width: (int)
:param font: specifies the font family, size, etc
- :param no_titlebar: (Default = False)
- :param grab_anywhere: If True can grab anywhere to move the window (Default = False)
- :param location: Location on screen to display
- :return: Union["Yes", "No", None]
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param keep_on_top: If True the window will remain above all current windows
+ :type keep_on_top: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
+ :return: clicked button
+ :rtype: Union["Yes", "No", None]
"""
return Popup(*args, title=title, button_type=POPUP_BUTTONS_YES_NO, background_color=background_color,
text_color=text_color,
@@ -11816,22 +13905,38 @@ def PopupGetFolder(message, title=None, default_path='', no_window=False, size=(
"""
Display popup with text entry field and browse button so that a folder can be chosen.
- :param message: (str) message displayed to user
- :param title: (str) Window title
- :param default_path: (str) path to display to user as starting point (filled into the input field)
- :param no_window: (bool) if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown
- :param size: Tuple[int, int] (width, height) of the InputText Element
- :param button_color: Tuple[str, str] Color of the button (text, background)
- :param background_color: (str) background color of the entire window
- :param text_color: (str) color of the message text
- :param icon: Union[bytes, str] filename or base64 string to be used for the window's icon
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param no_titlebar: (bool) If True no titlebar will be shown
- :param grab_anywhere: (bool) If True can click and drag anywhere in the window to move the window
- :param keep_on_top: (bool) If True the window will remain above all current windows
- :param location: Tuyple[int, int] (x,y) Location on screen to display the upper left corner of window
- :param initial_folder: (str) location in filesystem to begin browsing
- :return: Union[str, None] string representing the path chosen, None if cancelled or window closed with X
+ :param message: message displayed to user
+ :type message: (str)
+ :param title: Window title
+ :type title: (str)
+ :param default_path: path to display to user as starting point (filled into the input field)
+ :type default_path: (str)
+ :param no_window: if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown
+ :type no_window: (bool)
+ :param size: (width, height) of the InputText Element
+ :type size: Tuple[int, int]
+ :param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param keep_on_top: If True the window will remain above all current windows
+ :type keep_on_top: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
+ :param initial_folder: location in filesystem to begin browsing
+ :type initial_folder: (str)
+ :return: string representing the path chosen, None if cancelled or window closed with X
+ :rtype: Union[str, None]
"""
# global _my_windows
@@ -11840,7 +13945,7 @@ def PopupGetFolder(message, title=None, default_path='', no_window=False, size=(
# if first window being created, make a throwaway, hidden master root. This stops one user
# window from becoming the child of another user window. All windows are children of this
# hidden window
- Window.IncrementOpenCount()
+ Window._IncrementOpenCount()
Window.hidden_master_root = tk.Tk()
Window.hidden_master_root.attributes('-alpha', 0) # HIDE this window really really really
Window.hidden_master_root.wm_overrideredirect(True)
@@ -11891,26 +13996,46 @@ def PopupGetFile(message, title=None, default_path='', default_extension='', sav
"""
Display popup window with text entry field and browse button so that a file can be chosen by user.
- :param message: (str) message displayed to user
- :param title: (str) Window title
- :param default_path: (str) path to display to user as starting point (filled into the input field)
- :param default_extension: (str) If no extension entered by user, add this to filename (only used in saveas dialogs)
- :param save_as: (bool) if True, the "save as" dialog is shown which will verify before overwriting
- :param multiple_files: (bool) if True, then allows multiple files to be selected that are returned with ';' between each filename
- :param file_types: Tuple[Tuple[str,str]] List of extensions to show using wildcards. All files (the default) = (("ALL Files", "*.*"),)
- :param no_window: (bool) if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown
- :param size: Tuple[int, int] (width, height) of the InputText Element
- :param button_color: Tuple[str, str] Color of the button (text, background)
- :param background_color: (str) background color of the entire window
- :param text_color: (str) color of the message text
- :param icon: Union[bytes, str] filename or base64 string to be used for the window's icon
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
- :param no_titlebar: (bool) If True no titlebar will be shown
- :param grab_anywhere: (bool) If True can click and drag anywhere in the window to move the window
- :param keep_on_top: (bool) If True the window will remain above all current windows
- :param location: Tuyple[int, int] (x,y) Location on screen to display the upper left corner of window
- :param initial_folder: (str) location in filesystem to begin browsing
- :return: Union[str, None] string representing the file(s) chosen, None if cancelled or window closed with X
+ :param message: message displayed to user
+ :type message: (str)
+ :param title: Window title
+ :type title: (str)
+ :param default_path: path to display to user as starting point (filled into the input field)
+ :type default_path: (str)
+ :param default_extension: If no extension entered by user, add this to filename (only used in saveas dialogs)
+ :type default_extension: (str)
+ :param save_as: if True, the "save as" dialog is shown which will verify before overwriting
+ :type save_as: (bool)
+ :param multiple_files: if True, then allows multiple files to be selected that are returned with ';' between each filename
+ :type multiple_files: (bool)
+ :param file_types: List of extensions to show using wildcards. All files (the default) = (("ALL Files", "*.*"),)
+ :type file_types: Tuple[Tuple[str,str]]
+ :param no_window: if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown
+ :type no_window: (bool)
+ :param size: (width, height) of the InputText Element
+ :type size: Tuple[int, int]
+ :param button_color: Color of the button (text, background)
+ :type button_color: Tuple[str, str]
+ :param background_color: background color of the entire window
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param keep_on_top: If True the window will remain above all current windows
+ :type keep_on_top: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
+ :param initial_folder: location in filesystem to begin browsing
+ :type initial_folder: (str)
+ :return: string representing the file(s) chosen, None if cancelled or window closed with X
+ :rtype: Union[str, None]
"""
if no_window:
@@ -11918,7 +14043,7 @@ def PopupGetFile(message, title=None, default_path='', default_extension='', sav
# if first window being created, make a throwaway, hidden master root. This stops one user
# window from becoming the child of another user window. All windows are children of this
# hidden window
- Window.IncrementOpenCount()
+ Window._IncrementOpenCount()
Window.hidden_master_root = tk.Tk()
Window.hidden_master_root.attributes('-alpha', 0) # HIDE this window really really really
Window.hidden_master_root.wm_overrideredirect(True)
@@ -11989,20 +14114,35 @@ def PopupGetText(message, title=None, default_text='', password_char='', size=(N
Display Popup with text entry field. Returns the text entered or None if closed / cancelled
:param message: (str) message displayed to user
+ :type message: (str)
:param title: (str) Window title
+ :type title: (str)
:param default_text: (str) default value to put into input area
+ :type default_text: (str)
:param password_char: (str) character to be shown instead of actually typed characters
- :param size: Tuple[int, int] (width, height) of the InputText Element
- :param button_color: Tuple[str, str] Color of the button (text, background)
+ :type password_char: (str)
+ :param size: (width, height) of the InputText Element
+ :type size: Tuple[int, int]
+ :param button_color: Color of the button (text, background)
+ :type button_color: Tuple[str, str]
:param background_color: (str) background color of the entire window
+ :type background_color: (str)
:param text_color: (str) color of the message text
- :param icon: Union[bytes, str] filename or base64 string to be used for the window's icon
- :param font: Union[str, Tuple[str, int]] specifies the font family, size, etc
+ :type text_color: (str)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
:param no_titlebar: (bool) If True no titlebar will be shown
+ :type no_titlebar: (bool)
:param grab_anywhere: (bool) If True can click and drag anywhere in the window to move the window
+ :type grab_anywhere: (bool)
:param keep_on_top: (bool) If True the window will remain above all current windows
- :param location: Tuyple[int, int] (x,y) Location on screen to display the upper left corner of window
- :return: Union[str, None] Text entered or None if window was closed or cancel button clicked
+ :type keep_on_top: (bool)
+ :param location: (x,y) Location on screen to display the upper left corner of window
+ :type location: Tuple[int, int]
+ :return: Text entered or None if window was closed or cancel button clicked
+ :rtype: Union[str, None]
"""
layout = [[Text(message, auto_size_text=True, text_color=text_color, background_color=background_color, font=font)],
@@ -12025,8 +14165,7 @@ def PopupGetText(message, title=None, default_text='', password_char='', size=(N
# --------------------------- PopupAnimated ---------------------------
-def PopupAnimated(image_source, message=None, background_color=None, text_color=None, font=None, no_titlebar=True,
- grab_anywhere=True, keep_on_top=True, location=(None, None), alpha_channel=None,
+def PopupAnimated(image_source, message=None, background_color=None, text_color=None, font=None, no_titlebar=True, grab_anywhere=True, keep_on_top=True, location=(None, None), alpha_channel=None,
time_between_frames=0, transparent_color=None):
"""
Show animation one frame at a time. This function has its own internal clocking meaning you can call it at any frequency
@@ -12034,27 +14173,39 @@ def PopupAnimated(image_source, message=None, background_color=None, text_color=
event loop is running every 10 ms. You don't have to worry about delaying, just call it every time through the
loop.
- :param image_source: Union[str, bytes] Either a filename or a base64 string.
- :param message: (str) An optional message to be shown with the animation
- :param background_color: (str) color of background
- :param text_color: (str) color of the text
- :param font: Union[str, tuple) specifies the font family, size, etc
- :param no_titlebar: (bool) If True then the titlebar and window frame will not be shown
- :param grab_anywhere: (bool) If True then you can move the window just clicking anywhere on window, hold and drag
- :param keep_on_top: (bool) If True then Window will remain on top of all other windows currently shownn
- :param location: (int, int) (x,y) location on the screen to place the top left corner of your window. Default is to center on screen
- :param alpha_channel: (float) Window transparency 0 = invisible 1 = completely visible. Values between are see through
- :param time_between_frames: (int) Amount of time in milliseconds between each frame
- :param transparent_color: (str) This color will be completely see-through in your window. Can even click through
+ :param image_source: Either a filename or a base64 string.
+ :type image_source: Union[str, bytes]
+ :param message: An optional message to be shown with the animation
+ :type message: (str)
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, tuple]
+ :param no_titlebar: If True then the titlebar and window frame will not be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True then you can move the window just clicking anywhere on window, hold and drag
+ :type grab_anywhere: (bool)
+ :param keep_on_top: If True then Window will remain on top of all other windows currently shownn
+ :type keep_on_top: (bool)
+ :param location: (x,y) location on the screen to place the top left corner of your window. Default is to center on screen
+ :type location: (int, int)
+ :param alpha_channel: Window transparency 0 = invisible 1 = completely visible. Values between are see through
+ :type alpha_channel: (float)
+ :param time_between_frames: Amount of time in milliseconds between each frame
+ :type time_between_frames: (int)
+ :param transparent_color: This color will be completely see-through in your window. Can even click through
+ :type transparent_color: (str)
"""
if image_source is None:
- for image in Window.animated_popup_dict:
- window = Window.animated_popup_dict[image]
+ for image in Window._animated_popup_dict:
+ window = Window._animated_popup_dict[image]
window.Close()
- Window.animated_popup_dict = {}
+ Window._animated_popup_dict = {}
return
- if image_source not in Window.animated_popup_dict:
+ if image_source not in Window._animated_popup_dict:
if type(image_source) is bytes or len(image_source) > 300:
layout = [[Image(data=image_source, background_color=background_color, key='_IMAGE_', )], ]
else:
@@ -12065,15 +14216,151 @@ def PopupAnimated(image_source, message=None, background_color=None, text_color=
window = Window('Animated GIF', layout, no_titlebar=no_titlebar, grab_anywhere=grab_anywhere,
keep_on_top=keep_on_top, background_color=background_color, location=location,
alpha_channel=alpha_channel, element_padding=(0, 0), margins=(0, 0),
- transparent_color=transparent_color).Finalize()
- Window.animated_popup_dict[image_source] = window
+ transparent_color=transparent_color, finalize=True, element_justification='c')
+ Window._animated_popup_dict[image_source] = window
else:
- window = Window.animated_popup_dict[image_source]
+ window = Window._animated_popup_dict[image_source]
window.Element('_IMAGE_').UpdateAnimation(image_source, time_between_frames=time_between_frames)
window.refresh() # call refresh instead of Read to save significant CPU time
+# Popup Notify
+def popup_notify(*args, title='', icon=SYSTEM_TRAY_MESSAGE_ICON_INFORMATION, display_duration_in_ms=SYSTEM_TRAY_MESSAGE_DISPLAY_DURATION_IN_MILLISECONDS,
+ fade_in_duration=SYSTEM_TRAY_MESSAGE_FADE_IN_DURATION, alpha=0.9, location=None):
+ """
+ Displays a "notification window", usually in the bottom right corner of your display. Has an icon, a title, and a message. It is more like a "toaster" window than the normal popups.
+
+ The window will slowly fade in and out if desired. Clicking on the window will cause it to move through the end the current "phase". For example, if the window was fading in and it was clicked, then it would immediately stop fading in and instead be fully visible. It's a way for the user to quickly dismiss the window.
+
+ The return code specifies why the call is returning (e.g. did the user click the message to dismiss it)
+
+ :param title: (str) Text to be shown at the top of the window in a larger font
+ :type title: (str)
+ :param message: (str) Text message that makes up the majority of the window
+ :type message: (str)
+ :param icon: A base64 encoded PNG/GIF image or PNG/GIF filename that will be displayed in the window
+ :type icon: Union[bytes, str]
+ :param display_duration_in_ms: (int) Number of milliseconds to show the window
+ :type display_duration_in_ms: (int)
+ :param fade_in_duration: (int) Number of milliseconds to fade window in and out
+ :type fade_in_duration: (int)
+ :param alpha: (float) Alpha channel. 0 - invisible 1 - fully visible
+ :type alpha: (float)
+ :param location: Location on the screen to display the window
+ :type location: Tuple[int, int]
+ :return: reason for returning
+ :rtype: (int)
+ """
+
+ if not args:
+ args_to_print = ['']
+ else:
+ args_to_print = args
+ output = ''
+ max_line_total, total_lines, local_line_width = 0, 0, SYSTEM_TRAY_MESSAGE_MAX_LINE_LENGTH
+ for message in args_to_print:
+ # fancy code to check if string and convert if not is not need. Just always convert to string :-)
+ # if not isinstance(message, str): message = str(message)
+ message = str(message)
+ if message.count('\n'):
+ message_wrapped = message
+ else:
+ message_wrapped = textwrap.fill(message, local_line_width)
+ message_wrapped_lines = message_wrapped.count('\n') + 1
+ longest_line_len = max([len(l) for l in message.split('\n')])
+ width_used = min(longest_line_len, local_line_width)
+ max_line_total = max(max_line_total, width_used)
+ # height = _GetNumLinesNeeded(message, width_used)
+ height = message_wrapped_lines
+ output += message_wrapped+'\n'
+ total_lines += height
+
+ message = output
+
+ # def __init__(self, menu=None, filename=None, data=None, data_base64=None, tooltip=None, metadata=None):
+ return SystemTray.notify(title=title, message=message, icon=icon, display_duration_in_ms=display_duration_in_ms, fade_in_duration=fade_in_duration, alpha=alpha, location=location)
+
+
+
+#####################################################################
+# Animated window while shell command is executed
+#####################################################################
+
+def _process_thread(*args):
+ global __shell_process__
+
+ # start running the command with arugments
+ # print(f'running args = {args}')
+ try:
+ __shell_process__ = run(args, shell=True, stdout=PIPE)
+ except Exception as e:
+ print(f'Exception running process args = {args}')
+ __shell_process__ = None
+
+
+def shell_with_animation(command, args=None, image_source=DEFAULT_BASE64_LOADING_GIF, message=None, background_color=None, text_color=None, font=None, no_titlebar=True, grab_anywhere=True, keep_on_top=True, location=(None, None), alpha_channel=None, time_between_frames=100, transparent_color=None):
+ """
+ Execute a "shell command" (anything capable of being launched using subprocess.run) and
+ while the command is running, show an animated popup so that the user knows that a long-running
+ command is being executed. Without this mechanism, the GUI appears locked up.
+
+ :param command: (str) The command to run
+ :type command: (str)
+ :param args: List[str] List of arguments
+ :type args: List[str]
+ :param image_source: Either a filename or a base64 string.
+ :type image_source: Union[str, bytes]
+ :param message: An optional message to be shown with the animation
+ :type message: (str)
+ :param background_color: (str) color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, tuple]
+ :param no_titlebar: If True then the titlebar and window frame will not be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True then you can move the window just clicking anywhere on window, hold and drag
+ :type grab_anywhere: (bool)
+ :param keep_on_top: If True then Window will remain on top of all other windows currently shownn
+ :type keep_on_top: (bool)
+ :param location: (x,y) location on the screen to place the top left corner of your window. Default is to center on screen
+ :type location: (int, int)
+ :param alpha_channel: Window transparency 0 = invisible 1 = completely visible. Values between are see through
+ :type alpha_channel: (float)
+ :param time_between_frames: Amount of time in milliseconds between each frame
+ :type time_between_frames: (int)
+ :param transparent_color: This color will be completely see-through in your window. Can even click through
+ :type transparent_color: (str)
+ :return: The resulting string output from stdout
+ :rtype: (str)
+ """
+
+ global __shell_process__
+
+ real_args = [command]
+ if args is not None:
+ for arg in args:
+ real_args.append(arg)
+ # real_args.append(args)
+ thread = Thread(target=_process_thread, args=real_args, daemon=True)
+ thread.start()
+
+ # Poll to see if the thread is still running. If so, then continue showing the animation
+ while True:
+ popup_animated(image_source=image_source, message=message, time_between_frames=time_between_frames, transparent_color=transparent_color, text_color=text_color, background_color=background_color, font=font, no_titlebar=no_titlebar, grab_anywhere=grab_anywhere, keep_on_top=keep_on_top, location=location, alpha_channel=alpha_channel)
+ thread.join(timeout=time_between_frames/1000)
+ if not thread.is_alive():
+ break
+ popup_animated(None) # stop running the animation
+
+ output = __shell_process__.__str__().replace('\\r\\n', '\n') # fix up the output string
+ output = output[output.index("stdout=b'")+9:-2]
+ return output
+
+
+
#####################################################################################################
# Debugger
#####################################################################################################
@@ -12101,8 +14388,6 @@ POPOUT_WINDOW_FONT = 'Sans 8'
class _Debugger():
- """ """
-
debugger = None
# # ######
@@ -12114,7 +14399,6 @@ class _Debugger():
# # # # # # # ###### ###### ##### #### #### #### ###### # #
def __init__(self):
- """ """
self.watcher_window = None # type: Window
self.popout_window = None # type: Window
self.local_choices = {}
@@ -12126,19 +14410,9 @@ class _Debugger():
# Includes the DUAL PANE (now 2 tabs)! Don't forget REPL is there too!
def _build_main_debugger_window(self, location=(None, None)):
- """
-
- :param location:
-
- """
ChangeLookAndFeel(COLOR_SCHEME)
def InVar(key1):
- """
-
- :param key1:
-
- """
row1 = [T(' '),
I(key=key1, size=(WIDTH_VARIABLES, 1)),
T('', key=key1 + 'CHANGED_', size=(WIDTH_RESULTS, 1)), B('Detail', key=key1 + 'DETAIL_'),
@@ -12184,9 +14458,9 @@ class _Debugger():
# ------------------------------- Create main window -------------------------------
window = Window("PySimpleGUI Debugger", layout, icon=PSGDebugLogo, margins=(0, 0), location=location)
- Window.read_call_from_debugger = True
+ Window._read_call_from_debugger = True
window.finalize()
- Window.read_call_from_debugger = False
+ Window._read_call_from_debugger = False
window.Element('_VAR1_').SetFocus()
self.watcher_window = window
@@ -12202,12 +14476,6 @@ class _Debugger():
# # # # # # # ####### ## ###### # # # ####### #### #### #
def _refresh_main_debugger_window(self, mylocals, myglobals):
- """
-
- :param mylocals:
- :param myglobals:
-
- """
if not self.watcher_window: # if there is no window setup, nothing to do
return False
event, values = self.watcher_window.Read(timeout=1)
@@ -12345,11 +14613,6 @@ class _Debugger():
# displays them into a single text box
def _display_all_vars(self, dict):
- """
-
- :param dict:
-
- """
num_cols = 3
output_text = ''
num_lines = 2
@@ -12389,11 +14652,6 @@ class _Debugger():
# # # # # # # # ##### ###### ###### #### ## ## # # #
def _choose_auto_watches(self, my_locals):
- """
-
- :param my_locals:
-
- """
ChangeLookAndFeel(COLOR_SCHEME)
num_cols = 3
output_text = ''
@@ -12510,9 +14768,9 @@ class _Debugger():
element_padding=(0, 0), margins=(0, 0), keep_on_top=True,
right_click_menu=['&Right', ['Debugger::RightClick', 'Exit::RightClick']], location=location, finalize=False)
- Window.read_call_from_debugger = True
+ Window._read_call_from_debugger = True
self.popout_window.Finalize()
- Window.read_call_from_debugger = False
+ Window._read_call_from_debugger = False
if location == (None, None):
screen_size = self.popout_window.GetScreenDimensions()
@@ -12547,7 +14805,6 @@ class _Debugger():
## ## # # # ##### #### # #
def _refresh_floating_window(self):
- """ """
if not self.popout_window:
return
for key in self.popout_choices:
@@ -12584,8 +14841,8 @@ class _Debugger():
def show_debugger_window(location=(None, None), *args):
"""
Shows the large main debugger window
- :param location: Tuple[int, int] Locations (x,y) on the screen to place upper left corner of the window
- :param *args: Not used
+ :param location: Locations (x,y) on the screen to place upper left corner of the window
+ :ttype location: Tuple[int, int]
"""
if _Debugger.debugger is None:
_Debugger.debugger = _Debugger()
@@ -12608,8 +14865,8 @@ def show_debugger_popout_window(location=(None, None), *args):
"""
Shows the smaller "popout" window. Default location is the upper right corner of your screen
- :param location: Tuple[int, int] Locations (x,y) on the screen to place upper left corner of the window
- :param *args: Not used
+ :param location: Locations (x,y) on the screen to place upper left corner of the window
+ :type location: Tuple[int, int]
"""
if _Debugger.debugger is None:
_Debugger.debugger = _Debugger()
@@ -12638,10 +14895,10 @@ def _refresh_debugger():
if _Debugger.debugger is None:
_Debugger.debugger = _Debugger()
debugger = _Debugger.debugger
- Window.read_call_from_debugger = True
+ Window._read_call_from_debugger = True
# frame = inspect.currentframe()
- frame = inspect.currentframe().f_back
- # frame, *others = inspect.stack()[1]
+ # frame = inspect.currentframe().f_back
+ frame, *others = inspect.stack()[1]
try:
debugger.locals = frame.f_back.f_locals
debugger.globals = frame.f_back.f_globals
@@ -12649,7 +14906,7 @@ def _refresh_debugger():
del frame
debugger._refresh_floating_window() if debugger.popout_window else None
rc = debugger._refresh_main_debugger_window(debugger.locals, debugger.globals) if debugger.watcher_window else False
- Window.read_call_from_debugger = False
+ Window._read_call_from_debugger = False
return rc
@@ -12662,17 +14919,253 @@ def _refresh_debugger():
# 888 888 888 888 888 888 888 888
# 888 888 888 "Y888888 888 888 888
+import sys
+import site
+import shutil
+import hashlib
+import base64
+from pathlib import Path
+import configparser
+import urllib.request
+import urllib.error
+
+
+def _install(files, url=None):
+ """
+ install one file package from GitHub
+
+ Parameters
+ ----------
+ files : list
+ files to be installed
+ the first item (files[0]) will be used as the name of the package
+ optional files should be preceded wit an exclamation mark (!)
+
+ url : str
+ url of the location of the GitHub repository
+ this will start usually with https://raw.githubusercontent.com/ and end with /master/
+ if omitted, the files will be copied from the current directory (no GitHub)
+
+ Returns
+ -------
+ info : Info instance
+ with structure contains
+ info.package : name of the package installed
+ info.path : name where the package is installed in the site-packages
+ info.version : version of the package (obtained from .py)
+ info.files_copied : list of copied files
+
+ Notes
+ -----
+ The program automatically makes the required __init__.py file (unless given in files) and
+ .dist-info folder with the usual files METADATA, INSTALLER and RECORDS.
+ As the setup.py is not run, the METADATA is very limited, i.e. is contains just name and version.
+
+ If an __init__.py is in files that file will be used.
+ Otherwise, an __init__/py file will be generated. In thet case, if a __version__ = statement
+ is found in the source file, the __version__ will be included in that __init__.py file.
+
+ Version history
+ ---------------
+ version 1.0.1 2020-03-04
+ now uses urllib instead of requests to avoid non standard libraries
+ installation for Pythonista improved
+
+ version 1.0.0 2020-03-04
+ initial version
+
+ (c)2020 Ruud van der Ham - www.salabim.org
+ """
+
+ class Info:
+ version = "?"
+ package = "?"
+ path = "?"
+ files_copied = []
+
+ info = Info()
+ Pythonista = sys.platform == "ios"
+ if not files:
+ raise ValueError('no files specified')
+ if files[0][0] == '!':
+ raise ValueError('first item in files (sourcefile) may not be optional')
+ package = Path(files[0]).stem
+ sourcefile = files[0]
+
+ file_contents = {}
+ for file in files:
+ optional = file[0] == "!"
+ if optional:
+ file = file[1:]
+
+ if url:
+ try:
+ with urllib.request.urlopen(url + file) as response:
+ page = response.read()
+ # page = requests.get(url + file)
+ file_contents[file] = page
+ exists = True
+ except urllib.error.URLError:
+ exists = False
+
+ else:
+ exists = Path(file).is_file()
+ if exists:
+ with open(file, "rb") as f:
+ file_contents[file] = f.read()
+
+ if (not exists) and (not optional):
+ raise FileNotFoundError(file + " not found. Nothing installed.")
+
+ version = "unknown"
+ for line in file_contents[sourcefile].decode("utf-8").split("\n"):
+ line_split = line.split("__version__ =")
+ if len(line_split) > 1:
+ raw_version = line_split[-1].strip(" '\"")
+ version = ""
+ for c in raw_version:
+ if c in "0123456789-.":
+ version += c
+ else:
+ break
+ break
+
+ info.files_copied = list(file_contents.keys())
+ info.package = package
+ info.version = version
+ paths = []
+
+ file = '__init__.py'
+ if file not in file_contents:
+ file_contents[file] = ("from ." + package + " import *\n").encode()
+ if version != 'unknown':
+ file_contents[file] += ("from ." + package + " import __version__\n").encode()
+
+ if Pythonista:
+ cwd = Path.cwd()
+ parts1 = []
+ for part in cwd.parts:
+ parts1.append(part)
+ if part == "Documents":
+ break
+ else:
+ raise EnvironmentError("unable to install")
+
+ sitepackages_paths = [Path(*parts1) / ("site-packages" + ver) for ver in ("", "-2", "-3")]
+ else:
+ sitepackages_paths = [Path(site.getsitepackages()[-1])]
+
+ for sitepackages_path in sitepackages_paths:
+
+ path = sitepackages_path / package
+ paths.append(str(path))
+
+ if not path.is_dir():
+ path.mkdir()
+
+ for file, contents in file_contents.items():
+ with open(path / file, "wb") as f:
+ f.write(contents)
+
+ if Pythonista:
+ pypi_packages = sitepackages_path / '.pypi_packages'
+ config = configparser.ConfigParser()
+ config.read(pypi_packages)
+ config[package] = {}
+ config[package]['url'] = 'github'
+ config[package]['version'] = version
+ config[package]['summary'] = ''
+ config[package]['files'] = path.as_posix()
+ config[package]['dependency'] = ''
+ with pypi_packages.open('w') as f:
+ config.write(f)
+ else:
+ for entry in sitepackages_path.glob("*"):
+ if entry.is_dir():
+ if entry.stem.startswith(package) and entry.suffix == ".dist-info":
+ shutil.rmtree(entry)
+ path_distinfo = Path(str(path) + "-" + version + ".dist-info")
+ if not path_distinfo.is_dir():
+ path_distinfo.mkdir()
+ with open(path_distinfo / "METADATA", "w") as f: # make a dummy METADATA file
+ f.write("Name: " + package + "\n")
+ f.write("Version: " + version + "\n")
+
+ with open(path_distinfo / "INSTALLER", "w") as f: # make a dummy METADATA file
+ f.write("github\n")
+ with open(path_distinfo / "RECORD", "w") as f:
+ pass # just to create the file to be recorded
+
+ with open(path_distinfo / "RECORD", "w") as record_file:
+
+ for p in (path, path_distinfo):
+ for file in p.glob("**/*"):
+
+ if file.is_file():
+ name = file.relative_to(sitepackages_path).as_posix() # make sure we have slashes
+ record_file.write(name + ",")
+
+ if (file.stem == "RECORD" and p == path_distinfo) or ("__pycache__" in name.lower()):
+ record_file.write(",")
+ else:
+ with open(file, "rb") as f:
+ file_contents = f.read()
+ hash = "sha256=" + base64.urlsafe_b64encode(
+ hashlib.sha256(file_contents).digest()
+ ).decode("latin1").rstrip("=")
+ # hash calculation derived from wheel.py in pip
+
+ length = str(len(file_contents))
+ record_file.write(hash + "," + length)
+
+ record_file.write("\n")
+
+ info.path = ','.join(paths)
+ return info
+
+def _upgrade_from_github():
+ info = _install(
+ files="PySimpleGUI.py !init.py".split(), url="https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/master/"
+ )
+ """
+ info = install(
+ files="salabim.py !calibri.ttf !mplus-1m-regular.ttf !license.txt !DejaVuSansMono.ttf !changelog.txt".split(),
+ url="https://raw.githubusercontent.com/salabim/salabim/master/",
+ )
+ """
+
+ # print(info.package + " " + info.version + " successfully installed in " + info.path)
+ # print("files copied: ", info.files_copied)
+
+ popup("*** SUCCESS ***", info.package, info.version, "successfully installed in ", info.path, "files copied: ", info.files_copied,
+ keep_on_top=True, background_color='red', text_color='white')
+
+
+def _upgrade_gui():
+ if popup_yes_no('* WARNING *',
+ 'You are about to upgrade your PySimpleGUI package previously installed via pip to the latest version location on the GitHub server.',
+ 'You are running verrsion {}'.format(version[:version.index('\n')]),
+ 'Are you sure you want to overwrite this release?', title='Are you sure you want to overwrite?',
+ keep_on_top=True) == 'Yes':
+ _upgrade_from_github()
+ else:
+ popup_quick_message('Cancelled upgrade\nNothing overwritten', background_color='red', text_color='white', keep_on_top=True, non_blocking=False)
+
def main():
"""
The PySimpleGUI "Test Harness". This is meant to be a super-quick test of the Elements.
-
- :return:
"""
from random import randint
- # preview_all_look_and_feel_themes()
- # look_and_feel = 'Hot Dog Stand'
- # theme('Hot Dog Stand')
+
+ # theme('dark blue 3')
+ # theme('dark brown 2')
+ # theme('dark red')
+ # theme('Light Green 6')
+ ver = version[:version.index('\n')]
+ print('Starting up PySimpleGUI Test Harness\n', 'PySimpleGUI Version ', ver, '\ntcl ver = {}'.format(tkinter.TclVersion),
+ 'tkinter version = {}'.format(tkinter.TkVersion), '\nPython Version {}'.format(sys.version))
+
# ------ Menu Definition ------ #
menu_def = [['&File', ['!&Open', '&Save::savekey', '---', '&Properties', 'E&xit']],
['!&Edit', ['!&Paste', ['Special', 'Normal', ], 'Undo'], ],
@@ -12739,7 +15232,7 @@ def main():
tab1 = Tab('Graph', frame6, tooltip='Graph is in here', title_color='red')
tab2 = Tab('Multiple/Binary Choice Groups', [[Frame('Multiple Choice Group', frame2, title_color='green', tooltip='Checkboxes, radio buttons, etc'),
- Frame('Binary Choice Group', frame3, title_color='white', tooltip='Binary Choice'), ]])
+ Frame('Binary Choice Group', frame3, title_color='#FFFFFF', tooltip='Binary Choice'), ]])
tab3 = Tab('Table and Tree', [[Frame('Structured Data Group', frame5, title_color='red', element_justification='l')]], tooltip='tab 3', title_color='red')
tab4 = Tab('Variable Choice', [[Frame('Variable Choice Group', frame4, title_color='blue')]], tooltip='tab 4', title_color='red')
@@ -12747,17 +15240,20 @@ def main():
[Image(data=DEFAULT_BASE64_ICON), Image(data=DEFAULT_BASE64_LOADING_GIF, key='_IMAGE_'),
Text('You are running the PySimpleGUI.py file instead of importing it.\nAnd are thus seeing a test harness instead of your code', font='ANY 15',
tooltip='My tooltip', key='_TEXT1_')],
- [Frame('Input Text Group', frame1, title_color='red'),
- Text('VERSION\n{}'.format(__version__), size=(25, 4), font='ANY 20'),
- ],
+ [Frame('Input Text Group', frame1, title_color='red')],
+ [Text('PySimpleGUI Version {}'.format(ver), size=(50, None), font='ANY 12')],
+ [Text('PySimpleGUI Location {}'.format(os.path.dirname(os.path.abspath(__file__))), size=(50, None), font='ANY 12')],
+ [Text('Python Version {}'.format(sys.version), size=(50, None), font='ANY 12')],
+ [Text('TK / TCL Versions {} / {}'.format(tk.TkVersion, tk.TclVersion), size=(50, None), font='ANY 12')],
[TabGroup([[tab1, tab2, tab3, tab4]], key='_TAB_GROUP_', )],
[Button('Button'), B('Hide Stuff', metadata='my metadata'),
Button('ttk Button', use_ttk_buttons=True, tooltip='This is a TTK Button'),
Button('See-through Mode', tooltip='Make the background transparent'),
+ Button('Install PySimpleGUI from GitHub', button_color=('white', 'red') ,key='-INSTALL-'),
Button('Exit', tooltip='Exit button')],
]
- layout = [[Column([[Menu(menu_def, key='_MENU_')]] + layout1), Column([[ProgressBar(max_value=800, size=(50, 25), orientation='v', key='+PROGRESS+')]])]]
+ layout = [[Column([[Menu(menu_def, key='_MENU_', font='Courier 15')]] + layout1), Column([[ProgressBar(max_value=800, size=(45, 25), orientation='v', key='+PROGRESS+')]])]]
window = Window('Window Title', layout,
# font=('Helvetica', 18),
# background_color='black',
@@ -12772,12 +15268,13 @@ def main():
)
# graph_elem.DrawCircle((200, 200), 50, 'blue')
i = 0
- Print('', location=(0, 0), font='Courier 12', size=(60, 15), grab_anywhere=True)
+ Print('', location=(0, 0), font='Courier 10', size=(100, 20), grab_anywhere=True)
+ # print(window.element_list())
while True: # Event Loop
event, values = window.Read(timeout=5)
if event != TIMEOUT_KEY:
print(event, values)
- Print(event, text_color='green', background_color='white', end='')
+ Print(event, text_color='white', background_color='red', end='')
Print(values)
if event is None or event == 'Exit':
break
@@ -12802,7 +15299,12 @@ def main():
elif event == 'About...':
popup_no_wait('About this program...', 'You are looking at the test harness for the PySimpleGUI program')
elif event.startswith('See'):
- window.set_transparent_color(LOOK_AND_FEEL_TABLE[get_theme()]['BACKGROUND'])
+ window.set_transparent_color(theme_background_color())
+ elif event == '-INSTALL-':
+ _upgrade_gui()
+
+ i += 1
+ # _refresh_debugger()
window.close()
@@ -12844,7 +15346,6 @@ popup_timed = PopupTimed
popup_yes_no = PopupYesNo
sgprint = Print
sgprint_close = PrintClose
-quit = Quit
rgb = RGB
set_global_icon = SetGlobalIcon
set_options = SetOptions
@@ -12855,9 +15356,12 @@ test = main
theme(CURRENT_LOOK_AND_FEEL)
-
# -------------------------------- ENTRY POINT IF RUN STANDALONE -------------------------------- #
if __name__ == '__main__':
+ if len(sys.argv) > 1 and sys.argv[1] == 'upgrade':
+ _upgrade_gui()
+ exit(69)
+
main()
exit(69)
diff --git a/readme_creator/make_real_readme.py b/readme_creator/make_real_readme.py
index 2c5f26fe..54fa5a94 100644
--- a/readme_creator/make_real_readme.py
+++ b/readme_creator/make_real_readme.py
@@ -1,11 +1,9 @@
from inspect import getmembers, isfunction, isclass, getsource, signature, _empty, isdatadescriptor
from datetime import datetime
-import PySimpleGUIlib
-import click
-import logging
-import json
-import re
-import os
+import PySimpleGUIlib, click, textwrap, logging, json, re, os
+
+from collections import namedtuple
+triplet = namedtuple('triplet', 'name value atype'.split(' '))
########################################################
# _ _ _ #
@@ -18,18 +16,9 @@ import os
# |_| #
########################################################
TAB_char = ' '
-TABLE_TEMPLATE='''
- Parameter Descriptions:
-
- |Name|Meaning|
- |---|---|
- {md_table}
- {md_return}
-
- '''
TABLE_ROW_TEMPLATE = '|{name}|{desc}|'
-TABLE_RETURN_TEMPLATE = '|||\n| **return** | {return_guy} |'
-TABLE_Only_table_RETURN_TEMPLATE = '''|Name|Meaning|\n|---|---|\n| **return** | $ |''' # $ - is the part for return value
+TABLE_RETURN_TEMPLATE = '|||\n|| **return** | {} |'
+TABLE_Only_table_RETURN_TEMPLATE = '''|Type|Name|Meaning|\n|---|---|---|\n|| **return** | $ |''' # $ - is the part for return value
##############################################################################
# _ _ #
@@ -89,67 +78,20 @@ CLASS
}
"""
-def get_params_part(code: str, versbose=True) -> dict:
- """
- Find ":param " part in given "doc string".
-
- from __doc__ to {
- 'parameter' : 'desctiption',
- 'parameter2' : 'desctiption2',
- 'parameter3' : 'desctiption3',
- }
- """
- code = code.strip()
-
- # if doc_string is empty
- if code == None or code == '' or ':param' not in code:
- return {}
- elif ':return' in code: # strip ':return:'
- new_code = code[:code.index(':return:')]
-
- regg_ = re.compile(r':return[\d\D]*?:param', flags=re.MULTILINE)
- if len(list(regg_.finditer(new_code))) > 0:
- if versbose:
- print(f'warning-> ":return" MUST BY AT THE END. FIX IT NOW in "{code}"!!!\nBut i will try to parse it...')
- code = re.sub(regg_, r':param', code)
- else:
- code = new_code
-
- try:
- only_params = code[code.index(':param'):] # get_only_params_string(code)
- except Exception as e:
- if versbose:
- print(f'SORRY, fail at parsing that stuff in "{code}"')
- return {}
-
- # making dict
- param_lines = only_params.split(':param ')
- param_lines = [re.sub(r'[ ]{2,}', ' ', i.strip(' ').strip('\t').replace('\n', ' '), flags=re.MULTILINE)
- for i in param_lines if i.strip()] # filter empty lines
-
- args_kwargs_pairs = {}
- for i in param_lines:
-
- cols = i.split(':')
- param_name, els = cols[0], '\n'.join(
- [j.strip() for j in ':'.join(cols[1:]).split('\n')])
- # param_name, els = cols[0], ' '.join([j.strip() for j in ':'.join(cols).split('\n')]) # can be this:
-
- param_name, els = param_name.strip(), els.strip()
- args_kwargs_pairs[param_name] = els
-
- return args_kwargs_pairs
-
-
def get_return_part(code: str, line_break=None) -> str:
""" Find ":return:" part in given "doc string"."""
if not line_break:
- line_break = '
'
+ # line_break = '
'
+ line_break = ''
if ':return:' not in code:
return ''
- return code[code.index(':return:')+len(':return:'):].strip().replace('\n', line_break)
+
+ only_return = code[code.index(':return:')+len(':return:'):].strip().replace('\n', line_break)
+ if ':rtype' in only_return:
+ only_return = only_return.split(':rtype')[0]
+ return only_return
def special_cases(function_name, function_obj, sig, doc_string, line_break=None):
@@ -274,8 +216,14 @@ def get_doc_desc(doc, original_obj):
def is_propery(func):
return isdatadescriptor(func) and not isfunction(func)
-def get_sig_table_parts(function_obj, function_name, doc_string, logger=None, is_method=False, line_break=None, insert_md_section_for__class_methods=False):
- """ Convert "function + __doc__" tp "method call + params table" in MARKDOWN """
+def get_sig_table_parts(function_obj, function_name, doc_string,
+ logger=None, is_method=False, line_break=None,
+ insert_md_section_for__class_methods=False):
+ """
+ Convert python object "function + __doc__"
+ to
+ "method call + params table" in MARKDOWN
+ """
doc_string = doc_string.strip()
# qpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqp
# 0 0 Making INIT_CALL 0 0 #
@@ -287,32 +235,29 @@ def get_sig_table_parts(function_obj, function_name, doc_string, logger=None, is
except Exception as e:
if logger: logger.error(f'PROBLEM WITH "{function_obj}" "{function_name}":\nit\'s signature is BS. Ok, I will just return \'\' for \'signature\' and \'param_table\'\nOR BETTER - delete it from the 2_readme.md.\n======')
return '', ''
+
+
if not is_propery(function_obj):
for key in sig:
val = sig[key].default
- if 'self' == str(key):
- continue
- if val == _empty: rows.append(key)
- elif val == None: rows.append(f'{key}=None')
- elif type(val) is int: rows.append(f'{key}={val}')
- elif type(val) is str: rows.append(f'{key}="{val}"')
- elif type(val) is tuple: rows.append(f'{key}={val}')
- elif type(val) is bool: rows.append(f'{key}={val}')
- elif type(val) is bytes: rows.append(f'{key}=...')
+ if 'self' == str(key): continue
+ elif key == 'args': rows.append('args=*<1 or N object>')
+ elif val == _empty: rows.append(key)
+ elif val == None: rows.append(f'{key}=None')
+ elif type(val) in (int, float): rows.append(f'{key}={val}')
+ elif type(val) is str: rows.append(f'{key}="{val}"')
+ elif type(val) is tuple: rows.append(f'{key}={val}')
+ elif type(val) is bool: rows.append(f'{key}={val}')
+ elif type(val) is bytes: rows.append(f'{key}=...')
else:
raise Exception(f'IDK this type -> {key, val}')
sig_content = f',\n{TAB_char}'.join(rows) if len(rows) > 2 else f', '.join(rows) if rows else ''
- # # # make 2 line signature into 1-line
- # # # sig_content = f',\n{TAB_char}'.join(rows)
- # # # if sig_content.count('\n') < 3: sig_content = re.sub(r'\n[ \t]{,8}', ' ', sig_content, flags=re.MULTILINE)
-
sign = "\n\n{0}\n\n```\n{1}({2})\n```".format(get_doc_desc(doc_string, function_obj), function_name, sig_content)
if is_method:
if insert_md_section_for__class_methods:
- # sign = "#### {1}\n\n{0}\n\n```\n{1}({2})\n```".format(get_doc_desc(doc_string, function_obj), function_name, sig_content)
sign = "\n\n{0}\n\n```\n{1}({2})\n```".format(get_doc_desc(doc_string, function_obj), function_name, sig_content)
else:
sign = "{0}\n\n```\n{1}({2})\n```".format(get_doc_desc(doc_string, function_obj), function_name, sig_content)
@@ -334,25 +279,89 @@ def get_sig_table_parts(function_obj, function_name, doc_string, logger=None, is
if not return_guy:
md_return = return_guy = ''
else:
- return_guy = return_guy.strip()
- md_return = TABLE_RETURN_TEMPLATE.format(return_guy=return_guy)
- # return_guy = f'\n\nreturn value: {return_guy}\n'
- # return_guy_val_str = return_guy
+ md_return = TABLE_RETURN_TEMPLATE.format(return_guy.strip())
# 2
- md_table = '\n'.join([TABLE_ROW_TEMPLATE.format(name=name, desc=desc)
- for name, desc in
- get_params_part(doc_string).items()])
+ def make_md_table_from_docstring(docstring):
+ # print(f'docstring = {docstring}')
+ # print(f'docstring = {type(docstring)}')
+ row_n_type_regex = re.compile(r':param ([\s\S]*?):([\s\S]*?):type [\s\S]*?:([\d\D]*?)\n', flags=re.M|re.DOTALL)
+ # row_n_type_regex = re.compile(r':param ([\d\w]+):([\d\D]*?):type [\w\d]+:([\d\D].*?)$', flags=re.M|re.DOTALL)
+
+
+
+ '''replace WITH regex'''
+ def replace_re(i, a=r' ',z=' '): return re.sub(a,z,i, flags=re.MULTILINE).strip()
+
+ def process_type(txt):
+ '''
+ striping brackets () from txt:
+ Example:
+ (str) -> str
+ Union[str, Tuple[str, int]] -> Union[str, Tuple[str, int]]
+ '''
+ if re.compile(r'\(\s?\w+\s?\)', flags=re.M|re.DOTALL).match(txt):
+ return txt.rstrip(')').lstrip('(')
+ else:
+ return txt
+
+ # if 'led by application to change the tooltip text for an Element. Normally invoked using ' in docstring:
+ # pass
+ # print(123)
+
+
+ # |> find PARAM, PARAM_TYPE, PARAM_DESCRIPTIONe
+ trips = [triplet( i.group(1), replace_re(i.group(2), r'\s{2,}', ' '), process_type(i.group(3).strip()))
+ for index, i in enumerate(re.finditer(row_n_type_regex, docstring + ' \n'))]
+ if not trips:
+ raise Exception('no _TRIPs found!')
+
+ # ===|> format markdown table
+ # ---------------------------
+
+ # ROW template:
+ max_type_width, max_name_width = 20, 20
+ try:
+ max_type_width, max_name_width = max([len(i.atype) for i in trips]), max([len(i.name) for i in trips])
+ except Exception as e:
+ pass
+ row_template = f'| {{: ^{max_type_width}}} | {{: ^{max_name_width}}} | {{}} |'
+
+ # rows, and finally table.
+ rows = [row_template.format(i.atype, i.name, i.value) for i in trips]
+
+ row_n_type_regex = re.compile(r':param ([\d\w\*\s]+):([\d\D]*?):type [\w\d]+:([\d\D].*?)\n', flags=re.M|re.DOTALL)
+
+ try: # try to get return value
+
+ # return_regex = re.compile(r':return:\s*(.*?):rtype:\s*(.*?)\n', flags=re.M|re.DOTALL)
+ regex_pattern = re.compile(r':return:\s*(.*?)\n\s*:rtype:\s*(.*?)\n', flags=re.M|re.DOTALL)
+ a_doc = docstring + ' \n'
+ aa = list(re.finditer(regex_pattern, a_doc))[0]
+ text, atype = aa.group(1).strip(), aa.group(2).strip()
+
+ rows.append(f'| {atype} | **RETURN** | {text}')
+
+ except Exception as e:
+ print(e)
+ # print(f'docstring = {docstring}')
+ pass
+
+ header = '\nParameter Descriptions:\n\n|Type|Name|Meaning|\n|--|--|--|\n'
+
+ md_table = header+'\n'.join(rows)
+ # md_table = '\n'.join(rows)
+ return md_table
+ # md_table = '\n'.join([TABLE_ROW_TEMPLATE.format(name=name, desc=desc)
+ # for name, desc in
+ # get_params_part(doc_string).items()])
# 3
- params_TABLE = TABLE_TEMPLATE.format(md_table=md_table, md_return=md_return).replace(TAB_char, '').replace(' ', '').replace('\t', '')
-
- # 1 and N
- # if len(get_params_part(doc_string).items()) == 1:
- # params_TABLE = TABLE_TEMPLATE.replace('Parameters Descriptions:', 'Parameter Description:').format(md_table=md_table, md_return=md_return).replace(TAB_char, '').replace(' ', '').replace('\t', '')
- # else:
- # params_TABLE = TABLE_TEMPLATE.format(md_table=md_table, md_return=md_return).replace(TAB_char, '').replace(' ', '').replace('\t', '')
+ try:
+ params_TABLE = md_table = make_md_table_from_docstring(doc_string)
+ except Exception as e:
+ params_TABLE = md_table = ''
if not md_table.strip():
params_TABLE = ''
@@ -363,7 +372,8 @@ def get_sig_table_parts(function_obj, function_name, doc_string, logger=None, is
return sign, params_TABLE
-def pad_n(text): return f'\n{text}\n'
+def pad_n(text):
+ return f'\n{text}\n'
def render(injection, logger=None, line_break=None, insert_md_section_for__class_methods=False):
@@ -402,7 +412,18 @@ def readfile(fname):
return ff.read()
-def main(do_full_readme=False, files_to_include: list = [], logger:object=None, output_name:str=None, delete_html_comments:bool=True, delete_x3_newlines:bool=True, allow_multiple_tags:bool=True, line_break:str=None, insert_md_section_for__class_methods:bool=True, remove_repeated_sections_classmethods:bool=False, output_repeated_tags:bool=False, skip_dunder_method:bool=True):
+def main(do_full_readme=False,
+ files_to_include: list = [],
+ logger:object=None,
+ output_name:str=None,
+ delete_html_comments:bool=True,
+ delete_x3_newlines:bool=True,
+ allow_multiple_tags:bool=True,
+ line_break:str=None,
+ insert_md_section_for__class_methods:bool=True,
+ remove_repeated_sections_classmethods:bool=False,
+ output_repeated_tags:bool=False,
+ skip_dunder_method:bool=True):
"""
Goal is:
1) load 1_.md 2_.md 3_.md 4_.md
@@ -430,11 +451,9 @@ def main(do_full_readme=False, files_to_include: list = [], logger:object=None,
# 888888888888888888888888888888888888888888
# =========== 1 loading files =========== #
- # 888888888888888888888888888888888888888888
- readme = readfile('2_readme.md')
- # 8888888888888888888888888888888888888888888888888888888888888888888888888
# =========== 2 GET classes, funcions, varialbe a.k.a. memes =========== #
# 8888888888888888888888888888888888888888888888888888888888888888888888888
+ readme = readfile('2_readme.md')
def valid_field(pair):
bad_fields = 'LOOK_AND_FEEL_TABLE copyright __builtins__ icon'.split(' ')
@@ -449,13 +468,15 @@ def main(do_full_readme=False, files_to_include: list = [], logger:object=None,
return False
return True
+
psg_members = [i for i in getmembers(PySimpleGUIlib) if valid_field(i)] # variables, functions, classes
# psg_members = getmembers(PySimpleGUIlib) # variables, functions, classes
psg_funcs = [o for o in psg_members if isfunction(o[1])] # only functions
psg_classes = [o for o in psg_members if isclass(o[1])] # only classes
psg_classes_ = list(set([i[1] for i in psg_classes])) # boildown B,Btn,Butt -into-> Button
psg_classes = list(zip([i.__name__ for i in psg_classes_], psg_classes_))
-
+ # psg_props = [o for o in psg_members if type(o[1]).__name__ == 'property']
+
# 8888888888888888888888888888888888888888888888888888888
# =========== 3 find all tags in 2_readme =========== #
# 8888888888888888888888888888888888888888888888888888888
@@ -478,14 +499,17 @@ def main(do_full_readme=False, files_to_include: list = [], logger:object=None,
# 8888888888888888888888888888888888888888888888888888888
# >1 REMOVE HEADER
+
started_mark = ''
if started_mark in readme:
- readme = readme[readme.index(started_mark)+len(started_mark):]
+ readme = readme.split('')[1]
+ # readme = re.sub(r'([\d\D]*)', '', readme, flags=re.MULTILINE)
+
# 2> find good tags
re_tags = re.compile(r'')
mark_points = [i for i in readme.split('\n') if re_tags.match(i)]
-
+
special_dunder_methods = ['init', 'repr', 'str', 'next']
# 3> find '_' tags OPTION
if skip_dunder_method:
@@ -511,8 +535,10 @@ def main(do_full_readme=False, files_to_include: list = [], logger:object=None,
injection_points = []
classes_method_tags = [j for j in mark_points if 'func.' not in j]
+
func_tags = [j for j in mark_points if 'func.' in j]
+
# 0===0 functions 0===0
for tag in func_tags:
@@ -618,11 +644,20 @@ def main(do_full_readme=False, files_to_include: list = [], logger:object=None,
# SPECIAL CASE: X.doc tag
if injection['part2'] == 'doc':
- readme = readme.replace(injection['tag'], injection['parent_class'].__doc__)
+ a_tag = injection['tag']
+ print(f'a_tag = {a_tag}')
+ print(f'a_tag = {type(a_tag)}')
+ doc_ = '' if not injection['parent_class'].__doc__ else injection['parent_class'].__doc__
+ # if doc_ == None or a_tag == None:
+ # import pdb; pdb.set_trace();
+
+ readme = readme.replace(a_tag, doc_)
else:
+
+
content = render(injection, logger=logger, line_break=line_break,
- insert_md_section_for__class_methods=insert_md_section_for__class_methods,)
+ insert_md_section_for__class_methods=insert_md_section_for__class_methods)
tag = injection["tag"]
if content:
@@ -632,6 +667,9 @@ def main(do_full_readme=False, files_to_include: list = [], logger:object=None,
readme = readme.replace(tag, content)
+ bad_part = '''\n\nParameter Descriptions:\n\n|Type|Name|Meaning|\n|--|--|--|\n\n'''
+ readme = readme.replace(bad_part, '\n')
+
# 2> log some data
if logger:
success_tags_str = '\n'.join(success_tags).strip()
@@ -645,6 +683,8 @@ def main(do_full_readme=False, files_to_include: list = [], logger:object=None,
logger.info(good_message)
logger.info(bad_message)
+ print(123)
+
# 8888888888888888888888888888888888
# =========== 6 join =========== #
diff --git a/readme_creator/params.txt b/readme_creator/params.txt
new file mode 100644
index 00000000..efd0caae
--- /dev/null
+++ b/readme_creator/params.txt
@@ -0,0 +1,166 @@
+:param .*?\n\s*:para
+
+
+ :param size: (w,h) w=characters-wide, h=rows-high
+ :type size: Tuple[int, int]
+
+ :param file_types: List of extensions to show using wildcards. All files (the default) = (("ALL Files", "*.*"),)
+ :type file_types: Tuple[Tuple[str,str]]
+
+ :param yes_no: If True, displays Yes and No buttons instead of Ok
+ :type yes_no: (bool)
+ :param keep_on_top: If True the window will remain above all current windows
+ :type keep_on_top: (bool)
+ ===============
+
+ :param *args: Variable number of items to display
+ :type *args: (Any)
+ :param title: Title to display in the window.
+ :type title: (str)
+ :param button_type: Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK).
+ :type button_type: (enum)
+
+ :param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+
+ :param auto_close: if True window will close itself
+ :type auto_close: (bool)
+ :param auto_close_duration: Older versions only accept int. Time in seconds until window will close
+ :type auto_close_duration: Union[int, float]
+
+ :param non_blocking: if True the call will immediately return rather than waiting on user input
+ :type non_blocking: (bool)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
+ :param line_width: Width of lines in characters
+ :type line_width: (int)
+
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param keep_on_top: If True the window will remain above all current windows
+ :type keep_on_top: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
+
+
+ :return: Returns text of the button that was pressed. None will be returned if user closed window with X
+ :rtype: Union[str, None, TIMEOUT_KEY]
+
+
+ :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)
+ :type pad: (int, int) or ((int,int),(int,int))
+
+===============================
+===============================
+===============================
+===============================
+
+ :param message: message displayed to user
+ :type message: (str)
+ :param title: Window title
+ :type title: (str)
+ :param default_path: path to display to user as starting point (filled into the input field)
+ :type default_path: (str)
+ :param no_window: if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown
+ :type no_window: (bool)
+ :param size: (width, height) of the InputText Element
+ :type size: Tuple[int, int]
+ :param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
+ :param background_color: color of background
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param keep_on_top: If True the window will remain above all current windows
+ :type keep_on_top: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
+ :param initial_folder: location in filesystem to begin browsing
+ :type initial_folder: (str)
+ :return: string representing the path chosen, None if cancelled or window closed with X
+ :rtype: Union[str, None]
+
+
+ :param message: message displayed to user
+ :type message: (str)
+ :param title: Window title
+ :type title: (str)
+ :param default_path: path to display to user as starting point (filled into the input field)
+ :type default_path: (str)
+ :param default_extension: If no extension entered by user, add this to filename (only used in saveas dialogs)
+ :type default_extension: (str)
+ :param save_as: if True, the "save as" dialog is shown which will verify before overwriting
+ :type save_as: (bool)
+ :param multiple_files: if True, then allows multiple files to be selected that are returned with ';' between each filename
+ :type multiple_files: (bool)
+ :param file_types: List of extensions to show using wildcards. All files (the default) = (("ALL Files", "*.*"),)
+ :type file_types: Tuple[Tuple[str,str]]
+ :param no_window: if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown
+ :type no_window: (bool)
+ :param size: (width, height) of the InputText Element
+ :type size: Tuple[int, int]
+ :param button_color: Color of the button (text, background)
+ :type button_color: Tuple[str, str]
+ :param background_color: background color of the entire window
+ :type background_color: (str)
+ :param text_color: color of the text
+ :type text_color: (str)
+ :param icon: filename or base64 string to be used for the window's icon
+ :type icon: Union[bytes, str]
+ :param font: specifies the font family, size, etc
+ :type font: Union[str, Tuple[str, int]]
+ :param no_titlebar: If True no titlebar will be shown
+ :type no_titlebar: (bool)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
+ :param keep_on_top: If True the window will remain above all current windows
+ :type keep_on_top: (bool)
+ :param location: Location of upper left corner of the window
+ :type location: Tuple[int, int]
+ :param initial_folder: location in filesystem to begin browsing
+ :type initial_folder: (str)
+ :return: string representing the file(s) chosen, None if cancelled or window closed with X
+ :rtype: Union[str, None]
+
+=====================================
+=====================================
+=====================================
+
+ :param title: text to display in eleemnt
+ :type title: (str)
+ :param current_value: current value
+ :type current_value: (int)
+ :param max_value: max value of QuickMeter
+ :type max_value: (int)
+ :param key: Used with window.FindElement and with return values to uniquely identify this element
+ :type key: Union[str, int, tuple]
+ :param *args: stuff to output
+ :type *args: (Any)
+ :param orientation: 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical' / 'v')
+ :type orientation: (str)
+ :param bar_color: color of a bar line
+ :type bar_color: str
+ :param button_color: button color (foreground, background)
+ :type button_color: Tuple[str, str]
+ :param size: (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE)
+ :type size: Tuple[int, int]
+ :param border_width: width of border around element
+ :type border_width: (int)
+ :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
+ :type grab_anywhere: (bool)
diff --git a/readme_creator/readme.md b/readme_creator/readme.md
index e131764c..3a7f2ee7 100644
--- a/readme_creator/readme.md
+++ b/readme_creator/readme.md
@@ -2,7 +2,7 @@
[](http://pepy.tech/project/pysimplegui) tkinter
-[](https://pepy.tech/project/pysimplegui27) tkinter 2.7 (WARNING - DISAPPEARING Entirely on 12/31/2019!!!)
+[](https://pepy.tech/project/pysimplegui27) tkinter 2.7
[](https://pepy.tech/project/pysimpleguiqt) Qt
@@ -14,8 +14,7 @@


-
-
+


@@ -43,7 +42,7 @@ pip3 install pysimplegui
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('DarkAmber') # Add a touch of color
+sg.theme('DarkAmber') # Add a touch of color
# All the stuff inside your window.
layout = [ [sg.Text('Some text on Row 1')],
[sg.Text('Enter something on Row 2'), sg.InputText()],
@@ -278,7 +277,7 @@ This makes the coding process extremely quick and the amount of code very small
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('DarkAmber') # Add a little color to your windows
+sg.theme('DarkAmber') # Add a little color to your windows
# All the stuff inside your window. This is the PSG magic code compactor...
layout = [ [sg.Text('Some text on Row 1')],
[sg.Text('Enter something on Row 2'), sg.InputText()],
@@ -727,7 +726,7 @@ Creating and reading the user's inputs for the window occupy the last 2 lines of
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Blue 3') # please make your creations colorful
+sg.theme('Dark Blue 3') # please make your creations colorful
layout = [ [sg.Text('Filename')],
[sg.Input(), sg.FileBrowse()],
@@ -827,9 +826,9 @@ Your program have 2 or 3 windows and you're concerned? Below you'll see 11 wind

-Just because you can't match a pair of socks doesn't mean your windows have to all look the same gray color. Choose from over 100 different "Themes". Add 1 line call to `change_look_and_feel` to instantly transform your window from gray to something more visually pleasing to interact with. If you mispell the theme name badly or specify a theme name is is missing from the table of allowed names, then a theme will be randomly assigned for you. Who knows, maybe the theme chosen you'll like and want to use instead of your original plan.
+Just because you can't match a pair of socks doesn't mean your windows have to all look the same gray color. Choose from over 100 different "Themes". Add 1 line call to `theme` to instantly transform your window from gray to something more visually pleasing to interact with. If you mispell the theme name badly or specify a theme name is is missing from the table of allowed names, then a theme will be randomly assigned for you. Who knows, maybe the theme chosen you'll like and want to use instead of your original plan.
-In PySimpleGUI release 4.6 the number of themes was dramatically increased from a couple dozen to over 100. To use the color schemes shown in the window below, add a call to `change_look_and_feel('Theme Name)` to your code, passing in the name of thd desired color theme. To see this window and the list of available themes on your releeae of softrware, call the function `preview_all_look_and_feel_themes()`. This will create a window with the frames like those below. It will shows you exactly what's available in your version of PySimpleGUI.
+In PySimpleGUI release 4.6 the number of themes was dramatically increased from a couple dozen to over 100. To use the color schemes shown in the window below, add a call to `theme('Theme Name)` to your code, passing in the name of thd desired color theme. To see this window and the list of available themes on your releeae of softrware, call the function `theme_previewer()`. This will create a window with the frames like those below. It will shows you exactly what's available in your version of PySimpleGUI.
In release 4.9 another 32 Color Themes were added... here are the current choices
@@ -1377,7 +1376,7 @@ Popup - Display a popup Window with as many parms as you wish to include. This
"print" statement. It's also great for "pausing" your program's flow until the user can read some error messages.
```
-Popup(args,
+Popup(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -1400,24 +1399,24 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|*args|(Any) Variable number of your arguments. Load up the call with stuff to see!|
-|title|(str) Optional title for the window. If none provided, the first arg will be used instead.|
-|button_color|Tuple[str, str] Color of the buttons shown (text color, button color)|
-|background_color|(str) Window's background color|
-|text_color|(str) text color|
-|button_type|(enum) NOT USER SET! Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). There are many Popup functions and they call Popup, changing this parameter to get the desired effect.|
-|auto_close|(bool) If True the window will automatically close|
-|auto_close_duration|(int) time in seconds to keep window open before closing it automatically|
-|custom_text|Union[Tuple[str, str], str] A string or pair of strings that contain the text to display on the buttons|
-|non_blocking|(bool) If True then will immediately return from the function without waiting for the user's input.|
-|icon|Union[str, bytes] icon to display on the window. Same format as a Window call|
-|line_width|(int) Width of lines in characters. Defaults to MESSAGE_BOX_LINE_WIDTH|
-|font|Union[str, tuple(font name, size, modifiers) specifies the font family, size, etc|
-|no_titlebar|(bool) If True will not show the frame around the window and the titlebar across the top|
-|grab_anywhere|(bool) If True can grab anywhere to move the window. If no_titlebar is True, grab_anywhere should likely be enabled too|
-|location|Tuple[int, int] Location on screen to display the top left corner of window. Defaults to window centered on screen|
+|*args|Variable number of your arguments. Load up the call with stuff to see! :type *args: (Any)|
+|title|Optional title for the window. If none provided, the first arg will be used instead. :type title: (str)|
+|button_color|Color of the buttons shown (text color, button color) :type button_color: Tuple[str, str]|
+|background_color|Window's background color :type background_color: (str)|
+|text_color|text color :type text_color: (str)|
+|button_type|NOT USER SET! Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). There are many Popup functions and they call Popup, changing this parameter to get the desired effect. :type button_type: (enum)|
+|auto_close|If True the window will automatically close :type auto_close: (bool)|
+|auto_close_duration|time in seconds to keep window open before closing it automatically :type auto_close_duration: (int)|
+|custom_text|A string or pair of strings that contain the text to display on the buttons :type custom_text: Union[Tuple[str, str], str]|
+|non_blocking|If True then will immediately return from the function without waiting for the user's input. :type non_blocking: (bool)|
+|icon|icon to display on the window. Same format as a Window call :type icon: Union[str, bytes]|
+|line_width|Width of lines in characters. Defaults to MESSAGE_BOX_LINE_WIDTH :type line_width: (int)|
+|font|specifies the font family, size, etc :type font: Union[str, tuple(font name, size, modifiers]|
+|no_titlebar|If True will not show the frame around the window and the titlebar across the top :type no_titlebar: (bool)|
+|grab_anywhere|If True can grab anywhere to move the window. If no_titlebar is True, grab_anywhere should likely be enabled too :type grab_anywhere: (bool)|
+|location|Location on screen to display the top left corner of window. Defaults to window centered on screen :type location: Tuple[int, int]|
|||
-| **return** | Union[str, None] Returns text of the button that was pressed. None will be returned if user closed window with X |
+| **return** | Returns text of the button that was pressed. None will be returned if user closed window with X
:rtype: Union[str, None] |
The other output Popups are variations on parameters. Usually the button_type parameter is the primary one changed.
@@ -1442,7 +1441,7 @@ Show a scrolled Popup window containing the user's text that was supplied. Use
want, just like a print statement.
```
-PopupScrolled(args,
+PopupScrolled(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -1501,7 +1500,7 @@ If `non_blocking` parameter is set, then the call will not blocking waiting for
Show Popup window and immediately return (does not block)
```
-PopupNoWait(args,
+PopupNoWait(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -1576,22 +1575,22 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|message|(str) message displayed to user|
-|title|(str) Window title|
-|default_text|(str) default value to put into input area|
-|password_char|(str) character to be shown instead of actually typed characters|
-|size|Tuple[int, int] (width, height) of the InputText Element|
-|button_color|Tuple[str, str] Color of the button (text, background)|
-|background_color|(str) background color of the entire window|
-|text_color|(str) color of the message text|
-|icon|Union[bytes, str] filename or base64 string to be used for the window's icon|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|no_titlebar|(bool) If True no titlebar will be shown|
-|grab_anywhere|(bool) If True can click and drag anywhere in the window to move the window|
-|keep_on_top|(bool) If True the window will remain above all current windows|
-|location|Tuyple[int, int] (x,y) Location on screen to display the upper left corner of window|
+|message|(str) message displayed to user :type message: (str)|
+|title|(str) Window title :type title: (str)|
+|default_text|(str) default value to put into input area :type default_text: (str)|
+|password_char|(str) character to be shown instead of actually typed characters :type password_char: (str)|
+|size|(width, height) of the InputText Element :type size: Tuple[int, int]|
+|button_color|Color of the button (text, background) :type button_color: Tuple[str, str]|
+|background_color|(str) background color of the entire window :type background_color: (str)|
+|text_color|(str) color of the message text :type text_color: (str)|
+|icon|filename or base64 string to be used for the window's icon :type icon: Union[bytes, str]|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|no_titlebar|(bool) If True no titlebar will be shown :type no_titlebar: (bool)|
+|grab_anywhere|(bool) If True can click and drag anywhere in the window to move the window :type grab_anywhere: (bool)|
+|keep_on_top|(bool) If True the window will remain above all current windows :type keep_on_top: (bool)|
+|location|(x,y) Location on screen to display the upper left corner of window :type location: Tuple[int, int]|
|||
-| **return** | Union[str, None] Text entered or None if window was closed or cancel button clicked |
+| **return** | Text entered or None if window was closed or cancel button clicked
:rtype: Union[str, None] |
```python
import PySimpleGUI as sg
@@ -1942,7 +1941,7 @@ Writing the code for this one is just as straightforward. There is one tricky t
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Blue 3') # please make your windows colorful
+sg.theme('Dark Blue 3') # please make your windows colorful
layout = [[sg.Text('Filename')],
[sg.Input(), sg.FileBrowse()],
@@ -1961,7 +1960,7 @@ Read on for detailed instructions on the calls that show the window and return y
All of your PySimpleGUI programs will utilize one of these 2 design patterns depending on the type of window you're implementing.
-## Pattern 1 - "One-shot Window" - Read a window one time then close it
+## Pattern 1 A - "One-shot Window" - Read a window one time then close it
This will be the most common pattern you'll follow if you are not using an "event loop" (not reading the window multiple times). The window is read and closed.
@@ -1970,7 +1969,7 @@ The input fields in your window will be returned to you as a dictionary (syntact
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Blue 3') # please make your windows colorful
+sg.theme('Dark Blue 3') # please make your windows colorful
layout = [[sg.Text('SHA-1 and SHA-256 Hashes for the file')],
[sg.InputText(), sg.FileBrowse()],
@@ -1984,6 +1983,22 @@ window.close()
source_filename = values[0] # the first input element is values[0]
```
+## Pattern 1 B - "One-shot Window" - Read a window one time then close it (compact format)
+
+Same as Pattern 1, but done in a highly compact way. This example uses the `close` parameter in `window.read` to automatically close the window as part of the read operation (new in version 4.16.0). This enables you to write a single line of code that will create, display, gather input and close a window. It's really powerful stuff!
+
+```python
+import PySimpleGUI as sg
+
+sg.theme('Dark Blue 3') # please make your windows colorful
+
+event, values = sg.Window('SHA-1 & 256 Hash', [[sg.Text('SHA-1 and SHA-256 Hashes for the file')],
+ [sg.InputText(), sg.FileBrowse()],
+ [sg.Submit(), sg.Cancel()]]).read(close=True)
+
+source_filename = values[0] # the first input element is values[0]
+```
+
## Pattern 2 A - Persistent window (multiple reads using an event loop)
Some of the more advanced programs operate with the window remaining visible on the screen. Input values are collected, but rather than closing the window, it is kept visible acting as a way to both output information to the user and gather input data.
@@ -1993,7 +2008,7 @@ This code will present a window and will print values until the user clicks the
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Blue 3') # please make your windows colorful
+sg.theme('Dark Blue 3') # please make your windows colorful
layout = [[sg.Text('Persistent window')],
[sg.Input()],
@@ -2018,15 +2033,15 @@ Do not worry yet what all of these statements mean. Just copy it so you can be
A final note... the parameter `do_not_clear` in the input call determines the action of the input field after a button event. If this value is True, the input value remains visible following button clicks. If False, then the input field is CLEARED of whatever was input. If you are building a "Form" type of window with data entry, you likely want False. The default is to NOT clear the input element (`do_not_clear=True`).
-This example introduces the concept of "keys". Keys are super important in PySimpleGUI as they enable you to identify and work with Elements using names you want to use. Keys can be ANYTHING, except `None`. To access an input element's data that is read in the example below, you will use `values['_IN_']` instead of `values[0]` like before.
+This example introduces the concept of "keys". Keys are super important in PySimpleGUI as they enable you to identify and work with Elements using names you want to use. Keys can be ANYTHING, except `None`. To access an input element's data that is read in the example below, you will use `values['-IN-']` instead of `values[0]` like before.
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Blue 3') # please make your windows colorful
+sg.theme('Dark Blue 3') # please make your windows colorful
-layout = [[sg.Text('Your typed chars appear here:'), sg.Text(size=(12,1), key='_OUTPUT_')],
- [sg.Input(key='_IN_')],
+layout = [[sg.Text('Your typed chars appear here:'), sg.Text(size=(12,1), key='-OUTPUT-')],
+ [sg.Input(key='-IN-')],
[sg.Button('Show'), sg.Button('Exit')]]
window = sg.Window('Window Title', layout)
@@ -2038,9 +2053,9 @@ while True: # Event Loop
break
if event == 'Show':
# change the "output" element to be the value of "input" element
- window['_OUTPUT_'].update(values['_IN_'])
+ window['-OUTPUT-'].update(values['-IN-'])
# above line can also be written without the update specified
- window['_OUTPUT_'](values['_IN_'])
+ window['-OUTPUT-'](values['-IN-'])
window.close()
```
@@ -2057,12 +2072,12 @@ While one goal was making it simple to create a GUI another just as important go
The key to custom windows in PySimpleGUI is to view windows as ROWS of GUI Elements. Each row is specified as a list of these Elements. Put the rows together and you've got a window. This means the GUI is defined as a series of Lists, a Pythonic way of looking at things.
-Let's dissect this little program
+### Let's dissect this little program
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Blue 3') # please make your windows colorful
+sg.theme('Dark Blue 3') # please make your windows colorful
layout = [[sg.Text('Rename files or folders')],
[sg.Text('Source for Folders', size=(15, 1)), sg.InputText(), sg.FolderBrowse()],
@@ -2077,15 +2092,15 @@ folder_path, file_path = values[0], values[1] # get the data from the valu
print(folder_path, file_path)
```
-#### Colors
+### Themes

-The first line of code after the import is a call to `change_look_and_feel`. This single line of code make the window look like the window above instead of the window below. It will also stop PySimpleGUI from nagging you to put one of these calls into your program.
+The first line of code after the import is a call to `theme`.
-
+Until Dec 2019 the way a "theme" was specific in PySimpleGUI was to call `change_look_and_feel`. That call has been replaced by the more simple function `theme`.
-#### Window contents
+### Window contents (The Layout)
Let's agree the window has 4 rows.
@@ -2110,7 +2125,7 @@ For return values the window is scanned from top to bottom, left to right. Each
In our example window, there are 2 fields, so the return values from this window will be a dictionary with 2 values in it. Remember, if you do not specify a `key` when creating an element, one will be created for you. They are ints starting with 0. In this example, we have 2 input elements. They will be addressable as values[0] and values[1]
-#### "Reading" the window's values (also displays the window)
+### "Reading" the window's values (also displays the window)
```python
event, values = window.read()
@@ -2318,13 +2333,13 @@ Let's take a look at your first dictionary-based window.
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Blue 3') # please make your windows colorful
+sg.theme('Dark Blue 3') # please make your windows colorful
layout = [
[sg.Text('Please enter your Name, Address, Phone')],
- [sg.Text('Name', size=(15, 1)), sg.InputText('1', key='_NAME_')],
- [sg.Text('Address', size=(15, 1)), sg.InputText('2', key='_ADDRESS_')],
- [sg.Text('Phone', size=(15, 1)), sg.InputText('3', key='_PHONE_')],
+ [sg.Text('Name', size=(15, 1)), sg.InputText('1', key='-NAME-')],
+ [sg.Text('Address', size=(15, 1)), sg.InputText('2', key='-ADDRESS-')],
+ [sg.Text('Phone', size=(15, 1)), sg.InputText('3', key='-PHONE-')],
[sg.Submit(), sg.Cancel()]
]
@@ -2332,22 +2347,22 @@ window = sg.Window('Simple data entry window', layout)
event, values = window.read()
window.close()
-sg.Popup(event, values, values['_NAME_'], values['_ADDRESS_'], values['_PHONE_'])
+sg.Popup(event, values, values['-NAME-'], values['-ADDRESS-'], values['-PHONE-'])
```
To get the value of an input field, you use whatever value used as the `key` value as the index value. Thus to get the value of the name field, it is written as
- values['_NAME_']
+ values['-NAME-']
-Think of the variable values in the same way as you would a list, however, instead of using 0,1,2, to reference each item in the list, use the values of the key. The Name field in the window above is referenced by `values['_NAME_']`.
+Think of the variable values in the same way as you would a list, however, instead of using 0,1,2, to reference each item in the list, use the values of the key. The Name field in the window above is referenced by `values['-NAME-']`.
You will find the key field used quite heavily in most PySimpleGUI windows unless the window is very simple.
One convention you'll see in many of the demo programs is keys being named in all caps with an underscores at the beginning and the end. You don't HAVE to do this... your key value may look like this:
-`key = '_NAME__'`
+`key = '-NAME-'`
The reason for this naming convention is that when you are scanning the code, these key values jump out at you. You instantly know it's a key. Try scanning the code above and see if those keys pop out.
-`key = '_NAME__'`
+`key = '-NAME-'`
## The Event Loop / Callback Functions
@@ -2504,6 +2519,76 @@ event, values = window.Read(timeout=100)
You can learn more about these async / non-blocking windows toward the end of this document.
+# Themes - Automatic Coloring of Your Windows
+
+In Dec 2019 the function `change_look_and_feel` was replaced by `theme`. The concept remains the same, but a new group of function alls makes it a lot easier to manage colors and other settings.
+
+By default the PySimpleGUI color theme is now `Dark Blue 3`. Gone are the "system default" gray colors. If you want your window to be devoid of all colors so that the system chooses the colors (gray) for you, then set the theme to 'SystemDefault1' or `Default1`.
+
+There are 130 themes available. You can preview these themes by calling `theme_previewer()` which will create a LARGE window displaying all of the color themes available.
+
+As of this writing, these are your available themes.
+
+
+
+## Default is `Dark Blue 3`
+
+
+
+In Dec 2019 the default for all PySimpleGUI windows changed from the system gray with blue buttons to a more complete theme using a grayish blue with white text. Previouisly users were nagged into choosing color theme other than gray. Now it's done for you instead of nagging you.
+
+If you're struggling with this color theme, then add a call to `theme` to change it.
+
+## Theme Name Formula
+
+Themes names that you specify can be "fuzzy". The text does not have to match exactly what you see printed. For example "Dark Blue 3" and "DarkBlue3" and "dark blue 3" all work.
+
+One way to quickly determine the best setting for your window is to simply display your window using a lot of different themes. Add the line of code to set the theme - `theme('Dark Green 1')`, run your code, see if you like it, if not, change the theme string to `'Dark Green 2'` and try again. Repeat until you find something you like.
+
+The "Formula" for the string is:
+
+`Dark Color #`
+
+or
+
+`Light Color #`
+
+Color can be Blue, Green, Black, Gray, Purple, Brown, Teal, Red. The # is optional or can be from 1 to XX. Some colors have a lot of choices. There are 13 "Light Brown" choices for example.
+
+### "System" Default - No Colors
+
+If you're bent on having no colors at all in your window, then choose `Default 1` or `System Default 1`.
+
+If you want the original PySimpleGUI color scheme of a blue button and everything else gray then you can get that with the theme `Default` or `System Default`.
+
+## Theme Functions
+
+The basic theme function call is `theme(theme_name)`. This sets the theme. Calling without a parameter, `theme()` will return the name of the current theme.
+
+If you want to get or modify any of the theme settings, you can do it with these functions that you will find detailed information about in the function definitions section at the bottom of the document. Each will return the current value if no parameter is used.
+
+```python
+theme_background_color
+theme_border_width
+theme_button_color
+theme_element_background_color
+theme_element_text_color
+theme_input_background_color
+theme_input_text_color
+theme_progress_bar_border_width
+theme_progress_bar_color
+theme_slider_border_width
+theme_slider_color
+theme_text_color
+```
+
+These will help you get a list of available choices.
+
+```python
+theme_list
+theme_previewer
+```
+
# Window Object - Beginning a window
The first step is to create the window object using the desired window customizations.
@@ -2892,7 +2977,7 @@ Here is our final program that uses simple addition to add the headers onto the
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Brown 1')
+sg.theme('Dark Brown 1')
headings = ['HEADER 1', 'HEADER 2', 'HEADER 3','HEADER 4']
header = [[sg.Text(' ')] + [sg.Text(h, size=(14,1)) for h in headings]]
@@ -3055,11 +3140,73 @@ You will find information on Elements and all other classes and functions are lo
- Stretch (Qt only)
- Sizer (plain PySimpleGUI only)
+## Keys
+
+***Keys are a super important concept to understand in PySimpleGUI.***
+
+If you are going to do anything beyond the basic stuff with your GUI, then you need to understand keys.
+
+You can think of a "key" as a "name" for an element. Or an "identifier". It's a way for you to identify and talk about an element with the PySimpleGUI library. It's the exact same kind of key as a dictionary key. They must be unique to a window.
+
+Keys are specified when the Element is created using the `key` parameter.
+
+Keys are used in these ways:
+* Specified when creating the element
+* Returned as events. If an element causes an event, its key will be used
+* In the `values` dictionary that is returned from `window.read()`
+* To make updates (changes), to an element that's in the window
+
+After you put a key in an element's definition, the values returned from `window.read` will use that key to tell you the value. For example, if you have an input element in your layout:
+
+`Input(key='mykey')`
+
+And your read looks like this: `event, values = Read()`
+
+Then to get the input value from the read it would be: `values['mykey']`
+
+You also use the same key if you want to call Update on an element. Please see the section Updating Elements to understand that usage. To get find an element object given the element's key, you can call the window method `find_element` (also written `FindElement`, `element`), or you can use the more common lookup mechanism:
+
+```python
+window['key']
+```
+
+While you'll often see keys written as strings in examples in this document, know that keys can be ***ANYTHING***.
+
+Let's say you have a window with a grid of input elements. You could use their row and column location as a key (a tuple)
+
+`key=(row, col)`
+
+Then when you read the `values` variable that's returned to you from calling `Window.read()`, the key in the `values` variable will be whatever you used to create the element. In this case you would read the values as:
+`values[(row, col)]`
+
+Most of the time they are simple text strings. In the Demo Programs, keys are written with this convention:
+`_KEY_NAME_` (underscore at beginning and end with all caps letters) or the most recent convention is to use a dash at the beginning and end (e.g. `'-KEY_NAME-'`). You don't have to follow the convention, but it's not a bad one to follow as other users are used to seeing this format and it's easy to spot when element keys are being used.
+
+If you have an element object, to find its key, access the member variable `.Key` for the element. This assumes you've got the element in a variable already.
+
+```python
+text_elem = sg.Text('', key='-TEXT-')
+
+the_key = text_elem.Key
+```
+
+### Default Keys
+
+If you fail to place a key on an Element, then one will be created for you automatically.
+
+For `Buttons`, the text on the button is that button's key. `Text` elements will default to the text's string (for when events are enabled and the text is clicked)
+
+If the element is one of the input elements (one that will cause an generate an entry in the return values dictionary) and you fail to specify one, then a number will be assigned to it beginning with the number 0. The effect will be as if the values are represented as a list even if a dictionary is used.
+
+### Menu Keys
+
+Menu items can have keys associated with them as well. See the section on Menus for more information about these special keys. They aren't the same as Element keys. Like all elements, Menu Element have one of these Element keys. The individual menu item keys are different.
+
## Common Element Parameters
Some parameters that you will see on almost all Element creation calls include:
-- key - Used with window.FindElement and with return values
+- key - Used with window[key], events, and in return value dictionary
- tooltip - Hover your mouse over the elemnt and you'll get a popup with this text
- size - (width, height) - usually measured in characters-wide, rows-high. Sometimes they mean pixels
- font - specifies the font family, size, etc
@@ -3135,34 +3282,7 @@ To specify an underlined, Helvetica font with a size of 15 the values:
#### Key
-If you are going to do anything beyond the basic stuff with your GUI, then you need to understand keys.
-Keys are a way for you to "tag" an Element with a value that will be used to identify that element. After you put a key in an element's definition, the values returned from Read will use that key to tell you the value. For example, if you have an input field:
-
-`Input(key='mykey')`
-
-And your read looks like this: `event, values = Read()`
-
-Then to get the input value from the read it would be: `values['mykey']`
-
-You also use the same key if you want to call Update on an element. Please see the section below on Updates to understand that usage.
-
-Keys can be ANYTHING. Let's say you have a window with a grid of input elements. You could use their row and column location as a key (a tuple)
-
-`key=(row, col)`
-
-Then when you read the `values` variable that's returned to you from calling `Window.Read()`, the key in the `values` variable will be whatever you used to create the element. In this case you would read the values as:
-`values[(row, col)]`
-
-Most of the time they are simple text strings. In the Demo Programs, keys are written with this convention:
-`_KEY_NAME_` (underscore at beginning and end with all caps letters) or '-KEY_NAME-. You don't have to follow that convention. It's used so that you can quickly spot when a key is being used.
-
-To find an element's key, access the member variable `.Key` for the element. This assumes you've got the element in a variable already.
-
-```python
-text_elem = sg.Text('', key='-TEXT-')
-
-the_key = text_elem.Key
-```
+See the section above that has full information about keys.
#### Visible
@@ -3194,7 +3314,7 @@ In other words, I am lazy and don't like to type. The result is multiple ways to
This enables you to code much quicker once you are used to using the SDK. The Text Element, for example, has 3 different names `Text`, `Txt` or`T`. InputText can also be written `Input` or `In` .
-The shortcuts aren't limited to Elements. The `Window` method `Window.FindElement` can be written as `Window.Element` because it's such a commonly used function. BUT,even that has now been shortened.
+The shortcuts aren't limited to Elements. The `Window` method `Window.FindElement` can be written as `Window.Element` because it's such a commonly used function. BUT, even that has now been shortened to `window[key]`
It's an ongoing thing. If you don't stay up to date and one of the newer shortcuts is used, you'll need to simply rename that shortcut in the code. For examples Replace sg.T with sg.Text if your version doesn't have sg.T in it.
@@ -3216,26 +3336,26 @@ With proportional spaced fonts (normally the default) the pixel size of one set
---
-## `Window.FindElement(key)` Shortcut `Window[key]`
+## `Window.FindElement(key)` shortened to `Window[key]`
There's been a fantastic leap forward in making PySimpleGUI code more compact.
Instead of writing:
```python
-window.FindElement(key).Update(new_value)
+window.FindElement(key).update(new_value)
```
You can now write it as:
```python
-window[key].Update(new_value)
+window[key].update(new_value)
```
This change has been released to PyPI for PySimpleGUI
-MANY Thanks is owed to the person that suggested and showed me how to do this. It's an incredible find.
+MANY Thanks is owed to the nngogol that suggested and showed me how to do this. It's an incredible find as have been many of his suggestions.
-## `Element.Update()` -> `Element()` shortcut
+## `Element.update()` -> `Element()` shortcut
This has to be one of the strangest syntactical contructs I've ever written.
@@ -3286,7 +3406,7 @@ layout = [[graph_element]]
.
.
.
-graph_element(background_color='blue') # this calls Graph.Update for the previously defined element
+graph_element(background_color='blue') # this calls Graph.update for the previously defined element
```
Hopefully this isn't too confusing. Note that the methods these shortcuts replace will not be removed. You can continue to use the old constructs without changes.
@@ -3306,9 +3426,9 @@ Individual colors are specified using either the color names as defined in tkint
### `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.
-`Text('', key='_TXTOUT_)` will create a `Text` Element that has 0 length. 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. 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('', 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.
### Chortcut functions
The shorthand functions for `Text` are `Txt` and `T`
@@ -3977,7 +4097,7 @@ The order of operations to obtain a tkinter Canvas Widget is:
window = sg.Window('Demo Application - Embedding Matplotlib In PySimpleGUI', layout).Finalize()
# add the plot to the window
- fig_photo = draw_figure(window.FindElement('canvas').TKCanvas, fig)
+ fig_photo = draw_figure(window['canvas'].TKCanvas, fig)
# show it all again and get buttons
event, values = window.read()
@@ -4229,11 +4349,11 @@ to this... with one function call...

-While you can do it on an element by element or window level basis, the easiest way, by far, is a call to `SetOptions`.
+While you can do it on an element by element or window level basis, the easier way is to use either the `theme` calls or `set_options`. These calls will set colors for all window that are created.
-Be aware that once you change these options they are changed for the rest of your program's execution. All of your windows will have that look and feel, until you change it to something else (which could be the system default colors.
+Be aware that once you change these options they are changed for the rest of your program's execution. All of your windows will have that Theme, until you change it to something else.
-This call sets all of the different color options.
+This call sets a number of the different color options.
```python
SetOptions(background_color='#9FB8AD',
@@ -4247,21 +4367,31 @@ SetOptions(background_color='#9FB8AD',
# SystemTray
-This is a PySimpleGUIQt and PySimpleGUIWx only feature. Don't know of a way to do it using tkinter. Your source code for SystemTray is identical for the Qt and Wx implementations. You can switch frameworks by simply changing your import statement.
+In addition to running normal windows, it's now also possible to have an icon down in the system tray that you can read to get menu events. There is a new SystemTray object that is used much like a Window object. You first get one, then you perform Reads in order to get events.
-In addition to running normal windows, it's now also possible to have an icon down in the system tray that you can read to get menu events. There is a new SystemTray object that is used much like a Window object. You first get one, then you perform Reads in order to get events.
+## Tkinter version
+
+While only PySimpleGUIQt and PySimpleGUIWx offer a true "system tray" feature, there is a simulated system tray feature that became available in 2020 for the tkinter version of PySimpleGUI. All of the same objects and method calls are the same and the effect is very similar to what you see with the Wx and Qt versions. The icon is placed in the bottom right corner of the window. Setting the location of it has not yet been exposed, but you can drag it to another location on your screen.
+
+The idea of supporting Wx, Qt, and tkinter with the exact same source code is very appealing and is one of the reasons a tkinter version was developed. You can switch frameworks by simply changing your import statement to any of those 3 ports.
+
+The balloons shown for the tkinter version is different than the message balloons shown by real system tray icons. Instead a nice semi-transparent window is shown. This window will fade in / out and is the same design as the one found in the [ptoaster package](https://github.com/PySimpleGUI/ptoaster).
+
+## SystemTray Object
Here is the definition of the SystemTray object.
```python
-SystemTray(menu=None, filename=None, data=None, data_base64=None, tooltip=None):
+SystemTray(menu=None, filename=None, data=None, data_base64=None, tooltip=None, metadata=None):
'''
SystemTray - create an icon in the system tray
:param menu: Menu definition
:param filename: filename for icon
:param data: in-ram image for icon
:param data_base64: basee-64 data for icon
- :param tooltip: tooltip string '''
+ :param tooltip: tooltip string
+ :param metadata: (Any) User metadata that can be set to ANYTHING
+'''
```
You'll notice that there are 3 different ways to specify the icon image. The base-64 parameter allows you to define a variable in your .py code that is the encoded image so that you do not need any additional files. Very handy feature.
@@ -4272,26 +4402,31 @@ Here is a design pattern you can use to get a jump-start.
This program will create a system tray icon and perform a blocking Read. If the item "Open" is chosen from the system tray, then a popup is shown.
+The same code can be executed on any of the Desktop versions of PySimpleGUI (tkinter, Qt, WxPython)
```python
import PySimpleGUIQt as sg
+# import PySimpleGUIWx as sg
+# import PySimpleGUI as sg
menu_def = ['BLANK', ['&Open', '---', '&Save', ['1', '2', ['a', 'b']], '&Properties', 'E&xit']]
tray = sg.SystemTray(menu=menu_def, filename=r'default_icon.ico')
while True: # The event loop
- menu_item = tray.Read()
+ menu_item = tray.read()
print(menu_item)
if menu_item == 'Exit':
break
elif menu_item == 'Open':
- sg.Popup('Menu item chosen', menu_item)
+ sg.popup('Menu item chosen', menu_item)
```
The design pattern creates an icon that will display this menu:

-### Icons
+### Icons for System Trays
+
+System Tray Icons are in PNG & GIF format when running on PySimpleGUI (tkinter version). PNG, GIF, and ICO formats will work for the Wx and Qt ports.
When specifying "icons", you can use 3 different formats.
* `filename`- filename
@@ -4300,6 +4435,12 @@ When specifying "icons", you can use 3 different formats.
You will find 3 parameters used to specify these 3 options on both the initialize statement and on the Update method.
+For testing you may find using the built-in PySimpleGUI icon is a good place to start to make sure you've got everything coded correctly before bringing in outside image assets. It'll tell you quickly if you've got a problem with your icon file. To run using the default icon, use something like this to create the System Tray:
+
+```python
+tray = sg.SystemTray(menu=menu_def, data_base64=sg.DEFAULT_BASE64_ICON)
+```
+
## Menu Definition
```python
menu_def = ['BLANK', ['&Open', '&Save', ['1', '2', ['a', 'b']], '!&Properties', 'E&xit']]
@@ -4419,6 +4560,24 @@ You can update any of these items within a SystemTray object
Change them all or just 1.
+### Notify Class Method
+
+In addition to being able to show messages via the system tray, the tkinter port has the added capability of being able to display the system tray messages without having a system tray object defined. You can simply show a notification window. This perhaps removes the need for using the ptoaster package?
+
+The method is a "class method" which means you can call it directly without first creating an instanciation of the object. To show a notification window, call `SystemTray.notify`.
+
+This line of code
+
+```python
+sg.SystemTray.notify('Notification Title', 'This is the notification message')
+```
+
+Will show this window, fading it in and out:
+
+
+
+This is a blocking call so expect it to take a few seconds if you're fading the window in and out. There are options to control the fade, how long things are displayed, the alpha channel, etc. See the call signature at the end of this document.
+
# Global Settings
There are multiple ways to customize PySimpleGUI. The call with the most granularity (allows access to specific and precise settings). The `ChangeLookAndFeel` call is in reality a single call to `SetOptions` where it changes 13 different settings.
@@ -4437,16 +4596,15 @@ Each lower level overrides the settings of the higher level. Once settings have
# Persistent windows (Window stays open after button click)
-Apologies that the next few pages are perhaps confusing. There have been a number of changes recently in PySimpleGUI's Read calls that added some really cool stuff, but at the expense of being not so simple. Part of the issue is an attempt to make sure existing code doesn't break. These changes are all in the area of non-blocking reads and reads with timeouts.
+Early versions of PySimpleGUI did not have a concept of "persisent window". Once a user clicked a button, the window would close. After some time, the functionality was expanded so that windows remained open by default.
-There are 2 ways to keep a window open after the user has clicked a button. One way is to use non-blocking windows (see the next section). The other way is to use buttons that 'read' the window instead of 'close' the window when clicked. The typical buttons you find in windows, including the shortcut buttons, close the window. These include OK, Cancel, Submit, etc. The Button Element also closes the window.
-
-The `RButton` Element creates a button that when clicked will return control to the user, but will leave the window open and visible. This button is also used in Non-Blocking windows. The difference is in which call is made to read the window. The normal `Read` call with no parameters will block, a call with a `timeout` value of zero will not block.
-
-Note that `InputText` and `MultiLine` Elements will be **cleared** when performing a `Read`. If you do not want your input field to be cleared after a `Read` then you can set the `do_not_clear` parameter to True when creating those elements. The clear is turned on and off on an element by element basis.
+## Input Fields that Auto-clear
+Note that `InputText` and `MultiLine` Elements can be **cleared** when performing a `read`. If you want your input field to be cleared after a `window.read` then you can set the `do_not_clear` parameter to False when creating those elements. The clear is turned on and off on an element by element basis.
The reasoning behind this is that Persistent Windows are often "forms". When "submitting" a form you want to have all of the fields left blank so the next entry of data will start with a fresh window. Also, when implementing a "Chat Window" type of interface, after each read / send of the chat data, you want the input field cleared. Think of it as a Texting application. Would you want to have to clear your previous text if you want to send a second text?
+## Basic Persistent Window Design Pattern
+
The design pattern for Persistent Windows was already shown to you earlier in the document... here it is for your convenience.
```python
@@ -4460,16 +4618,18 @@ window = sg.Window('Window that stays open', layout)
while True:
event, values = window.read()
- if event is None or event == 'Exit':
- break
print(event, values)
+ if event in (None, 'Exit'):
+ break
-window.Close()
+window.close()
```
-## Read(timeout = t, timeout_key=TIMEOUT_KEY)
+## Read(timeout = t, timeout_key=TIMEOUT_KEY, close=False)
-Read with a timeout is a very good thing for your GUIs to use in a read non-blocking situation, you can use them. If your device can wait for a little while, then use this kind of read. The longer you're able to add to the timeout value, the less CPU time you'll be taking.
+Read with a timeout is a very good thing for your GUIs to use in a non-blocking read situation. If your device can wait for a little while, then use this kind of read. The longer you're able to add to the timeout value, the less CPU time you'll be taking.
+
+The idea to wait for some number of milliseconds before returning. It's a trivial way to make a window that runs on a periodic basis.
One way of thinking of reads with timeouts:
> During the timeout time, you are "yielding" the processor to do other tasks.
@@ -4483,47 +4643,31 @@ Let's say you had a device that you want to "poll" every 100ms. The "easy way
while True: # Event Loop
event, values = window.ReadNonBlocking() # DO NOT USE THIS CALL ANYMORE
read_my_hardware() # process my device here
- time.sleep(.1) # sleep 1/10 second
+ time.sleep(.1) # sleep 1/10 second DO NOT PUT SLEEPS IN YOUR EVENT LOOP!
```
-This program will quickly test for user input, then deal with the hardware. Then it'll sleep for 100ms, while your gui is non-responsive, then it'll check in with your GUI again. I fully realize this is a crude way of doing things. We're talking dirt simple stuff without trying to use threads, etc to 'get it right'. It's for demonstration purposes.
+This program will quickly test for user input, then deal with the hardware. Then it'll sleep for 100ms, while your gui is non-responsive, then it'll check in with your GUI again.
-The new and better way....
-using the Read Timeout mechanism, the sleep goes away.
+The better way using PySimpleGUI... using the Read Timeout mechanism, the sleep goes away.
```python
# This is the right way to poll for hardware
while True: # Event Loop
- event, values = window.Read(timeout = 100)
+ event, values = window.read(timeout = 100)
read_my_hardware() # process my device here
```
-This event loop will run every 100 ms. You're making a Read call, so anything that the use does will return back to you immediately, and you're waiting up to 100ms for the user to do something. If the user doesn't do anything, then the read will timeout and execution will return to the program.
-
-## Non-Blocking Windows (Asynchronous reads, timeouts)
-
-You can easily spot a non-blocking call in PySimpleGUI. If you see a call to `Window.Read()` with a timeout parameter set to a value other than `None`, then it is a non-blocking call.
-
-This call to read is asynchronous as it has a timeout value:
-
-```
-The new way
-```python
-event, values = sg.Read(timeout=20)
-```
-You should use the new way if you're reading this for the first time.
-
-The difference in the 2 calls is in the value of event. For ReadNonBlocking, event will be `None` if there are no other events to report. There is a "problem" with this however. With normal Read calls, an event value of None signified the window was closed. For ReadNonBlocking, the way a closed window is returned is via the values variable being set to None.
+This event loop will run every 100 ms. You're making a `read` call, so anything that the use does will return back to you immediately, and you're waiting up to 100ms for the user to do something. If the user doesn't do anything, then the read will timeout and execution will return to the program.
## sg.TIMEOUT_KEY
-If you're using the new, timeout=0 method, then an event value of None signifies that the window was closed, just like a normal Read. That leaves the question of what it is set to when not other events are happening. This value will be the value of `timeout_key`. If you did not specify a timeout_key value in your call to read, then it will be set to a default value of:
+If you're using a read with a timeout value, then an event value of None signifies that the window was closed, just like a normal `window.read`. That leaves the question of what it is set to when not other events are happening. This value will be the value of `TIMEOUT_KEY`. If you did not specify a timeout_key value in your call to read, then it will be set to a default value of:
`TIMEOUT_KEY = __timeout__`
If you wanted to test for "no event" in your loop, it would be written like this:
```python
while True:
- event, value = window.Read(timeout=0)
+ event, value = window.Read(timeout=10)
if event is None:
break # the use has closed the window
if event == sg.TIMEOUT_KEY:
@@ -4532,7 +4676,15 @@ while True:
Use async windows sparingly. It's possible to have a window that appears to be async, but it is not. **Please** try to find other methods before going to async windows. The reason for this plea is that async windows poll tkinter over and over. If you do not have a timeout in your Read and you've got nothing else your program will block on, then you will eat up 100% of the CPU time. It's important to be a good citizen. Don't chew up CPU cycles needlessly. Sometimes your mouse wants to move ya know?
-Non-blocking (timeout=0) is generally reserved as a "last resort". Too many times people use non-blocking reads when a blocking read will do just fine.
+### `read(timeout=0)`
+
+You may find some PySimpleGUI programs that set the timeout value to zero. This is a very dangerous thing to do. If you do not pend on something else in your event loop, then your program will consume 100% of your CPU. Remember that today's CPUs are multi-cored. You may see only 7% of your CPU is busy when you're running with timeout of 0. This is because task manager is reporting a system-wide CPU usage. The single core your program is running on is likely at 100%.
+
+A true non-blocking (timeout=0) read is generally reserved as a "last resort". Too many times people use non-blocking reads when a blocking read will do just fine or a read with a timeout would work.
+
+It's valid to use a timeout value of zero if you're in need of every bit of CPU horsepower in your application. Maybe your loop is doing something super-CPU intensive and you can't afford for the GUI to use any CPU time. This is the kind of situation where a timeout of zero is appropriate.
+
+Be a good computing citizen. Run with a non-zero timeout so that other programs on your CPU will have time to run.
### Small Timeout Values (under 10ms)
@@ -4558,12 +4710,37 @@ There are 2 methods of interacting with non-blocking windows.
## Exiting (Closing) a Persistent Window
-If your window has a button that closes the window, then PySimpleGUI will automatically close the window for you. If all of your buttons are ReadButtons, then it'll be up to you to close the window when done.
-To close a window, call the `Close` method.
+If your window has a special button that closes the window, then PySimpleGUI will automatically close the window for you. If all of your buttons are normal `Button` elements, then it'll be up to you to close the window when done.
+
+To close a window, call the `close` method.
```python
-window.Close()
+window.close()
```
+Beginning in version 4.16.0 you can use a `close` parameter in the `window.read` call to indicate that the window should be closed before returning from the read. This capability to an excellent way to make a single line Window to quickly get information.
+
+This single line of code will display a window, get the user's input, close the window, and return the values as an event and a values dictionary.
+
+```python
+event, values = sg.Window('Login Window',
+ [[sg.T('Enter your Login ID'), sg.In(key='-ID-')],
+ [sg.B('OK'), sg.B('Cancel') ]]).read(close=True)
+
+login_id = values['-ID-']
+```
+
+You can also make a custom popup quite easily:
+
+```python
+long_string = '123456789 '* 40
+
+event, values = sg.Window('This is my customn popup',
+ [[sg.Text(long_string, size=(40,None))],
+ [sg.B('OK'), sg.B('Cancel') ]]).read(close=True)
+```
+
+Notice the height parameter of size is `None` in this case. For the tkinter port of PySimpleGUI this will cause the number of rows to "fit" the contents of the string to be displayed.
+
## Persistent Window Example - Running timer that updates
See the sample code on the GitHub named Demo Media Player for another example of Async windows. We're going to make a window and update one of the elements of that window every .01 seconds. Here's the entire code to do that.
@@ -4593,7 +4770,7 @@ while (True):
event, values = window.Read(timeout=10)
current_time = int(round(time.time() * 100)) - start_time
# --------- Display timer in window --------
- window.FindElement('text').Update('{:02d}:{:02d}.{:02d}'.format((current_time // 100) // 60,
+ window['text'].update('{:02d}:{:02d}.{:02d}'.format((current_time // 100) // 60,
(current_time // 100) % 60,
current_time % 100))
```
@@ -4616,14 +4793,14 @@ One example is you have an input field that changes as you press buttons on an o
If you want to change an Element's settings in your window after the window has been created, then you will call the Element's Update method.
-**NOTE** a window **must be Read or Finalized** before any Update calls can be made. Also, not all settings available to you when you created the Element are available to you via its `Update` method.
+**NOTE** a window **must be Read or Finalized** before any Update calls can be made. Also, not all settings available to you when you created the Element are available to you via its `update` method.
Here is an example of updating a Text Element
```python
import PySimpleGUI as sg
-layout = [ [sg.Text('My layout', key='_TEXT_')],
+layout = [ [sg.Text('My layout', key='-TEXT-')],
[sg.Button('Read')]]
window = sg.Window('My new window', layout)
@@ -4632,7 +4809,7 @@ while True: # Event Loop
event, values = window.read()
if event is None:
break
- window.Element('_TEXT_').Update('My new text value')
+ window['-TEXT-'].update('My new text value')
```
Notice the placement of the Update call. If you wanted to Update the Text Element *prior* to the Read call, outside of the event loop, then you must call Finalize on the window first.
@@ -4641,13 +4818,12 @@ In this example, the Update is done prior the Read. Because of this, the Finali
```python
import PySimpleGUI as sg
-layout = [ [sg.Text('My layout', key='_TEXT_')],
- [sg.Button('Read')]
- ]
+layout = [ [sg.Text('My layout', key='-TEXT-')],
+ [sg.Button('Read')]]
-window = sg.Window('My new window', layout).Finalize()
+window = sg.Window('My new window', layout, finalize=True)
-window.Element('_TEXT_').Update('My new text value')
+window['-TEXT-'].update('My new text value')
while True: # Event Loop
event, values = window.read()
@@ -4696,9 +4872,9 @@ while True:
if sz != fontSize:
fontSize = sz
font = "Helvetica " + str(fontSize)
- window.FindElement('text').Update(font=font)
- window.FindElement('slider').Update(sz)
- window.FindElement('spin').Update(sz)
+ window['text'].update(font=font)
+ window['slider'].update(sz)
+ window['spin'].update(sz)
print("Done.")
```
@@ -4709,21 +4885,21 @@ For example, `values['slider']` is the value of the Slider Element.
This program changes all 3 elements if either the Slider or the Spinner changes. This is done with these statements:
```python
-window.FindElement('text').Update(font=font)
-window.FindElement('slider').Update(sz)
-window.FindElement('spin').Update(sz)
+window['text'].update(font=font)
+window['slider'].update(sz)
+window['spin'].update(sz)
```
Remember this design pattern because you will use it OFTEN if you use persistent windows.
-It works as follows. The call to `window.FindElement` returns the Element object represented by they provided `key`. This element is then updated by calling it's `Update` method. This is another example of Python's "chaining" feature. We could write this code using the long-form:
+It works as follows. The expresion `window[key]` returns the Element object represented by the provided `key`. This element is then updated by calling it's `update` method. This is another example of Python's "chaining" feature. We could write this code using the long-form:
- text_element = window.FindElement('text')
- text_element.Update(font=font)
+ text_element = window['text']
+ text_element.update(font=font)
-The takeaway from this exercise is that keys are key in PySimpleGUI's design. They are used to both read the values of the window and also to identify elements. As already mentioned, they are used as targets in Button calls.
+The takeaway from this exercise is that keys are key in PySimpleGUI's design. They are used to both read the values of the window and also to identify elements. As already mentioned, they are used in a wide variety of places.
-### Locating Elements (FindElement == Element == Elem)
+### Locating Elements (FindElement == Element == Elem == [ ])
The Window method call that's used to find an element is:
`FindElement`
@@ -4732,11 +4908,14 @@ or the shortened version
or even shorter (version 4.1+)
`Elem`
-When you see a call to window.FindElement or window.Element, then you know an element is being addressed. Normally this is done so you can call the element's Update method.
+And now it's finally shortened down to:
+window[key]
+
+You'll find the pattern - `window.Element(key)` in older code. All of code after about 4.0 uses the shortened `window[key]` notation.
### ProgressBar / Progress Meters
-Note that to change a progress meter's progress, you call `UpdateBar`, not `Update`.
+Note that to change a progress meter's progress, you call `update_bar`, not `update`. A change to this is being considered for a future release.
# Keyboard & Mouse Capture
@@ -4775,7 +4954,7 @@ while True:
if event == "OK" or event is None:
print(event, "exiting")
break
- text_elem.Update(event)
+ text_elem.update(event)
```
You want to turn off the default focus so that there no buttons that will be selected should you press the spacebar.
@@ -4919,7 +5098,7 @@ import PySimpleGUI as sg
layout = [[ sg.Text('Window 1'),],
[sg.Input(do_not_clear=True)],
- [sg.Text(size=(15,1), key='_OUTPUT_')],
+ [sg.Text(size=(15,1), key='-OUTPUT-')],
[sg.Button('Launch 2'), sg.Button('Exit')]]
win1 = sg.Window('Window 1', layout)
@@ -4927,7 +5106,7 @@ win1 = sg.Window('Window 1', layout)
win2_active = False
while True:
ev1, vals1 = win1.Read(timeout=100)
- win1.FindElement('_OUTPUT_').Update(vals1[0])
+ win1['-OUTPUT-'].update(vals1[0])
if ev1 is None or ev1 == 'Exit':
break
@@ -4954,7 +5133,7 @@ import PySimpleGUIQt as sg
layout = [[ sg.Text('Window 1'),],
[sg.Input(do_not_clear=True)],
- [sg.Text(size=(15,1), key='_OUTPUT_')],
+ [sg.Text(size=(15,1), key='-OUTPUT-')],
[sg.Button('Launch 2')]]
win1 = sg.Window('Window 1', layout)
@@ -4963,7 +5142,7 @@ while True:
ev1, vals1 = win1.Read(timeout=100)
if ev1 is None:
break
- win1.FindElement('_OUTPUT_').Update(vals1[0])
+ win1.FindElement('-OUTPUT-').update(vals1[0])
if ev1 == 'Launch 2' and not win2_active:
win2_active = True
@@ -5368,7 +5547,7 @@ Three events are being bound.
```python
import PySimpleGUI as sg
-sg.change_look_and_feel('Dark Green 2')
+sg.theme('Dark Green 2')
layout = [ [sg.Text('My Window')],
[sg.Input(key='-IN-'), sg.Text(size=(15,1), key='-OUT-')],
@@ -5446,32 +5625,32 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|button_text|(str) Text to be displayed on the button|
-|button_type|(int) You should NOT be setting this directly. ONLY the shortcut functions set this|
-|target|Union[str, Tuple[int, int]] key or (row,col) target for the button. Note that -1 for column means 1 element to the left of this one. The constant ThisRow is used to indicate the current row. The Button itself is a valid target for some types of button|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|file_types|Tuple[Tuple[str, str], ...] the filetypes that will be used to match files. To indicate all files: (("ALL Files", "*.*"),). Note - NOT SUPPORTED ON MAC|
-|initial_folder|(str) starting path for folders and files|
-|disabled|(bool) If True button will be created disabled|
-|click_submits|(bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead|
-|enable_events|(bool) Turns on the element specific events. If this button is a target, should it generate an event when filled in|
-|image_filename|(str) image filename if there is a button image. GIFs and PNGs only.|
-|image_data|Union[bytes, str] Raw or Base64 representation of the image to put on button. Choose either filename or data|
-|image_size|Tuple[int, int] Size of the image in pixels (width, height)|
-|image_subsample|(int) amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc|
-|border_width|(int) width of border around button in pixels|
-|size|Tuple[int, int] (width, height) of the button in characters wide, rows high|
-|auto_size_button|(bool) if True the button size is sized to fit the text|
-|button_color|Tuple[str, str] (text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green".|
-|disabled_button_color|Tuple[str, str] colors to use when button is disabled (text, background). Use None for a color if don't want to change. Only ttk buttons support both text and background colors. tk buttons only support changing text color|
-|use_ttk_buttons|(bool) True = use ttk buttons. False = do not use ttk buttons. None (Default) = use ttk buttons only if on a Mac and not with button images|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|bind_return_key|(bool) If True the return key will cause this button to be pressed|
-|focus|(bool) if True, initial focus will be put on this button|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
+|button_text|Text to be displayed on the button :type button_text: (str)|
+|button_type|You should NOT be setting this directly. ONLY the shortcut functions set this :type button_type: (int)|
+|target|key or (row,col) target for the button. Note that -1 for column means 1 element to the left of this one. The constant ThisRow is used to indicate the current row. The Button itself is a valid target for some types of button :type target: Union[str, Tuple[int, int]]|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|file_types|the filetypes that will be used to match files. To indicate all files: (("ALL Files", "*.*"),). Note - NOT SUPPORTED ON MAC :type file_types: Tuple[Tuple[str, str], ...]|
+|initial_folder|starting path for folders and files :type initial_folder: (str)|
+|disabled|If True button will be created disabled :type disabled: (bool)|
+|click_submits|DO NOT USE. Only listed for backwards compat - Use enable_events instead :type click_submits: (bool)|
+|enable_events|Turns on the element specific events. If this button is a target, should it generate an event when filled in :type enable_events: (bool)|
+|image_filename|image filename if there is a button image. GIFs and PNGs only. :type image_filename: (str)|
+|image_data|Raw or Base64 representation of the image to put on button. Choose either filename or data :type image_data: Union[bytes, str]|
+|image_size|Size of the image in pixels (width, height) :type image_size: Tuple[int, int]|
+|image_subsample|amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc :type image_subsample: (int)|
+|border_width|width of border around button in pixels :type border_width: (int)|
+|size|(width, height) of the button in characters wide, rows high :type size: Tuple[int, int]|
+|auto_size_button|if True the button size is sized to fit the text :type auto_size_button: (bool)|
+|button_color|(text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green". :type button_color: Tuple[str, str]|
+|disabled_button_color|colors to use when button is disabled (text, background). Use None for a color if don't want to change. Only ttk buttons support both text and background colors. tk buttons only support changing text color :type disabled_button_color: Tuple[str, str]|
+|use_ttk_buttons|True = use ttk buttons. False = do not use ttk buttons. None (Default) = use ttk buttons only if on a Mac and not with button images :type use_ttk_buttons: (bool)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|bind_return_key|If True the return key will cause this button to be pressed :type bind_return_key: (bool)|
+|focus|if True, initial focus will be put on this button :type focus: (bool)|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|key|Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element :type key: (Any)|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### Click
@@ -5490,7 +5669,7 @@ Returns the current text shown on a button
|Name|Meaning|
|---|---|
-| **return** | (str) The text currently displayed on the button |
+| **return** | The text currently displayed on the button
:rtype: (str) |
### SetFocus
@@ -5504,7 +5683,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -5518,7 +5697,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -5540,15 +5719,15 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|text|(str) sets button text|
-|button_color|Tuple[str, str] (text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green"|
-|disabled|(bool) disable or enable state of the element|
-|image_data|Union[bytes, str] Raw or Base64 representation of the image to put on button. Choose either filename or data|
-|image_filename|(str) image filename if there is a button image. GIFs and PNGs only.|
-|disabled_button_color|Tuple[str, str] colors to use when button is disabled (text, background). Use None for a color if don't want to change. Only ttk buttons support both text and background colors. tk buttons only support changing text color|
-|visible|(bool) control visibility of element|
-|image_subsample|(int) amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc|
-|image_size|Tuple[int, int] Size of the image in pixels (width, height)|
+|text|sets button text :type text: (str)|
+|button_color|(text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green" :type button_color: Tuple[str, str]|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|image_data|Raw or Base64 representation of the image to put on button. Choose either filename or data :type image_data: Union[bytes, str]|
+|image_filename|image filename if there is a button image. GIFs and PNGs only. :type image_filename: (str)|
+|disabled_button_color|colors to use when button is disabled (text, background). Use None for a color if don't want to change. Only ttk buttons support both text and background colors. tk buttons only support changing text color :type disabled_button_color: Tuple[str, str]|
+|visible|control visibility of element :type visible: (bool)|
+|image_subsample|amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc :type image_subsample: (int)|
+|image_size|Size of the image in pixels (width, height) :type image_size: Tuple[int, int]|
### bind
@@ -5566,21 +5745,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### click
Generates a click of the button as if the user clicked the button
@@ -5616,7 +5780,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### get_text
@@ -5626,7 +5790,7 @@ Returns the current text shown on a button
|Name|Meaning|
|---|---|
-| **return** | (str) The text currently displayed on the button |
+| **return** | The text currently displayed on the button
:rtype: (str) |
### hide_row
@@ -5637,6 +5801,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -5649,7 +5827,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -5664,7 +5842,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -5678,7 +5856,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -5709,15 +5901,15 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|text|(str) sets button text|
-|button_color|Tuple[str, str] (text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green"|
-|disabled|(bool) disable or enable state of the element|
-|image_data|Union[bytes, str] Raw or Base64 representation of the image to put on button. Choose either filename or data|
-|image_filename|(str) image filename if there is a button image. GIFs and PNGs only.|
-|disabled_button_color|Tuple[str, str] colors to use when button is disabled (text, background). Use None for a color if don't want to change. Only ttk buttons support both text and background colors. tk buttons only support changing text color|
-|visible|(bool) control visibility of element|
-|image_subsample|(int) amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc|
-|image_size|Tuple[int, int] Size of the image in pixels (width, height)|
+|text|sets button text :type text: (str)|
+|button_color|(text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green" :type button_color: Tuple[str, str]|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|image_data|Raw or Base64 representation of the image to put on button. Choose either filename or data :type image_data: Union[bytes, str]|
+|image_filename|image filename if there is a button image. GIFs and PNGs only. :type image_filename: (str)|
+|disabled_button_color|colors to use when button is disabled (text, background). Use None for a color if don't want to change. Only ttk buttons support both text and background colors. tk buttons only support changing text color :type disabled_button_color: Tuple[str, str]|
+|visible|control visibility of element :type visible: (bool)|
+|image_subsample|amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc :type image_subsample: (int)|
+|image_size|Size of the image in pixels (width, height) :type image_size: Tuple[int, int]|
## ButtonMenu Element
@@ -5748,39 +5940,24 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|button_text|(str) Text to be displayed on the button|
-|menu_def|List[List[str]] A list of lists of Menu items to show when this element is clicked. See docs for format as they are the same for all menu types|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|disabled|(bool) If True button will be created disabled|
-|image_filename|(str) image filename if there is a button image. GIFs and PNGs only.|
-|image_data|Union[bytes, str] Raw or Base64 representation of the image to put on button. Choose either filename or data|
-|image_size|Tuple[int, int] Size of the image in pixels (width, height)|
-|image_subsample|(int) amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc|
-|border_width|(int) width of border around button in pixels|
-|size|Tuple[int, int] (width, height) of the button in characters wide, rows high|
-|auto_size_button|(bool) if True the button size is sized to fit the text|
-|button_color|Tuple[str, str] (text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green"|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element|
-|tearoff|(bool) Determines if menus should allow them to be torn off|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|button_text|Text to be displayed on the button :type button_text: (str)|
+|menu_def|A list of lists of Menu items to show when this element is clicked. See docs for format as they are the same for all menu types :type menu_def: List[List[str]]|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|disabled|If True button will be created disabled :type disabled: (bool)|
+|image_filename|image filename if there is a button image. GIFs and PNGs only. :type image_filename: (str)|
+|image_data|Raw or Base64 representation of the image to put on button. Choose either filename or data :type image_data: Union[bytes, str]|
+|image_size|Size of the image in pixels (width, height) :type image_size: Tuple[int, int]|
+|image_subsample|amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc :type image_subsample: (int)|
+|border_width|width of border around button in pixels :type border_width: (int)|
+|size|(width, height) of the button in characters wide, rows high :type size: Tuple[int, int]|
+|auto_size_button|if True the button size is sized to fit the text :type auto_size_button: (bool)|
+|button_color|(text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green" :type button_color: Tuple[str, str]|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|key|Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element :type key: (Any)|
+|tearoff|Determines if menus should allow them to be torn off :type tearoff: (bool)|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### Click
@@ -5803,7 +5980,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -5817,7 +5994,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -5831,8 +6008,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|menu_definition|(List[List]) New menu definition (in menu definition format)|
-|visible|(bool) control visibility of element|
+|menu_definition|(New menu definition (in menu definition format) :type menu_definition: List[List]|
+|visible|control visibility of element :type visible: (bool)|
### bind
@@ -5850,21 +6027,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -5891,7 +6053,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -5902,6 +6064,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -5914,7 +6090,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -5929,7 +6105,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -5943,7 +6119,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -5966,8 +6156,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|menu_definition|(List[List]) New menu definition (in menu definition format)|
-|visible|(bool) control visibility of element|
+|menu_definition|(New menu definition (in menu definition format) :type menu_definition: List[List]|
+|visible|control visibility of element :type visible: (bool)|
## Canvas Element
@@ -5987,30 +6177,15 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|canvas|(tk.Canvas) Your own tk.Canvas if you already created it. Leave blank to create a Canvas|
-|background_color|(str) color of background|
-|size|Tuple[int,int] (width in char, height in rows) size in pixels to make canvas|
-|pad|Amount of padding to put around element|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|right_click_menu|List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|canvas|Your own tk.Canvas if you already created it. Leave blank to create a Canvas :type canvas: (tk.Canvas)|
+|background_color|color of background :type background_color: (str)|
+|size|(width in char, height in rows) size in pixels to make canvas :type size: Tuple[int,int]|
+|pad|Amount of padding to put around element :type pad: int|
+|key|Used with window.FindElement and with return values to uniquely identify this element :type key: (Any)|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|right_click_menu|A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. :type right_click_menu: List[List[Union[List[str],str]]]|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### SetFocus
@@ -6024,7 +6199,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -6038,7 +6213,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### TKCanvas
@@ -6060,21 +6235,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -6101,7 +6261,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -6112,6 +6272,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -6124,7 +6298,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -6139,7 +6313,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -6153,12 +6327,26 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### tk_canvas
#### property: tk_canvas
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
+
### unhide_row
Unhides (makes visible again) the row container that the Element is located on.
@@ -6194,36 +6382,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|text|(str) Text to display next to checkbox|
-|default|(bool). Set to True if you want this checkbox initially checked|
-|size|Tuple[int, int] (width, height) width = characters-wide, height = rows-high|
-|auto_size_text|(bool) if True will size the element to match the length of the text|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|background_color|(str) color of background|
-|text_color|(str) color of the text|
-|change_submits|(bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead|
-|enable_events|(bool) Turns on the element specific events. Checkbox events happen when an item changes|
-|disabled|(bool) set disable state|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|text|Text to display next to checkbox :type text: (str)|
+|default|Set to True if you want this checkbox initially checked :type default: (bool)|
+|size|(width, height) width = characters-wide, height = rows-high :type size: Tuple[int, int]|
+|auto_size_text|if True will size the element to match the length of the text :type auto_size_text: (bool)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|background_color|color of background :type background_color: (str)|
+|text_color|color of the text :type text_color: (str)|
+|change_submits|DO NOT USE. Only listed for backwards compat - Use enable_events instead :type change_submits: (bool)|
+|enable_events|Turns on the element specific events. Checkbox events happen when an item changes :type enable_events: (bool)|
+|disabled|set disable state :type disabled: (bool)|
+|key|Used with window.FindElement and with return values to uniquely identify this element :type key: (Any)|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### Get
@@ -6233,7 +6406,7 @@ Return the current state of this checkbox
|Name|Meaning|
|---|---|
-| **return** | (bool) Current state of checkbox |
+| **return** | Current state of checkbox
:rtype: (bool) |
### SetFocus
@@ -6247,7 +6420,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -6261,7 +6434,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -6270,6 +6443,8 @@ Note that changing visibility may cause element to change locations when made vi
```
Update(value=None,
+ background_color=None,
+ text_color=None,
disabled=None,
visible=None)
```
@@ -6278,9 +6453,11 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(bool) if True checks the checkbox, False clears it|
-|disabled|(bool) disable or enable element|
-|visible|(bool) control visibility of element|
+|value|if True checks the checkbox, False clears it :type value: (bool)|
+|background_color|color of background :type background_color: (str)|
+|text_color|color of the text. Note this also changes the color of the checkmark :type text_color: (str)|
+|disabled|disable or enable element :type disabled: (bool)|
+|visible|control visibility of element :type visible: (bool)|
### bind
@@ -6298,21 +6475,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -6339,7 +6501,7 @@ Return the current state of this checkbox
|Name|Meaning|
|---|---|
-| **return** | (bool) Current state of checkbox |
+| **return** | Current state of checkbox
:rtype: (bool) |
### get_size
@@ -6349,7 +6511,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -6360,6 +6522,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -6372,7 +6548,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -6387,7 +6563,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -6401,7 +6577,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -6419,6 +6609,8 @@ Note that changing visibility may cause element to change locations when made vi
```
update(value=None,
+ background_color=None,
+ text_color=None,
disabled=None,
visible=None)
```
@@ -6427,9 +6619,11 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(bool) if True checks the checkbox, False clears it|
-|disabled|(bool) disable or enable element|
-|visible|(bool) control visibility of element|
+|value|if True checks the checkbox, False clears it :type value: (bool)|
+|background_color|color of background :type background_color: (str)|
+|text_color|color of the text. Note this also changes the color of the checkmark :type text_color: (str)|
+|disabled|disable or enable element :type disabled: (bool)|
+|visible|control visibility of element :type visible: (bool)|
## Column Element
@@ -6454,33 +6648,48 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|layout|List[List[Element]] Layout that will be shown in the Column container|
-|background_color|(str) color of background of entire Column|
-|size|Tuple[int, int] (width, height) size in pixels (doesn't work quite right, sometimes only 1 dimension is set by tkinter|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|scrollable|(bool) if True then scrollbars will be added to the column|
-|vertical_scroll_only|(bool) if Truen then no horizontal scrollbar will be shown|
-|right_click_menu|List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.|
-|key|(any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window|
-|visible|(bool) set visibility state of the element|
-|justification|(str) set justification for the Column itself. Note entire row containing the Column will be affected|
-|element_justification|(str) All elements inside the Column will have this justification 'left', 'right', 'center' are valid values|
-|metadata|(Any) User metadata that can be set to ANYTHING|
+|layout|Layout that will be shown in the Column container :type layout: List[List[Element]]|
+|background_color|color of background of entire Column :type background_color: (str)|
+|size|(width, height) size in pixels (doesn't work quite right, sometimes only 1 dimension is set by tkinter :type size: Tuple[int, int]|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|scrollable|if True then scrollbars will be added to the column :type scrollable: (bool)|
+|vertical_scroll_only|if Truen then no horizontal scrollbar will be shown :type vertical_scroll_only: (bool)|
+|right_click_menu|A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. :type right_click_menu: List[List[Union[List[str],str]]]|
+|key|Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window :type key: (any)|
+|visible|set visibility state of the element :type visible: (bool)|
+|justification|set justification for the Column itself. Note entire row containing the Column will be affected :type justification: (str)|
+|element_justification|All elements inside the Column will have this justification 'left', 'right', 'center' are valid values :type element_justification: (str)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
-### ButtonReboundCallback
+### AddRow
-*** DEPRICATED ***
-Use Element.bind instead
+Not recommended user call. Used to add rows of Elements to the Column Element.
```
-ButtonReboundCallback(event)
+AddRow(args=*<1 or N object>)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
-|event|(unknown) Not used in this function.|
+|*args|The list of elements for this row :type *args: List[Element]|
+
+### Layout
+
+Can use like the Window.Layout method, but it's better to use the layout parameter when creating
+
+```
+Layout(rows)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|rows|The rows of Elements :type rows: List[List[Element]]|
+|||
+| **return** | Used for chaining
:rtype: (Column) |
### SetFocus
@@ -6494,7 +6703,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -6508,7 +6717,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -6522,21 +6731,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|visible|(bool) control visibility of element|
+|visible|control visibility of element :type visible: (bool)|
### add_row
Not recommended user call. Used to add rows of Elements to the Column Element.
```
-add_row(args)
+add_row(args=*<1 or N object>)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
-|*args|List[Element] The list of elements for this row|
+|*args|The list of elements for this row :type *args: List[Element]|
### bind
@@ -6554,21 +6763,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -6595,7 +6789,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -6618,9 +6812,23 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|rows|List[List[Element]] The rows of Elements|
+|rows|The rows of Elements :type rows: List[List[Element]]|
|||
-| **return** | (Column) Used for chaining |
+| **return** | Used for chaining
:rtype: (Column) |
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
### set_focus
@@ -6634,7 +6842,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -6649,7 +6857,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -6663,7 +6871,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -6686,7 +6908,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|visible|(bool) control visibility of element|
+|visible|control visibility of element :type visible: (bool)|
## Combo Element
@@ -6715,37 +6937,18 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|values|List[Any] values to choose. While displayed as text, the items returned are what the caller supplied, not text|
-|default_value|(Any) Choice to be displayed as initial value. Must match one of values variable contents|
-|size|Tuple[int, int] (width, height) width = characters-wide, height = rows-high|
-|auto_size_text|(bool) True if element should be the same size as the contents|
-|background_color|(str) color of background|
-|text_color|(str) color of the text|
-|change_submits|(bool) DEPRICATED DO NOT USE. Use `enable_events` instead|
-|enable_events|(bool) Turns on the element specific events. Combo event is when a choice is made|
-|disabled|(bool) set disable state for element|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|tooltip|(str) text that will appear when mouse hovers over this element|
-|readonly|(bool) make element readonly (user can't change). True means user cannot change|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|values|values to choose. While displayed as text, the items returned are what the caller supplied, not text :type values: List[Any]|
+|default_value|Choice to be displayed as initial value. Must match one of values variable contents :type default_value: (Any)|
+|size|width = characters-wide, height = rows-high :type size: Tuple[int, int] (width, height)|
+|auto_size_text|True if element should be the same size as the contents :type auto_size_text: (bool)|
+|background_color|color of background :type background_color: (str)|
+|text_color|color of the text :type text_color: (str)|
+|change_submits|DEPRICATED DO NOT USE. Use `enable_events` instead :type change_submits: (bool)|
+|enable_events|Turns on the element specific events. Combo event is when a choice is made :type enable_events: (bool)|
+|disabled|set disable state for element :type disabled: (bool) :para key: Used with window.FindElement and with return values to uniquely identify this element :type key: (Any) :param: Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int)) :para tooltip: text that will appear when mouse hovers over this element :type tooltip: (str) :par readonly: make element readonly (user can't change). True means user cannot change :type readonly: (bool)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### Get
@@ -6756,7 +6959,7 @@ You should be using values from your call to window.Read instead. Know what you
|Name|Meaning|
|---|---|
-| **return** | Union[Any, None] Returns the value of what is currently chosen |
+| **return** | Returns the value of what is currently chosen
:rtype: Union[Any, None] |
### SetFocus
@@ -6770,7 +6973,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -6784,7 +6987,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -6804,13 +7007,13 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(Any) change which value is current selected hased on new list of previous list of choices|
-|values|List[Any] change list of choices|
-|set_to_index|(int) change selection to a particular choice starting with index = 0|
-|disabled|(bool) disable or enable state of the element|
-|readonly|(bool) if True make element readonly (user cannot change any choices)|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|visible|(bool) control visibility of element|
+|value|change which value is current selected hased on new list of previous list of choices :type value: (Any)|
+|values|change list of choices :type values: List[Any]|
+|set_to_index|change selection to a particular choice starting with index = 0 :type set_to_index: (int)|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|readonly|if True make element readonly (user cannot change any choices) :type readonly: (bool)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|visible|control visibility of element :type visible: (bool)|
### bind
@@ -6828,21 +7031,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -6870,7 +7058,7 @@ You should be using values from your call to window.Read instead. Know what you
|Name|Meaning|
|---|---|
-| **return** | Union[Any, None] Returns the value of what is currently chosen |
+| **return** | Returns the value of what is currently chosen
:rtype: Union[Any, None] |
### get_size
@@ -6880,7 +7068,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -6891,6 +7079,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -6903,7 +7105,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -6918,7 +7120,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -6932,7 +7134,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -6961,13 +7177,13 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(Any) change which value is current selected hased on new list of previous list of choices|
-|values|List[Any] change list of choices|
-|set_to_index|(int) change selection to a particular choice starting with index = 0|
-|disabled|(bool) disable or enable state of the element|
-|readonly|(bool) if True make element readonly (user cannot change any choices)|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|visible|(bool) control visibility of element|
+|value|change which value is current selected hased on new list of previous list of choices :type value: (Any)|
+|values|change list of choices :type values: List[Any]|
+|set_to_index|change selection to a particular choice starting with index = 0 :type set_to_index: (int)|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|readonly|if True make element readonly (user cannot change any choices) :type readonly: (bool)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|visible|control visibility of element :type visible: (bool)|
## Frame Element
@@ -6996,37 +7212,52 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|title|(str) text that is displayed as the Frame's "label" or title|
-|layout|List[List[Elements]] The layout to put inside the Frame|
-|title_color|(str) color of the title text|
-|background_color|(str) background color of the Frame|
-|title_location|(enum) location to place the text title. Choices include: TITLE_LOCATION_TOP TITLE_LOCATION_BOTTOM TITLE_LOCATION_LEFT TITLE_LOCATION_RIGHT TITLE_LOCATION_TOP_LEFT TITLE_LOCATION_TOP_RIGHT TITLE_LOCATION_BOTTOM_LEFT TITLE_LOCATION_BOTTOM_RIGHT|
-|relief|(enum) relief style. Values are same as other elements with reliefs. Choices include RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID|
-|size|Tuple[int, int] (width in characters, height in rows) (note this parameter may not always work)|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|border_width|(int) width of border around element in pixels|
-|key|(any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|right_click_menu|List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.|
-|visible|(bool) set visibility state of the element|
-|element_justification|(str) All elements inside the Frame will have this justification 'left', 'right', 'center' are valid values|
-|metadata|(Any) User metadata that can be set to ANYTHING|
+|title|text that is displayed as the Frame's "label" or title :type title: (str)|
+|layout|The layout to put inside the Frame :type layout: List[List[Elements]]|
+|title_color|color of the title text :type title_color: (str)|
+|background_color|background color of the Frame :type background_color: (str)|
+|title_location|location to place the text title. Choices include: TITLE_LOCATION_TOP TITLE_LOCATION_BOTTOM TITLE_LOCATION_LEFT TITLE_LOCATION_RIGHT TITLE_LOCATION_TOP_LEFT TITLE_LOCATION_TOP_RIGHT TITLE_LOCATION_BOTTOM_LEFT TITLE_LOCATION_BOTTOM_RIGHT :type title_location: (enum)|
+|relief|relief style. Values are same as other elements with reliefs. Choices include RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID :type relief: (enum)|
+|size|(width, height) (note this parameter may not always work) :type size: Tuple[int, int]|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|border_width|width of border around element in pixels :type border_width: (int)|
+|key|Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window :type key: (any)|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|right_click_menu|A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. :type right_click_menu: List[List[Union[List[str],str]]]|
+|visible|set visibility state of the element :type visible: (bool)|
+|element_justification|All elements inside the Frame will have this justification 'left', 'right', 'center' are valid values :type element_justification: (str)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
-### ButtonReboundCallback
+### AddRow
-*** DEPRICATED ***
-Use Element.bind instead
+Not recommended user call. Used to add rows of Elements to the Frame Element.
```
-ButtonReboundCallback(event)
+AddRow(args=*<1 or N object>)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
-|event|(unknown) Not used in this function.|
+|*args|The list of elements for this row :type *args: List[Element]|
+
+### Layout
+
+Can use like the Window.Layout method, but it's better to use the layout parameter when creating
+
+```
+Layout(rows)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|rows|The rows of Elements :type rows: List[List[Element]]|
+|||
+| **return** | Used for chaining
:rtype: (Frame) |
### SetFocus
@@ -7040,7 +7271,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -7054,7 +7285,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -7068,8 +7299,22 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(Any) New text value to show on frame|
-|visible|(bool) control visibility of element|
+|value|New text value to show on frame :type value: (Any)|
+|visible|control visibility of element :type visible: (bool)|
+
+### add_row
+
+Not recommended user call. Used to add rows of Elements to the Frame Element.
+
+```
+add_row(args=*<1 or N object>)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|*args|The list of elements for this row :type *args: List[Element]|
### bind
@@ -7087,21 +7332,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -7128,7 +7358,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -7139,6 +7369,36 @@ Hide the entire row an Element is located on.
hide_row()
```
+### layout
+
+Can use like the Window.Layout method, but it's better to use the layout parameter when creating
+
+```
+layout(rows)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|rows|The rows of Elements :type rows: List[List[Element]]|
+|||
+| **return** | Used for chaining
:rtype: (Frame) |
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -7151,7 +7411,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -7166,7 +7426,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -7180,7 +7440,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -7203,8 +7477,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(Any) New text value to show on frame|
-|visible|(bool) control visibility of element|
+|value|New text value to show on frame :type value: (Any)|
+|visible|control visibility of element :type visible: (bool)|
## Graph Element
@@ -7239,20 +7513,20 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|canvas_size|Tuple[int, int] (width, height) size of the canvas area in pixels|
-|graph_bottom_left|Tuple[int, int] (x,y) The bottoms left corner of your coordinate system|
-|graph_top_right|Tuple[int, int] (x,y) The top right corner of your coordinate system|
-|background_color|(str) background color of the drawing area|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|change_submits|(bool) * DEPRICATED DO NOT USE! Same as enable_events|
-|drag_submits|(bool) if True and Events are enabled for the Graph, will report Events any time the mouse moves while button down|
-|enable_events|(bool) If True then clicks on the Graph are immediately reported as an event. Use this instead of change_submits|
-|key|(any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|right_click_menu|List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.|
-|visible|(bool) set visibility state of the element (Default = True)|
-|float_values|(bool) If True x,y coordinates are returned as floats, not ints|
-|metadata|(Any) User metadata that can be set to ANYTHING|
+|canvas_size|(width, height) size of the canvas area in pixels :type canvas_size: Tuple[int, int]|
+|graph_bottom_left|(x,y) The bottoms left corner of your coordinate system :type graph_bottom_left: Tuple[int, int]|
+|graph_top_right|(x,y) The top right corner of your coordinate system :type graph_top_right: Tuple[int, int]|
+|background_color|background color of the drawing area :type background_color: (str)|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|change_submits|* DEPRICATED DO NOT USE! Same as enable_events :type change_submits: (bool)|
+|drag_submits|if True and Events are enabled for the Graph, will report Events any time the mouse moves while button down :type drag_submits: (bool)|
+|enable_events|If True then clicks on the Graph are immediately reported as an event. Use this instead of change_submits :type enable_events: (bool)|
+|key|Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window :type key: (any)|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|right_click_menu|A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. :type right_click_menu: List[List[Union[List[str],str]]]|
+|visible|set visibility state of the element (Default = True) :type visible: (bool)|
+|float_values|If True x,y coordinates are returned as floats, not ints :type float_values: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### BringFigureToFront
@@ -7266,7 +7540,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|figure|(int) value returned by tkinter when creating the figure / drawing|
+|figure|value returned by tkinter when creating the figure / drawing :type figure: (int)|
### ButtonPressCallBack
@@ -7282,21 +7556,6 @@ Parameter Descriptions:
|---|---|
|event|(event) event info from tkinter. Contains the x and y coordinates of a click|
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### DeleteFigure
Remove from the Graph the figure represented by id. The id is given to you anytime you call a drawing primitive
@@ -7309,7 +7568,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|id|(int) the id returned to you when calling one of the drawing methods|
+|id|the id returned to you when calling one of the drawing methods :type id: (int)|
### DrawArc
@@ -7321,21 +7580,22 @@ DrawArc(top_left,
extent,
start_angle,
style=None,
- arc_color="black")
+ arc_color="black",
+ line_width=1)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
-|top_left|Union[Tuple[int, int], Tuple[float, float]] the top left point of bounding rectangle|
-|bottom_right|Union[Tuple[int, int], Tuple[float, float]] the bottom right point of bounding rectangle|
-|extent|(float) Andle to end drawing. Used in conjunction with start_angle|
-|start_angle|(float) Angle to begin drawing. Used in conjunction with extent|
-|style|(str) Valid choices are One of these Style strings- 'pieslice', 'chord', 'arc', 'first', 'last', 'butt', 'projecting', 'round', 'bevel', 'miter'|
-|arc_color|(str) color to draw arc with|
+|top_left|the top left point of bounding rectangle :type top_left: Union[Tuple[int, int], Tuple[float, float]]|
+|bottom_right|the bottom right point of bounding rectangle :type bottom_right: Union[Tuple[int, int], Tuple[float, float]]|
+|extent|Andle to end drawing. Used in conjunction with start_angle :type extent: (float)|
+|start_angle|Angle to begin drawing. Used in conjunction with extent :type start_angle: (float)|
+|style|Valid choices are One of these Style strings- 'pieslice', 'chord', 'arc', 'first', 'last', 'butt', 'projecting', 'round', 'bevel', 'miter' :type style: (str)|
+|arc_color|color to draw arc with :type arc_color: (str)|
|||
-| **return** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the arc |
+| **return** | id returned from tkinter that you'll need if you want to manipulate the arc
:rtype: Union[int, None] |
### DrawCircle
@@ -7353,13 +7613,13 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|center_location|Union [Tuple[int, int], Tuple[float, float]] Center location using USER'S coordinate system|
-|radius|Union[int, float] Radius in user's coordinate values.|
-|fill_color|(str) color of the point to draw|
-|line_color|(str) color of the outer line that goes around the circle (sorry, can't set thickness)|
-|line_width|(int) width of the line around the circle, the outline, in pixels|
+|center_location|Center location using USER'S coordinate system :type center_location: Union [Tuple[int, int], Tuple[float, float]]|
+|radius|Radius in user's coordinate values. :type radius: Union[int, float]|
+|fill_color|color of the point to draw :type fill_color: (str)|
+|line_color|color of the outer line that goes around the circle (sorry, can't set thickness) :type line_color: (str)|
+|line_width|width of the line around the circle, the outline, in pixels :type line_width: (int)|
|||
-| **return** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the circle |
+| **return** | id returned from tkinter that you'll need if you want to manipulate the circle
:rtype: Union[int, None] |
### DrawImage
@@ -7378,14 +7638,14 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|filename|(str) if image is in a file, path and filename for the image. (GIF and PNG only!)|
-|data|Union[str, bytes] if image is in Base64 format or raw? format then use instead of filename|
-|location|Union[Tuple[int, int], Tuple[float, float]] the (x,y) location to place image's top left corner|
-|color|(str) text color|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|angle|(float) Angle 0 to 360 to draw the text. Zero represents horizontal text|
+|filename|if image is in a file, path and filename for the image. (GIF and PNG only!) :type filename: (str)|
+|data|if image is in Base64 format or raw? format then use instead of filename :type data: Union[str, bytes]|
+|location|the (x,y) location to place image's top left corner :type location: Union[Tuple[int, int], Tuple[float, float]]|
+|color|text color :type color: (str)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|angle|Angle 0 to 360 to draw the text. Zero represents horizontal text :type angle: (float)|
|||
-| **return** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the image |
+| **return** | id returned from tkinter that you'll need if you want to manipulate the image
:rtype: Union[int, None] |
### DrawLine
@@ -7402,12 +7662,12 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|point_from|Union[Tuple[int, int], Tuple[float, float]] Starting point for line|
-|point_to|Union[Tuple[int, int], Tuple[float, float]] Ending point for line|
-|color|(str) Color of the line|
-|width|(int) width of line in pixels|
+|point_from|Starting point for line :type point_from: Union[Tuple[int, int], Tuple[float, float]]|
+|point_to|Ending point for line :type point_to: Union[Tuple[int, int], Tuple[float, float]]|
+|color|Color of the line :type color: (str)|
+|width|width of line in pixels :type width: (int)|
|||
-| **return** | Union[int, None] id returned from tktiner or None if user closed the window. id is used when you
want to manipulate the line |
+| **return** | id returned from tktiner or None if user closed the window. id is used when you
:rtype: Union[int, None] |
### DrawOval
@@ -7425,13 +7685,13 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|top_left|Union[Tuple[int, int], Tuple[float, float]] the top left point of bounding rectangle|
-|bottom_right|Union[Tuple[int, int], Tuple[float, float]] the bottom right point of bounding rectangle|
-|fill_color|(str) color of the interrior|
-|line_color|(str) color of outline of oval|
-|line_width|(int) width of the line around the oval, the outline, in pixels|
+|top_left|the top left point of bounding rectangle :type top_left: Union[Tuple[int, int], Tuple[float, float]]|
+|bottom_right|the bottom right point of bounding rectangle :type bottom_right: Union[Tuple[int, int], Tuple[float, float]]|
+|fill_color|color of the interrior :type fill_color: (str)|
+|line_color|color of outline of oval :type line_color: (str)|
+|line_width|width of the line around the oval, the outline, in pixels :type line_width: (int)|
|||
-| **return** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the oval |
+| **return** | id returned from tkinter that you'll need if you want to manipulate the oval
:rtype: Union[int, None] |
### DrawPoint
@@ -7447,11 +7707,33 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|point|Union [Tuple[int, int], Tuple[float, float]] Center location using USER'S coordinate system|
-|size|Union[int, float] Radius? (Or is it the diameter?) in user's coordinate values.|
-|color|(str) color of the point to draw|
+|point|Center location using USER'S coordinate system :type point: Union [Tuple[int, int], Tuple[float, float]]|
+|size|Radius? (Or is it the diameter?) in user's coordinate values. :type size: Union[int, float]|
+|color|color of the point to draw :type color: (str)|
|||
-| **return** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the point |
+| **return** | id returned from tkinter that you'll need if you want to manipulate the point
:rtype: Union[int, None] |
+
+### DrawPolygon
+
+Draw a rectangle given 2 points. Can control the line and fill colors
+
+```
+DrawPolygon(points,
+ fill_color=None,
+ line_color=None,
+ line_width=None)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|points|list of points that define the polygon :type points: List[Union[Tuple[int, int], Tuple[float, float]]]|
+|fill_color|color of the interior :type fill_color: (str)|
+|line_color|color of outline :type line_color: (str)|
+|line_width|width of the line in pixels :type line_width: (int)|
+|||
+| **return** | id returned from tkinter that you'll need if you want to manipulate the rectangle
:rtype: Union[int, None] |
### DrawRectangle
@@ -7469,12 +7751,13 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|top_left|Union[Tuple[int, int], Tuple[float, float]] the top left point of rectangle|
-|bottom_right|Union[Tuple[int, int], Tuple[float, float]] the bottom right point of rectangle|
-|fill_color|(str) color of the interior|
-|line_color|(str) color of outline|
+|top_left|the top left point of rectangle :type top_left: Union[Tuple[int, int], Tuple[float, float]]|
+|bottom_right|the bottom right point of rectangle :type bottom_right: Union[Tuple[int, int], Tuple[float, float]]|
+|fill_color|color of the interior :type fill_color: (str)|
+|line_color|color of outline :type line_color: (str)|
+|line_width|width of the line in pixels :type line_width: (int)|
|||
-| **return** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the rectangle |
+| **return** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the rectangle
:rtype: Union[int, None] |
### DrawText
@@ -7493,14 +7776,14 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|text|(str) text to display|
-|location|Union[Tuple[int, int], Tuple[float, float]] location to place first letter|
-|color|(str) text color|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|angle|(float) Angle 0 to 360 to draw the text. Zero represents horizontal text|
-|text_location|(enum) "anchor" location for the text. Values start with TEXT_LOCATION_|
+|text|text to display :type text: (str)|
+|location|location to place first letter :type location: Union[Tuple[int, int], Tuple[float, float]]|
+|color|text color :type color: (str)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|angle|Angle 0 to 360 to draw the text. Zero represents horizontal text :type angle: (float)|
+|text_location|"anchor" location for the text. Values start with TEXT_LOCATION_ :type text_location: (enum)|
|||
-| **return** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the text |
+| **return** | id returned from tkinter that you'll need if you want to manipulate the text
:rtype: Union[int, None] |
### Erase
@@ -7522,9 +7805,9 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|figure|a previously drawing figure|
+|figure|a previously drawing figure :type figure: object|
|||
-| **return** | Union[Tuple[int, int, int, int], Tuple[float, float, float, float]] (upper left x, upper left y, lower right x, lower right y |
+| **return** | upper left x, upper left y, lower right x, lower right y
:rtype: Union[Tuple[int, int, int, int], Tuple[float, float, float, float]] |
### GetFiguresAtLocation
@@ -7538,9 +7821,23 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|location|Union[Tuple[int, int], Tuple[float, float]] point to check|
+|location|point to check :type location: Union[Tuple[int, int], Tuple[float, float]]|
|||
-| **return** | List[int] a list of previously drawn "Figures" (returned from the drawing primitives) |
+| **return** | a list of previously drawn "Figures" (returned from the drawing primitives)
:rtype: List[int] |
+
+### MotionCallBack
+
+Not a user callable method. Used to get Graph mouse motion events. Called by tkinter when mouse moved
+
+```
+MotionCallBack(event)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|event|(event) event info from tkinter. Contains the x and y coordinates of a mouse|
### Move
@@ -7554,8 +7851,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|x_direction|Union[int, float] how far to move in the "X" direction in your coordinates|
-|y_direction|Union[int, float] how far to move in the "Y" direction in your coordinates|
+|x_direction|how far to move in the "X" direction in your coordinates :type x_direction: Union[int, float]|
+|y_direction|how far to move in the "Y" direction in your coordinates :type y_direction: Union[int, float]|
### MoveFigure
@@ -7571,9 +7868,9 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|figure|(id) Previously obtained figure-id. These are returned from all Draw methods|
-|x_direction|Union[int, float] delta to apply to position in the X direction|
-|y_direction|Union[int, float] delta to apply to position in the Y direction|
+|figure|Previously obtained figure-id. These are returned from all Draw methods :type figure: (id)|
+|x_direction|delta to apply to position in the X direction :type x_direction: Union[int, float]|
+|y_direction|delta to apply to position in the Y direction :type y_direction: Union[int, float]|
### RelocateFigure
@@ -7590,9 +7887,9 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|figure|(id) Previously obtained figure-id. These are returned from all Draw methods|
-|x|Union[int, float] location on X axis (in user coords) to move the upper left corner of the figure|
-|y|Union[int, float] location on Y axis (in user coords) to move the upper left corner of the figure|
+|figure|Previously obtained figure-id. These are returned from all Draw methods :type figure: (id)|
+|x|location on X axis (in user coords) to move the upper left corner of the figure :type x: Union[int, float]|
+|y|location on Y axis (in user coords) to move the upper left corner of the figure :type y: Union[int, float]|
### SendFigureToBack
@@ -7606,7 +7903,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|figure|(int) value returned by tkinter when creating the figure / drawing|
+|figure|value returned by tkinter when creating the figure / drawing :type figure: (int)|
### SetFocus
@@ -7620,7 +7917,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -7634,7 +7931,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### TKCanvas
@@ -7652,8 +7949,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|background_color|color of background|
-|visible|(bool) control visibility of element|
+|background_color|color of background :type background_color: ???|
+|visible|control visibility of element :type visible: (bool)|
### bind
@@ -7683,7 +7980,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|figure|(int) value returned by tkinter when creating the figure / drawing|
+|figure|value returned by tkinter when creating the figure / drawing :type figure: (int)|
### button_press_call_back
@@ -7699,20 +7996,21 @@ Parameter Descriptions:
|---|---|
|event|(event) event info from tkinter. Contains the x and y coordinates of a click|
-### button_rebound_callback
+### change_coordinates
-*** DEPRICATED ***
-Use Element.bind instead
+Changes the corrdinate system to a new one. The same 2 points in space are used to define the coorinate
+system - the bottom left and the top right values of your graph.
```
-button_rebound_callback(event)
+change_coordinates(graph_bottom_left, graph_top_right)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
-|event|(unknown) Not used in this function.|
+|graph_bottom_left|The bottoms left corner of your coordinate system :type graph_bottom_left: Tuple[int, int] (x,y)|
+|graph_top_right|The top right corner of your coordinate system :type graph_top_right: Tuple[int, int] (x,y)|
### delete_figure
@@ -7726,7 +8024,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|id|(int) the id returned to you when calling one of the drawing methods|
+|id|the id returned to you when calling one of the drawing methods :type id: (int)|
### draw_arc
@@ -7738,21 +8036,22 @@ draw_arc(top_left,
extent,
start_angle,
style=None,
- arc_color="black")
+ arc_color="black",
+ line_width=1)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
-|top_left|Union[Tuple[int, int], Tuple[float, float]] the top left point of bounding rectangle|
-|bottom_right|Union[Tuple[int, int], Tuple[float, float]] the bottom right point of bounding rectangle|
-|extent|(float) Andle to end drawing. Used in conjunction with start_angle|
-|start_angle|(float) Angle to begin drawing. Used in conjunction with extent|
-|style|(str) Valid choices are One of these Style strings- 'pieslice', 'chord', 'arc', 'first', 'last', 'butt', 'projecting', 'round', 'bevel', 'miter'|
-|arc_color|(str) color to draw arc with|
+|top_left|the top left point of bounding rectangle :type top_left: Union[Tuple[int, int], Tuple[float, float]]|
+|bottom_right|the bottom right point of bounding rectangle :type bottom_right: Union[Tuple[int, int], Tuple[float, float]]|
+|extent|Andle to end drawing. Used in conjunction with start_angle :type extent: (float)|
+|start_angle|Angle to begin drawing. Used in conjunction with extent :type start_angle: (float)|
+|style|Valid choices are One of these Style strings- 'pieslice', 'chord', 'arc', 'first', 'last', 'butt', 'projecting', 'round', 'bevel', 'miter' :type style: (str)|
+|arc_color|color to draw arc with :type arc_color: (str)|
|||
-| **return** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the arc |
+| **return** | id returned from tkinter that you'll need if you want to manipulate the arc
:rtype: Union[int, None] |
### draw_circle
@@ -7770,13 +8069,13 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|center_location|Union [Tuple[int, int], Tuple[float, float]] Center location using USER'S coordinate system|
-|radius|Union[int, float] Radius in user's coordinate values.|
-|fill_color|(str) color of the point to draw|
-|line_color|(str) color of the outer line that goes around the circle (sorry, can't set thickness)|
-|line_width|(int) width of the line around the circle, the outline, in pixels|
+|center_location|Center location using USER'S coordinate system :type center_location: Union [Tuple[int, int], Tuple[float, float]]|
+|radius|Radius in user's coordinate values. :type radius: Union[int, float]|
+|fill_color|color of the point to draw :type fill_color: (str)|
+|line_color|color of the outer line that goes around the circle (sorry, can't set thickness) :type line_color: (str)|
+|line_width|width of the line around the circle, the outline, in pixels :type line_width: (int)|
|||
-| **return** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the circle |
+| **return** | id returned from tkinter that you'll need if you want to manipulate the circle
:rtype: Union[int, None] |
### draw_image
@@ -7795,14 +8094,14 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|filename|(str) if image is in a file, path and filename for the image. (GIF and PNG only!)|
-|data|Union[str, bytes] if image is in Base64 format or raw? format then use instead of filename|
-|location|Union[Tuple[int, int], Tuple[float, float]] the (x,y) location to place image's top left corner|
-|color|(str) text color|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|angle|(float) Angle 0 to 360 to draw the text. Zero represents horizontal text|
+|filename|if image is in a file, path and filename for the image. (GIF and PNG only!) :type filename: (str)|
+|data|if image is in Base64 format or raw? format then use instead of filename :type data: Union[str, bytes]|
+|location|the (x,y) location to place image's top left corner :type location: Union[Tuple[int, int], Tuple[float, float]]|
+|color|text color :type color: (str)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|angle|Angle 0 to 360 to draw the text. Zero represents horizontal text :type angle: (float)|
|||
-| **return** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the image |
+| **return** | id returned from tkinter that you'll need if you want to manipulate the image
:rtype: Union[int, None] |
### draw_line
@@ -7819,12 +8118,12 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|point_from|Union[Tuple[int, int], Tuple[float, float]] Starting point for line|
-|point_to|Union[Tuple[int, int], Tuple[float, float]] Ending point for line|
-|color|(str) Color of the line|
-|width|(int) width of line in pixels|
+|point_from|Starting point for line :type point_from: Union[Tuple[int, int], Tuple[float, float]]|
+|point_to|Ending point for line :type point_to: Union[Tuple[int, int], Tuple[float, float]]|
+|color|Color of the line :type color: (str)|
+|width|width of line in pixels :type width: (int)|
|||
-| **return** | Union[int, None] id returned from tktiner or None if user closed the window. id is used when you
want to manipulate the line |
+| **return** | id returned from tktiner or None if user closed the window. id is used when you
:rtype: Union[int, None] |
### draw_oval
@@ -7842,13 +8141,13 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|top_left|Union[Tuple[int, int], Tuple[float, float]] the top left point of bounding rectangle|
-|bottom_right|Union[Tuple[int, int], Tuple[float, float]] the bottom right point of bounding rectangle|
-|fill_color|(str) color of the interrior|
-|line_color|(str) color of outline of oval|
-|line_width|(int) width of the line around the oval, the outline, in pixels|
+|top_left|the top left point of bounding rectangle :type top_left: Union[Tuple[int, int], Tuple[float, float]]|
+|bottom_right|the bottom right point of bounding rectangle :type bottom_right: Union[Tuple[int, int], Tuple[float, float]]|
+|fill_color|color of the interrior :type fill_color: (str)|
+|line_color|color of outline of oval :type line_color: (str)|
+|line_width|width of the line around the oval, the outline, in pixels :type line_width: (int)|
|||
-| **return** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the oval |
+| **return** | id returned from tkinter that you'll need if you want to manipulate the oval
:rtype: Union[int, None] |
### draw_point
@@ -7864,11 +8163,33 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|point|Union [Tuple[int, int], Tuple[float, float]] Center location using USER'S coordinate system|
-|size|Union[int, float] Radius? (Or is it the diameter?) in user's coordinate values.|
-|color|(str) color of the point to draw|
+|point|Center location using USER'S coordinate system :type point: Union [Tuple[int, int], Tuple[float, float]]|
+|size|Radius? (Or is it the diameter?) in user's coordinate values. :type size: Union[int, float]|
+|color|color of the point to draw :type color: (str)|
|||
-| **return** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the point |
+| **return** | id returned from tkinter that you'll need if you want to manipulate the point
:rtype: Union[int, None] |
+
+### draw_polygon
+
+Draw a rectangle given 2 points. Can control the line and fill colors
+
+```
+draw_polygon(points,
+ fill_color=None,
+ line_color=None,
+ line_width=None)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|points|list of points that define the polygon :type points: List[Union[Tuple[int, int], Tuple[float, float]]]|
+|fill_color|color of the interior :type fill_color: (str)|
+|line_color|color of outline :type line_color: (str)|
+|line_width|width of the line in pixels :type line_width: (int)|
+|||
+| **return** | id returned from tkinter that you'll need if you want to manipulate the rectangle
:rtype: Union[int, None] |
### draw_rectangle
@@ -7886,12 +8207,13 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|top_left|Union[Tuple[int, int], Tuple[float, float]] the top left point of rectangle|
-|bottom_right|Union[Tuple[int, int], Tuple[float, float]] the bottom right point of rectangle|
-|fill_color|(str) color of the interior|
-|line_color|(str) color of outline|
+|top_left|the top left point of rectangle :type top_left: Union[Tuple[int, int], Tuple[float, float]]|
+|bottom_right|the bottom right point of rectangle :type bottom_right: Union[Tuple[int, int], Tuple[float, float]]|
+|fill_color|color of the interior :type fill_color: (str)|
+|line_color|color of outline :type line_color: (str)|
+|line_width|width of the line in pixels :type line_width: (int)|
|||
-| **return** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the rectangle |
+| **return** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the rectangle
:rtype: Union[int, None] |
### draw_text
@@ -7910,14 +8232,14 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|text|(str) text to display|
-|location|Union[Tuple[int, int], Tuple[float, float]] location to place first letter|
-|color|(str) text color|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|angle|(float) Angle 0 to 360 to draw the text. Zero represents horizontal text|
-|text_location|(enum) "anchor" location for the text. Values start with TEXT_LOCATION_|
+|text|text to display :type text: (str)|
+|location|location to place first letter :type location: Union[Tuple[int, int], Tuple[float, float]]|
+|color|text color :type color: (str)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|angle|Angle 0 to 360 to draw the text. Zero represents horizontal text :type angle: (float)|
+|text_location|"anchor" location for the text. Values start with TEXT_LOCATION_ :type text_location: (enum)|
|||
-| **return** | Union[int, None] id returned from tkinter that you'll need if you want to manipulate the text |
+| **return** | id returned from tkinter that you'll need if you want to manipulate the text
:rtype: Union[int, None] |
### erase
@@ -7957,9 +8279,9 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|figure|a previously drawing figure|
+|figure|a previously drawing figure :type figure: object|
|||
-| **return** | Union[Tuple[int, int, int, int], Tuple[float, float, float, float]] (upper left x, upper left y, lower right x, lower right y |
+| **return** | upper left x, upper left y, lower right x, lower right y
:rtype: Union[Tuple[int, int, int, int], Tuple[float, float, float, float]] |
### get_figures_at_location
@@ -7973,9 +8295,9 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|location|Union[Tuple[int, int], Tuple[float, float]] point to check|
+|location|point to check :type location: Union[Tuple[int, int], Tuple[float, float]]|
|||
-| **return** | List[int] a list of previously drawn "Figures" (returned from the drawing primitives) |
+| **return** | a list of previously drawn "Figures" (returned from the drawing primitives)
:rtype: List[int] |
### get_size
@@ -7985,7 +8307,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -8008,8 +8330,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|x_direction|Union[int, float] how far to move in the "X" direction in your coordinates|
-|y_direction|Union[int, float] how far to move in the "Y" direction in your coordinates|
+|x_direction|how far to move in the "X" direction in your coordinates :type x_direction: Union[int, float]|
+|y_direction|how far to move in the "Y" direction in your coordinates :type y_direction: Union[int, float]|
### move_figure
@@ -8025,9 +8347,9 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|figure|(id) Previously obtained figure-id. These are returned from all Draw methods|
-|x_direction|Union[int, float] delta to apply to position in the X direction|
-|y_direction|Union[int, float] delta to apply to position in the Y direction|
+|figure|Previously obtained figure-id. These are returned from all Draw methods :type figure: (id)|
+|x_direction|delta to apply to position in the X direction :type x_direction: Union[int, float]|
+|y_direction|delta to apply to position in the Y direction :type y_direction: Union[int, float]|
### relocate_figure
@@ -8044,9 +8366,9 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|figure|(id) Previously obtained figure-id. These are returned from all Draw methods|
-|x|Union[int, float] location on X axis (in user coords) to move the upper left corner of the figure|
-|y|Union[int, float] location on Y axis (in user coords) to move the upper left corner of the figure|
+|figure|Previously obtained figure-id. These are returned from all Draw methods :type figure: (id)|
+|x|location on X axis (in user coords) to move the upper left corner of the figure :type x: Union[int, float]|
+|y|location on Y axis (in user coords) to move the upper left corner of the figure :type y: Union[int, float]|
### send_figure_to_back
@@ -8060,7 +8382,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|figure|(int) value returned by tkinter when creating the figure / drawing|
+|figure|value returned by tkinter when creating the figure / drawing :type figure: (int)|
+
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
### set_focus
@@ -8074,7 +8410,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -8089,7 +8425,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -8103,12 +8439,26 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### tk_canvas
#### property: tk_canvas
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
+
### unhide_row
Unhides (makes visible again) the row container that the Element is located on.
@@ -8130,8 +8480,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|background_color|color of background|
-|visible|(bool) control visibility of element|
+|background_color|color of background :type background_color: ???|
+|visible|control visibility of element :type visible: (bool)|
## Image Element
@@ -8155,32 +8505,17 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|filename|(str) image filename if there is a button image. GIFs and PNGs only.|
-|data|Union[bytes, str] Raw or Base64 representation of the image to put on button. Choose either filename or data|
-|background_color|color of background|
-|size|Tuple[int, int] (width, height) size of image in pixels|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|right_click_menu|List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.|
-|visible|(bool) set visibility state of the element|
-|enable_events|(bool) Turns on the element specific events. For an Image element, the event is "image clicked"|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|filename|image filename if there is a button image. GIFs and PNGs only. :type filename: (str)|
+|data|Raw or Base64 representation of the image to put on button. Choose either filename or data :type data: Union[bytes, str]|
+|background_color|color of background :type background_color:|
+|size|(width, height) size of image in pixels :type size: Tuple[int, int]|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|key|Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element :type key: (Any)|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|right_click_menu|A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. :type right_click_menu: List[List[Union[List[str],str]]]|
+|visible|set visibility state of the element :type visible: (bool)|
+|enable_events|Turns on the element specific events. For an Image element, the event is "image clicked" :type enable_events: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### SetFocus
@@ -8194,7 +8529,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -8208,7 +8543,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -8225,10 +8560,10 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|filename|(str) filename to the new image to display.|
-|data|Union[str, tkPhotoImage] Base64 encoded string OR a tk.PhotoImage object|
-|size|Tuple[int,int] size of a image (w,h) w=characters-wide, h=rows-high|
-|visible|(bool) control visibility of element|
+|filename|filename to the new image to display. :type filename: (str)|
+|data|Base64 encoded string OR a tk.PhotoImage object :type data: Union[str, tkPhotoImage]|
+|size|size of a image (w,h) w=characters-wide, h=rows-high :type size: Tuple[int,int]|
+|visible|control visibility of element :type visible: (bool)|
### UpdateAnimation
@@ -8243,8 +8578,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|source|Union[str,bytes] Filename or Base64 encoded string containing Animated GIF|
-|time_between_frames|(int) Number of milliseconds to wait between showing frames|
+|source|Filename or Base64 encoded string containing Animated GIF :type source: Union[str,bytes]|
+|time_between_frames|Number of milliseconds to wait between showing frames :type time_between_frames: (int)|
### bind
@@ -8262,21 +8597,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -8303,7 +8623,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -8314,6 +8634,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -8326,7 +8660,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -8341,7 +8675,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -8355,7 +8689,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -8381,10 +8729,10 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|filename|(str) filename to the new image to display.|
-|data|Union[str, tkPhotoImage] Base64 encoded string OR a tk.PhotoImage object|
-|size|Tuple[int,int] size of a image (w,h) w=characters-wide, h=rows-high|
-|visible|(bool) control visibility of element|
+|filename|filename to the new image to display. :type filename: (str)|
+|data|Base64 encoded string OR a tk.PhotoImage object :type data: Union[str, tkPhotoImage]|
+|size|size of a image (w,h) w=characters-wide, h=rows-high :type size: Tuple[int,int]|
+|visible|control visibility of element :type visible: (bool)|
### update_animation
@@ -8399,8 +8747,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|source|Union[str,bytes] Filename or Base64 encoded string containing Animated GIF|
-|time_between_frames|(int) Number of milliseconds to wait between showing frames|
+|source|Filename or Base64 encoded string containing Animated GIF :type source: Union[str,bytes]|
+|time_between_frames|Number of milliseconds to wait between showing frames :type time_between_frames: (int)|
## InputText Element
@@ -8432,40 +8780,25 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|default_text|(str) Text initially shown in the input box as a default value(Default value = '')|
-|size|Tuple[int, int] (width, height) w=characters-wide, h=rows-high|
-|disabled|(bool) set disable state for element (Default = False)|
-|password_char|(char) Password character if this is a password field (Default value = '')|
-|justification|(str) justification for data display. Valid choices - left, right, center|
-|background_color|(str) color of background in one of the color formats|
-|text_color|(str) color of the text|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|change_submits|(bool) * DEPRICATED DO NOT USE! Same as enable_events|
-|enable_events|(bool) If True then changes to this element are immediately reported as an event. Use this instead of change_submits (Default = False)|
-|do_not_clear|(bool) If False then the field will be set to blank after ANY event (button, any event) (Default = True)|
-|key|(any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window|
-|focus|(bool) Determines if initial focus should go to this element.|
-|pad|(int, int) or ((int, int), (int, int)) Tuple(s). Amount of padding to put around element. Normally (horizontal pixels, vertical pixels) but can be split apart further into ((horizontal left, horizontal right), (vertical above, vertical below))|
-|use_readonly_for_disable|(bool) If True (the default) tkinter state set to 'readonly'. Otherwise state set to 'disabled'|
-|right_click_menu|List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.|
-|visible|(bool) set visibility state of the element (Default = True)|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|default_text|Text initially shown in the input box as a default value(Default value = '') :type default_text: (str)|
+|size|w=characters-wide, h=rows-high :type size: Tuple[int, int] (width, height)|
+|disabled|set disable state for element (Default = False) :type disabled: (bool)|
+|password_char|Password character if this is a password field (Default value = '') :type password_char: (char)|
+|justification|justification for data display. Valid choices - left, right, center :type justification: (str)|
+|background_color|color of background in one of the color formats :type background_color: (str)|
+|text_color|color of the text :type text_color: (str)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|change_submits|* DEPRICATED DO NOT USE! Same as enable_events :type change_submits: (bool)|
+|enable_events|If True then changes to this element are immediately reported as an event. Use this instead of change_submits (Default = False) :type enable_events: (bool)|
+|do_not_clear|If False then the field will be set to blank after ANY event (button, any event) (Default = True) :type do_not_clear: (bool)|
+|key|Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window :type key: (any)|
+|focus|Determines if initial focus should go to this element. :type focus: (bool)|
+|pad|. Amount of padding to put around element. Normally (horizontal pixels, vertical pixels) but can be split apart further into ((horizontal left, horizontal right), (vertical above, vertical below)) :type pad: (int, int) or ((int, int), (int, int)) Tuple(s)|
+|use_readonly_for_disable|If True (the default) tkinter state set to 'readonly'. Otherwise state set to 'disabled' :type use_readonly_for_disable: (bool)|
+|right_click_menu|A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. :type right_click_menu: List[List[Union[List[str],str]]]|
+|visible|set visibility state of the element (Default = True) :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### Get
@@ -8475,7 +8808,7 @@ Read and return the current value of the input element. Must call `Window.Read`
|Name|Meaning|
|---|---|
-| **return** | (str) current value of Input field or '' if error encountered |
+| **return** | current value of Input field or '' if error encountered
:rtype: (str) |
### SetFocus
@@ -8489,7 +8822,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -8503,7 +8836,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -8523,13 +8856,13 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(str) new text to display as default text in Input field|
-|disabled|(bool) disable or enable state of the element (sets Entry Widget to readonly or normal)|
-|select|(bool) if True, then the text will be selected|
-|visible|(bool) change visibility of element|
-|text_color|(str) change color of text being typed|
-|background_color|(str) change color of the background|
-|move_cursor_to|Union[int, str] Moves the cursor to a particular offset. Defaults to 'end'|
+|value|new text to display as default text in Input field :type value: (str)|
+|disabled|disable or enable state of the element (sets Entry Widget to readonly or normal) :type disabled: (bool)|
+|select|if True, then the text will be selected :type select: (bool)|
+|visible|change visibility of element :type visible: (bool)|
+|text_color|change color of text being typed :type text_color: (str)|
+|background_color|change color of the background :type background_color: (str)|
+|move_cursor_to|Moves the cursor to a particular offset. Defaults to 'end' :type move_cursor_to: Union[int, str]|
### bind
@@ -8547,21 +8880,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -8588,7 +8906,7 @@ Read and return the current value of the input element. Must call `Window.Read`
|Name|Meaning|
|---|---|
-| **return** | (str) current value of Input field or '' if error encountered |
+| **return** | current value of Input field or '' if error encountered
:rtype: (str) |
### get_size
@@ -8598,7 +8916,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -8609,6 +8927,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -8621,7 +8953,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -8636,7 +8968,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -8650,7 +8982,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -8679,13 +9025,13 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(str) new text to display as default text in Input field|
-|disabled|(bool) disable or enable state of the element (sets Entry Widget to readonly or normal)|
-|select|(bool) if True, then the text will be selected|
-|visible|(bool) change visibility of element|
-|text_color|(str) change color of text being typed|
-|background_color|(str) change color of the background|
-|move_cursor_to|Union[int, str] Moves the cursor to a particular offset. Defaults to 'end'|
+|value|new text to display as default text in Input field :type value: (str)|
+|disabled|disable or enable state of the element (sets Entry Widget to readonly or normal) :type disabled: (bool)|
+|select|if True, then the text will be selected :type select: (bool)|
+|visible|change visibility of element :type visible: (bool)|
+|text_color|change color of text being typed :type text_color: (str)|
+|background_color|change color of the background :type background_color: (str)|
+|move_cursor_to|Moves the cursor to a particular offset. Defaults to 'end' :type move_cursor_to: Union[int, str]|
## Listbox Element
@@ -8718,39 +9064,24 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|values|List[Any] list of values to display. Can be any type including mixed types as long as they have __str__ method|
-|default_values|List[Any] which values should be initially selected|
-|select_mode|[enum] Select modes are used to determine if only 1 item can be selected or multiple and how they can be selected. Valid choices begin with "LISTBOX_SELECT_MODE_" and include: LISTBOX_SELECT_MODE_SINGLE LISTBOX_SELECT_MODE_MULTIPLE LISTBOX_SELECT_MODE_BROWSE LISTBOX_SELECT_MODE_EXTENDED|
-|change_submits|(bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead|
-|enable_events|(bool) Turns on the element specific events. Listbox generates events when an item is clicked|
-|bind_return_key|(bool) If True, then the return key will cause a the Listbox to generate an event|
-|size|Tuple(int, int) (width, height) width = characters-wide, height = rows-high|
-|disabled|(bool) set disable state for element|
-|auto_size_text|(bool) True if element should be the same size as the contents|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|background_color|(str) color of background|
-|text_color|(str) color of the text|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|right_click_menu|List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|values|list of values to display. Can be any type including mixed types as long as they have __str__ method :type values: List[Any]|
+|default_values|which values should be initially selected :type default_values: List[Any]|
+|select_mode|Select modes are used to determine if only 1 item can be selected or multiple and how they can be selected. Valid choices begin with "LISTBOX_SELECT_MODE_" and include: LISTBOX_SELECT_MODE_SINGLE LISTBOX_SELECT_MODE_MULTIPLE LISTBOX_SELECT_MODE_BROWSE LISTBOX_SELECT_MODE_EXTENDED :type select_mode: [enum]|
+|change_submits|DO NOT USE. Only listed for backwards compat - Use enable_events instead :type change_submits: (bool)|
+|enable_events|Turns on the element specific events. Listbox generates events when an item is clicked :type enable_events: (bool)|
+|bind_return_key|If True, then the return key will cause a the Listbox to generate an event :type bind_return_key: (bool)|
+|size|width = characters-wide, height = rows-high :type size: Tuple(int, int) (width, height)|
+|disabled|set disable state for element :type disabled: (bool)|
+|auto_size_text|True if element should be the same size as the contents :type auto_size_text: (bool)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|background_color|color of background :type background_color: (str)|
+|text_color|color of the text :type text_color: (str)|
+|key|Used with window.FindElement and with return values to uniquely identify this element :type key: (Any)|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|right_click_menu|A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. :type right_click_menu: List[List[Union[List[str],str]]]|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### GetIndexes
@@ -8760,7 +9091,7 @@ Returns the items currently selected as a list of indexes
|Name|Meaning|
|---|---|
-| **return** | List[int] A list of offsets into values that is currently selected |
+| **return** | A list of offsets into values that is currently selected
:rtype: List[int] |
### GetListValues
@@ -8770,7 +9101,7 @@ Returns list of Values provided by the user in the user's format
|Name|Meaning|
|---|---|
-| **return** | List[Any]. List of values. Can be any / mixed types -> [] |
+| **return** | List of values. Can be any / mixed types -> []
:rtype: List[Any] |
### SetFocus
@@ -8784,7 +9115,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -8798,7 +9129,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### SetValue
@@ -8812,7 +9143,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|values|List[Any] new values to choose based on previously set values|
+|values|new values to choose based on previously set values :type values: List[Any]|
### Update
@@ -8823,6 +9154,7 @@ Update(values=None,
disabled=None,
set_to_index=None,
scroll_to_index=None,
+ select_mode=None,
visible=None)
```
@@ -8830,11 +9162,12 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|values|List[Any] new list of choices to be shown to user|
-|disabled|(bool) disable or enable state of the element|
-|set_to_index|Union[int, list, tuple] highlights the item(s) indicated. If parm is an int one entry will be set. If is a list, then each entry in list is highlighted|
-|scroll_to_index|(int) scroll the listbox so that this index is the first shown|
-|visible|(bool) control visibility of element|
+|values|new list of choices to be shown to user :type values: List[Any]|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|set_to_index|highlights the item(s) indicated. If parm is an int one entry will be set. If is a list, then each entry in list is highlighted :type set_to_index: Union[int, list, tuple]|
+|scroll_to_index|scroll the listbox so that this index is the first shown :type scroll_to_index: (int)|
+|mode|changes the select mode according to tkinter's listbox widget :type mode: (str)|
+|visible|control visibility of element :type visible: (bool)|
### bind
@@ -8852,21 +9185,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -8885,6 +9203,17 @@ Parameter Descriptions:
|expand_y|(Bool) If True Element will expand in the Vertical directions|
|expand_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row|
+### get
+
+Returns the list of items currently selected in this listbox. It should be identical
+to the value you would receive when performing a window.read() call.
+
+`get()`
+
+|Name|Meaning|
+|---|---|
+| **return** | The list of currently selected items. The actual items are returned, not the indexes
:rtype: List[Any] |
+
### get_indexes
Returns the items currently selected as a list of indexes
@@ -8893,7 +9222,7 @@ Returns the items currently selected as a list of indexes
|Name|Meaning|
|---|---|
-| **return** | List[int] A list of offsets into values that is currently selected |
+| **return** | A list of offsets into values that is currently selected
:rtype: List[int] |
### get_list_values
@@ -8903,7 +9232,7 @@ Returns list of Values provided by the user in the user's format
|Name|Meaning|
|---|---|
-| **return** | List[Any]. List of values. Can be any / mixed types -> [] |
+| **return** | List of values. Can be any / mixed types -> []
:rtype: List[Any] |
### get_size
@@ -8913,7 +9242,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -8924,6 +9253,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -8936,7 +9279,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -8951,7 +9294,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -8965,7 +9308,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### set_value
@@ -8979,7 +9322,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|values|List[Any] new values to choose based on previously set values|
+|values|new values to choose based on previously set values :type values: List[Any]|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -8999,6 +9356,7 @@ update(values=None,
disabled=None,
set_to_index=None,
scroll_to_index=None,
+ select_mode=None,
visible=None)
```
@@ -9006,11 +9364,12 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|values|List[Any] new list of choices to be shown to user|
-|disabled|(bool) disable or enable state of the element|
-|set_to_index|Union[int, list, tuple] highlights the item(s) indicated. If parm is an int one entry will be set. If is a list, then each entry in list is highlighted|
-|scroll_to_index|(int) scroll the listbox so that this index is the first shown|
-|visible|(bool) control visibility of element|
+|values|new list of choices to be shown to user :type values: List[Any]|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|set_to_index|highlights the item(s) indicated. If parm is an int one entry will be set. If is a list, then each entry in list is highlighted :type set_to_index: Union[int, list, tuple]|
+|scroll_to_index|scroll the listbox so that this index is the first shown :type scroll_to_index: (int)|
+|mode|changes the select mode according to tkinter's listbox widget :type mode: (str)|
+|visible|control visibility of element :type visible: (bool)|
## Menu Element
@@ -9034,6 +9393,7 @@ Menu(menu_definition,
background_color=None,
size=(None, None),
tearoff=False,
+ font=None,
pad=None,
key=None,
visible=True,
@@ -9044,29 +9404,14 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|menu_definition|List[List[Tuple[str, List[str]]]|
-|background_color|(str) color of the background|
-|size|Tuple[int, int] Not used in the tkinter port|
-|tearoff|(bool) if True, then can tear the menu off from the window ans use as a floating window. Very cool effect|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|key|(any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|menu_definition|??? :type menu_definition: List[List[Tuple[str, List[str]]]|
+|background_color|color of the background :type background_color: (str)|
+|size|Not used in the tkinter port :type size: Tuple[int, int]|
+|tearoff|if True, then can tear the menu off from the window ans use as a floating window. Very cool effect :type tearoff: (bool)|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|key|Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window :type key: (any)|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### SetFocus
@@ -9080,7 +9425,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -9094,7 +9439,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -9108,8 +9453,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|menu_definition|List[List[Tuple[str, List[str]]]|
-|visible|(bool) control visibility of element|
+|menu_definition|??? :type menu_definition: List[List[Tuple[str, List[str]]]|
+|visible|control visibility of element :type visible: (bool)|
### bind
@@ -9127,21 +9472,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -9168,7 +9498,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -9179,6 +9509,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -9191,7 +9535,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -9206,7 +9550,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -9220,7 +9564,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -9243,8 +9601,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|menu_definition|List[List[Tuple[str, List[str]]]|
-|visible|(bool) control visibility of element|
+|menu_definition|??? :type menu_definition: List[List[Tuple[str, List[str]]]|
+|visible|control visibility of element :type visible: (bool)|
## Multiline Element
@@ -9279,41 +9637,26 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|default_text|(str) Initial text to show|
-|enter_submits|(bool) if True, the Window.Read call will return is enter key is pressed in this element|
-|disabled|(bool) set disable state|
-|autoscroll|(bool) If True the contents of the element will automatically scroll as more data added to the end|
-|border_width|(int) width of border around element in pixels|
-|size|Tuple[int, int] (width, height) width = characters-wide, height = rows-high|
-|auto_size_text|(bool) if True will size the element to match the length of the text|
-|background_color|(str) color of background|
-|text_color|(str) color of the text|
-|change_submits|(bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead|
-|enable_events|(bool) Turns on the element specific events. Spin events happen when an item changes|
-|do_not_clear|if False the element will be cleared any time the Window.Read call returns|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element|
-|focus|(bool) if True initial focus will go to this element|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|right_click_menu|List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|default_text|Initial text to show :type default_text: (str)|
+|enter_submits|if True, the Window.Read call will return is enter key is pressed in this element :type enter_submits: (bool)|
+|disabled|set disable state :type disabled: (bool)|
+|autoscroll|If True the contents of the element will automatically scroll as more data added to the end :type autoscroll: (bool)|
+|border_width|width of border around element in pixels :type border_width: (int)|
+|size|int] (width, height) width = characters-wide, height = rows-high :type size: Tuple[int,|
+|auto_size_text|if True will size the element to match the length of the text :type auto_size_text: (bool)|
+|background_color|color of background :type background_color: (str)|
+|text_color|color of the text :type text_color: (str)|
+|chfange_submits|DO NOT USE. Only listed for backwards compat - Use enable_events instead :type chfange_submits: (bool)|
+|enable_events|Turns on the element specific events. Spin events happen when an item changes :type enable_events: (bool)|
+|do_not_clear|if False the element will be cleared any time the Window.Read call returns :type do_not_clear: bool|
+|key|Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element :type key: (Any)|
+|focus|if True initial focus will go to this element :type focus: (bool)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|right_click_menu|A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. :type right_click_menu: List[List[Union[List[str],str]]]|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### Get
@@ -9323,7 +9666,7 @@ Return current contents of the Multiline Element
|Name|Meaning|
|---|---|
-| **return** | (str) current contents of the Multiline Element (used as an input type of Multiline |
+| **return** | current contents of the Multiline Element (used as an input type of Multiline
:rtype: (str) |
### SetFocus
@@ -9337,7 +9680,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -9351,7 +9694,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -9374,14 +9717,14 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(str) new text to display|
-|disabled|(bool) disable or enable state of the element|
-|append|(bool) if True then new value will be added onto the end of the current value. if False then contents will be replaced.|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|text_color|(str) color of the text|
-|background_color|(str) color of background|
-|visible|(bool) set visibility state of the element|
-|autoscroll|(bool) if True then contents of element are scrolled down when new text is added to the end|
+|value|new text to display :type value: (str)|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|append|if True then new value will be added onto the end of the current value. if False then contents will be replaced. :type append: (bool)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|text_color|color of the text :type text_color: (str)|
+|background_color|color of background :type background_color: (str)|
+|visible|set visibility state of the element :type visible: (bool)|
+|autoscroll|if True then contents of element are scrolled down when new text is added to the end :type autoscroll: (bool)|
### bind
@@ -9399,21 +9742,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -9440,7 +9768,7 @@ Return current contents of the Multiline Element
|Name|Meaning|
|---|---|
-| **return** | (str) current contents of the Multiline Element (used as an input type of Multiline |
+| **return** | current contents of the Multiline Element (used as an input type of Multiline
:rtype: (str) |
### get_size
@@ -9450,7 +9778,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -9461,6 +9789,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -9473,7 +9815,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -9488,7 +9830,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -9502,7 +9844,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -9534,14 +9890,14 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(str) new text to display|
-|disabled|(bool) disable or enable state of the element|
-|append|(bool) if True then new value will be added onto the end of the current value. if False then contents will be replaced.|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|text_color|(str) color of the text|
-|background_color|(str) color of background|
-|visible|(bool) set visibility state of the element|
-|autoscroll|(bool) if True then contents of element are scrolled down when new text is added to the end|
+|value|new text to display :type value: (str)|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|append|if True then new value will be added onto the end of the current value. if False then contents will be replaced. :type append: (bool)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|text_color|color of the text :type text_color: (str)|
+|background_color|color of background :type background_color: (str)|
+|visible|set visibility state of the element :type visible: (bool)|
+|autoscroll|if True then contents of element are scrolled down when new text is added to the end :type autoscroll: (bool)|
## OptionMenu Element
@@ -9569,33 +9925,18 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|values|List[Any] Values to be displayed|
-|default_value|(Any) the value to choose by default|
-|size|Tuple[int, int] (width, height) size in characters (wide) and rows (high)|
-|disabled|(bool) control enabled / disabled|
-|auto_size_text|(bool) True if size of Element should match the contents of the items|
-|background_color|(str) color of background|
-|text_color|(str) color of the text|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|tooltip|(str) text that will appear when mouse hovers over this element|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|values|Values to be displayed :type values: List[Any]|
+|default_value|the value to choose by default :type default_value: (Any)|
+|size|size in characters (wide) and rows (high) :type size: Tuple[int, int] (width, height)|
+|disabled|control enabled / disabled :type disabled: (bool)|
+|auto_size_text|True if size of Element should match the contents of the items :type auto_size_text: (bool)|
+|background_color|color of background :type background_color: (str)|
+|text_color|color of the text :type text_color: (str)|
+|key|Used with window.FindElement and with return values to uniquely identify this element :type key: (Any)|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|tooltip|(str) text that will appear when mouse hovers over this element :type tooltip: (str)|
+|visible|(bool) set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING|
### SetFocus
@@ -9609,7 +9950,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -9623,7 +9964,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -9640,10 +9981,10 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(Any) the value to choose by default|
-|values|List[Any] Values to be displayed|
-|disabled|(bool) disable or enable state of the element|
-|visible|(bool) control visibility of element|
+|value|the value to choose by default :type value: (Any)|
+|values|Values to be displayed :type values: List[Any]|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|visible|control visibility of element :type visible: (bool)|
### bind
@@ -9661,21 +10002,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -9702,7 +10028,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -9713,6 +10039,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -9725,7 +10065,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -9740,7 +10080,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -9754,7 +10094,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -9780,10 +10134,10 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(Any) the value to choose by default|
-|values|List[Any] Values to be displayed|
-|disabled|(bool) disable or enable state of the element|
-|visible|(bool) control visibility of element|
+|value|the value to choose by default :type value: (Any)|
+|values|Values to be displayed :type values: List[Any]|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|visible|control visibility of element :type visible: (bool)|
## Output Element
@@ -9806,31 +10160,16 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high|
-|background_color|(str) color of background|
-|text_color|(str) color of the text|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element|
-|right_click_menu|List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|size|(width, height) w=characters-wide, h=rows-high :type size: Tuple[int, int]|
+|background_color|color of background :type background_color: (str)|
+|text_color|color of the text :type text_color: (str)|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|key|Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element :type key: (Any)|
+|right_click_menu|A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. :type right_click_menu: List[List[Union[List[str],str]]]|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### Get
@@ -9840,7 +10179,7 @@ Returns the current contents of the output. Similar to Get method other Element
|Name|Meaning|
|---|---|
-| **return** | (str) the current value of the output |
+| **return** | the current value of the output
:rtype: (str) |
### SetFocus
@@ -9854,7 +10193,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -9868,7 +10207,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### TKOut
@@ -9886,8 +10225,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(str) string that will replace current contents of the output area|
-|visible|(bool) control visibility of element|
+|value|string that will replace current contents of the output area :type value: (str)|
+|visible|control visibility of element :type visible: (bool)|
### bind
@@ -9905,21 +10244,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -9932,8 +10256,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|expand_x|(Bool) If True Element will expand in the Horizontal directions|
-|expand_y|(Bool) If True Element will expand in the Vertical directions|
+|expand_x|If True Element will expand in the Horizontal directions :type expand_x: (Bool)|
+|expand_y|If True Element will expand in the Vertical directions :type expand_y: (Bool)|
### get_size
@@ -9943,7 +10267,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -9954,6 +10278,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -9966,7 +10304,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -9981,7 +10319,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -9995,12 +10333,26 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### tk_out
#### property: tk_out
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
+
### unhide_row
Unhides (makes visible again) the row container that the Element is located on.
@@ -10022,8 +10374,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(str) string that will replace current contents of the output area|
-|visible|(bool) control visibility of element|
+|value|string that will replace current contents of the output area :type value: (str)|
+|visible|control visibility of element :type visible: (bool)|
## Pane Element
@@ -10048,33 +10400,18 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|pane_list|List[Column] Must be a list of Column Elements. Each Column supplied becomes one pane that's shown|
-|background_color|(str) color of background|
-|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high How much room to reserve for the Pane|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|orientation|(str) 'horizontal' or 'vertical' or ('h' or 'v'). Direction the Pane should slide|
-|show_handle|(bool) if True, the handle is drawn that makes it easier to grab and slide|
-|relief|(enum) relief style. Values are same as other elements that use relief values. RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID|
-|handle_size|(int) Size of the handle in pixels|
-|border_width|(int) width of border around element in pixels|
-|key|(any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|pane_list|Must be a list of Column Elements. Each Column supplied becomes one pane that's shown :type pane_list: List[Column]|
+|background_color|color of background :type background_color: (str)|
+|size|(width, height) w=characters-wide, h=rows-high How much room to reserve for the Pane :type size: Tuple[int, int]|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|orientation|'horizontal' or 'vertical' or ('h' or 'v'). Direction the Pane should slide :type orientation: (str)|
+|show_handle|if True, the handle is drawn that makes it easier to grab and slide :type show_handle: (bool)|
+|relief|relief style. Values are same as other elements that use relief values. RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID :type relief: (enum)|
+|handle_size|Size of the handle in pixels :type handle_size: (int)|
+|border_width|width of border around element in pixels :type border_width: (int)|
+|key|Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window :type key: (any)|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### SetFocus
@@ -10088,7 +10425,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -10102,7 +10439,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -10116,7 +10453,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|visible|(bool) control visibility of element|
+|visible|control visibility of element :type visible: (bool)|
### bind
@@ -10134,21 +10471,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -10175,7 +10497,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -10186,6 +10508,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -10198,7 +10534,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -10213,7 +10549,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -10227,7 +10563,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -10250,7 +10600,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|visible|(bool) control visibility of element|
+|visible|control visibility of element :type visible: (bool)|
## ProgressBar Element
@@ -10275,33 +10625,18 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|max_value|(int) max value of progressbar|
-|orientation|(str) 'horizontal' or 'vertical'|
-|size|Tuple[int, int] Size of the bar. If horizontal (chars wide, pixels high), vert (pixels wide, rows high)|
-|auto_size_text|(bool) Not sure why this is here|
-|bar_color|Tuple[str, str] The 2 colors that make up a progress bar. One is the background, the other is the bar|
-|style|(str) Progress bar style defined as one of these 'default', 'winnative', 'clam', 'alt', 'classic', 'vista', 'xpnative'|
-|border_width|(int) The amount of pixels that go around the outside of the bar|
-|relief|(str) relief style. Values are same as progress meter relief values. Can be a constant or a string: `RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID` (Default value = DEFAULT_PROGRESS_BAR_RELIEF)|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|max_value|max value of progressbar :type max_value: (int)|
+|orientation|'horizontal' or 'vertical' :type orientation: (str)|
+|size|Size of the bar. If horizontal (chars wide, pixels high), vert (pixels wide, rows high) :type size: Tuple[int, int]|
+|auto_size_text|Not sure why this is here :type auto_size_text: (bool)|
+|bar_color|The 2 colors that make up a progress bar. One is the background, the other is the bar :type bar_color: Tuple[str, str]|
+|style|Progress bar style defined as one of these 'default', 'winnative', 'clam', 'alt', 'classic', 'vista', 'xpnative' :type style: (str)|
+|border_width|The amount of pixels that go around the outside of the bar :type border_width: (int)|
+|relief|relief style. Values are same as progress meter relief values. Can be a constant or a string: `RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID` (Default value = DEFAULT_PROGRESS_BAR_RELIEF) :type relief: (str)|
+|key|Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element :type key: (Any)|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### SetFocus
@@ -10315,7 +10650,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -10329,7 +10664,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -10343,7 +10678,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|visible|(bool) control visibility of element|
+|visible|control visibility of element :type visible: (bool)|
### UpdateBar
@@ -10357,8 +10692,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|current_count|(int) sets the current value|
-|max|(int) changes the max value|
+|current_count|sets the current value :type current_count: (int)|
+|max|changes the max value :type max: (int)|
### bind
@@ -10376,21 +10711,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -10417,7 +10737,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -10428,6 +10748,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -10440,7 +10774,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -10455,7 +10789,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -10469,7 +10803,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -10492,7 +10840,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|visible|(bool) control visibility of element|
+|visible|control visibility of element :type visible: (bool)|
### update_bar
@@ -10506,8 +10854,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|current_count|(int) sets the current value|
-|max|(int) changes the max value|
+|current_count|sets the current value :type current_count: (int)|
+|max|changes the max value :type max: (int)|
## Radio Element
@@ -10537,37 +10885,22 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|text|(str) Text to display next to button|
-|group_id|(Any) Groups together multiple Radio Buttons. Any type works|
-|default|(bool). Set to True for the one element of the group you want initially selected|
-|disabled|(bool) set disable state|
-|size|Tuple[int, int] (width, height) width = characters-wide, height = rows-high|
-|auto_size_text|(bool) if True will size the element to match the length of the text|
-|background_color|(str) color of background|
-|text_color|(str) color of the text|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|change_submits|(bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead|
-|enable_events|(bool) Turns on the element specific events. Radio Button events happen when an item is selected|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|text|Text to display next to button :type text: (str)|
+|group_id|Groups together multiple Radio Buttons. Any type works :type group_id: (Any)|
+|default|Set to True for the one element of the group you want initially selected :type default: (bool)|
+|disabled|set disable state :type disabled: (bool)|
+|size|int] (width, height) width = characters-wide, height = rows-high :type size: Tuple[int,|
+|auto_size_text|if True will size the element to match the length of the text :type auto_size_text: (bool)|
+|background_color|color of background :type background_color: (str)|
+|text_color|color of the text :type text_color: (str)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|key|Used with window.FindElement and with return values to uniquely identify this element :type key: (Any)|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|change_submits|DO NOT USE. Only listed for backwards compat - Use enable_events instead :type change_submits: (bool)|
+|enable_events|Turns on the element specific events. Radio Button events happen when an item is selected :type enable_events: (bool)|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### Get
@@ -10577,7 +10910,7 @@ A snapshot of the value of Radio Button -> (bool)
|Name|Meaning|
|---|---|
-| **return** | (bool) True if this radio button is selected |
+| **return** | True if this radio button is selected
:rtype: (bool) |
### ResetGroup
@@ -10599,7 +10932,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -10613,7 +10946,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -10629,9 +10962,9 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(bool) if True change to selected and set others in group to unselected|
-|disabled|(bool) disable or enable state of the element|
-|visible|(bool) control visibility of element|
+|value|if True change to selected and set others in group to unselected :type value: (bool)|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|visible|control visibility of element :type visible: (bool)|
### bind
@@ -10649,21 +10982,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -10690,7 +11008,7 @@ A snapshot of the value of Radio Button -> (bool)
|Name|Meaning|
|---|---|
-| **return** | (bool) True if this radio button is selected |
+| **return** | True if this radio button is selected
:rtype: (bool) |
### get_size
@@ -10700,7 +11018,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -10719,6 +11037,20 @@ Sets all Radio Buttons in the group to not selected
reset_group()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -10731,7 +11063,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -10746,7 +11078,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -10760,7 +11092,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -10785,9 +11131,9 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(bool) if True change to selected and set others in group to unselected|
-|disabled|(bool) disable or enable state of the element|
-|visible|(bool) control visibility of element|
+|value|if True change to selected and set others in group to unselected :type value: (bool)|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|visible|control visibility of element :type visible: (bool)|
## Slider Element
@@ -10820,41 +11166,26 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|range|Union[Tuple[int, int], Tuple[float, float]] slider's range (min value, max value)|
-|default_value|Union[int, float] starting value for the slider|
-|resolution|Union[int, float] the smallest amount the slider can be moved|
-|tick_interval|Union[int, float] how often a visible tick should be shown next to slider|
-|orientation|(str) 'horizontal' or 'vertical' ('h' or 'v' also work)|
-|disable_number_display|(bool) if True no number will be displayed by the Slider Element|
-|border_width|(int) width of border around element in pixels|
-|relief|(enum) relief style. RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID|
-|change_submits|(bool) * DEPRICATED DO NOT USE! Same as enable_events|
-|enable_events|(bool) If True then moving the slider will generate an Event|
-|disabled|(bool) set disable state for element|
-|size|Tuple[int, int] (width in characters, height in rows)|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|background_color|(str) color of slider's background|
-|text_color|(str) color of the slider's text|
-|key|(any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|range|slider's range (min value, max value) :type range: Union[Tuple[int, int], Tuple[float, float]]|
+|default_value|starting value for the slider :type default_value: Union[int, float]|
+|resolution|the smallest amount the slider can be moved :type resolution: Union[int, float]|
+|tick_interval|how often a visible tick should be shown next to slider :type tick_interval: Union[int, float]|
+|orientation|'horizontal' or 'vertical' ('h' or 'v' also work) :type orientation: (str)|
+|disable_number_display|if True no number will be displayed by the Slider Element :type disable_number_display: (bool)|
+|border_width|width of border around element in pixels :type border_width: (int)|
+|relief|relief style. RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID :type relief: (enum)|
+|change_submits|* DEPRICATED DO NOT USE! Same as enable_events :type change_submits: (bool)|
+|enable_events|If True then moving the slider will generate an Event :type enable_events: (bool)|
+|disabled|set disable state for element :type disabled: (bool)|
+|size|(w=characters-wide, h=rows-high) :type size: Tuple[int, int]|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|background_color|color of slider's background :type background_color: (str)|
+|text_color|color of the slider's text :type text_color: (str)|
+|key|Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window :type key: (any)|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### SetFocus
@@ -10868,7 +11199,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -10882,7 +11213,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -10899,10 +11230,10 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|Union[int, float] sets current slider value|
-|range|Union[Tuple[int, int], Tuple[float, float] Sets a new range for slider|
-|disabled|(bool) disable or enable state of the element|
-|visible|(bool) control visibility of element|
+|value|sets current slider value :type value: Union[int, float]|
+|range|Sets a new range for slider :type range: Union[Tuple[int, int], Tuple[float, float]|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|visible|control visibility of element :type visible: (bool)|
### bind
@@ -10920,21 +11251,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -10961,7 +11277,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -10972,6 +11288,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -10984,7 +11314,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -10999,7 +11329,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -11013,7 +11343,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -11039,10 +11383,10 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|Union[int, float] sets current slider value|
-|range|Union[Tuple[int, int], Tuple[float, float] Sets a new range for slider|
-|disabled|(bool) disable or enable state of the element|
-|visible|(bool) control visibility of element|
+|value|sets current slider value :type value: Union[int, float]|
+|range|Sets a new range for slider :type range: Union[Tuple[int, int], Tuple[float, float]|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|visible|control visibility of element :type visible: (bool)|
## Spin Element
@@ -11070,36 +11414,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|values|List[Any] List of valid values|
-|initial_value|(Any) Initial item to show in window. Choose from list of values supplied|
-|disabled|(bool) set disable state|
-|change_submits|(bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead|
-|enable_events|(bool) Turns on the element specific events. Spin events happen when an item changes|
-|size|Tuple[int, int] (width, height) width = characters-wide, height = rows-high|
-|auto_size_text|(bool) if True will size the element to match the length of the text|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|background_color|(str) color of background|
-|text_color|(str) color of the text|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|values|List of valid values :type values: List[Any]|
+|initial_value|Initial item to show in window. Choose from list of values supplied :type initial_value: (Any)|
+|disabled|set disable state :type disabled: (bool)|
+|change_submits|DO NOT USE. Only listed for backwards compat - Use enable_events instead :type change_submits: (bool)|
+|enable_events|Turns on the element specific events. Spin events happen when an item changes :type enable_events: (bool)|
+|size|(width, height) width = characters-wide, height = rows-high :type size: Tuple[int, int]|
+|auto_size_text|if True will size the element to match the length of the text :type auto_size_text: (bool)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|background_color|color of background :type background_color: (str)|
+|text_color|color of the text :type text_color: (str)|
+|key|Used with window.FindElement and with return values to uniquely identify this element :type key: (Any)|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### Get
@@ -11111,7 +11440,7 @@ item returned will be an int (not a string)
|Name|Meaning|
|---|---|
-| **return** | (Any) The currently visible entry |
+| **return** | The currently visible entry
:rtype: (Any) |
### SetFocus
@@ -11125,7 +11454,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -11139,7 +11468,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -11156,10 +11485,10 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(Any) set the current value from list of choices|
-|values|List[Any] set available choices|
-|disabled|(bool) disable or enable state of the element|
-|visible|(bool) control visibility of element|
+|value|set the current value from list of choices :type value: (Any)|
+|values|set available choices :type values: List[Any]|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|visible|control visibility of element :type visible: (bool)|
### bind
@@ -11177,21 +11506,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -11220,7 +11534,7 @@ item returned will be an int (not a string)
|Name|Meaning|
|---|---|
-| **return** | (Any) The currently visible entry |
+| **return** | The currently visible entry
:rtype: (Any) |
### get_size
@@ -11230,7 +11544,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -11241,6 +11555,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -11253,7 +11581,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -11268,7 +11596,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -11282,7 +11610,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -11308,10 +11650,10 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(Any) set the current value from list of choices|
-|values|List[Any] set available choices|
-|disabled|(bool) disable or enable state of the element|
-|visible|(bool) control visibility of element|
+|value|set the current value from list of choices :type value: (Any)|
+|values|set available choices :type values: List[Any]|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|visible|control visibility of element :type visible: (bool)|
## StatusBar Element
@@ -11339,36 +11681,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|text|(str) Text that is to be displayed in the widget|
-|size|Tuple[(int), (int)] (w,h) w=characters-wide, h=rows-high|
-|auto_size_text|(bool) True if size should fit the text length|
-|click_submits|(bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead|
-|enable_events|(bool) Turns on the element specific events. StatusBar events occur when the bar is clicked|
-|relief|(enum) relief style. Values are same as progress meter relief values. Can be a constant or a string: `RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID`|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|text_color|(str) color of the text|
-|background_color|(str) color of background|
-|justification|(str) how string should be aligned within space provided by size. Valid choices = `left`, `right`, `center`|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|text|Text that is to be displayed in the widget :type text: (str)|
+|size|(w,h) w=characters-wide, h=rows-high :type size: Tuple[(int), (int)]|
+|auto_size_text|True if size should fit the text length :type auto_size_text: (bool)|
+|click_submits|DO NOT USE. Only listed for backwards compat - Use enable_events instead :type click_submits: (bool)|
+|enable_events|Turns on the element specific events. StatusBar events occur when the bar is clicked :type enable_events: (bool)|
+|relief|relief style. Values are same as progress meter relief values. Can be a constant or a string: `RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID` :type relief: (enum)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|text_color|color of the text :type text_color: (str)|
+|background_color|color of background :type background_color: (str)|
+|justification|how string should be aligned within space provided by size. Valid choices = `left`, `right`, `center` :type justification: (str)|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|key|Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element :type key: (Any)|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### SetFocus
@@ -11382,7 +11709,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -11396,7 +11723,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -11414,11 +11741,11 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(str) new text to show|
-|background_color|(str) color of background|
-|text_color|(str) color of the text|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|visible|(bool) set visibility state of the element|
+|value|new text to show :type value: (str)|
+|background_color|color of background :type background_color: (str)|
+|text_color|color of the text :type text_color: (str)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|visible|set visibility state of the element :type visible: (bool)|
### bind
@@ -11436,21 +11763,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -11477,7 +11789,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -11488,6 +11800,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -11500,7 +11826,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -11515,7 +11841,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -11529,7 +11855,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -11556,11 +11896,242 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(str) new text to show|
-|background_color|(str) color of background|
-|text_color|(str) color of the text|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|visible|(bool) set visibility state of the element|
+|value|new text to show :type value: (str)|
+|background_color|color of background :type background_color: (str)|
+|text_color|color of the text :type text_color: (str)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|visible|set visibility state of the element :type visible: (bool)|
+
+## SystemTray Element
+
+ A "Simulated System Tray" that duplicates the API calls available to PySimpleGUIWx and PySimpleGUIQt users.
+
+ All of the functionality works. The icon is displayed ABOVE the system tray rather than inside of it.
+
+SystemTray - create an icon in the system tray
+
+```
+SystemTray(menu=None,
+ filename=None,
+ data=None,
+ data_base64=None,
+ tooltip=None,
+ metadata=None)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|menu|Menu definition :type menu: ???|
+|filename|filename for icon :type filename: ????|
+|data|in-ram image for icon :type data: ???|
+|data_base64|basee-64 data for icon :type data_base64: ???|
+|tooltip|tooltip string :type tooltip: (str)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
+
+### Close
+
+Close the system tray window
+
+```python
+Close()
+```
+
+### Hide
+
+Hides the icon
+
+```python
+Hide()
+```
+
+### Read
+
+Reads the context menu
+
+```
+Read(timeout=None)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|timeout|Optional. Any value other than None indicates a non-blocking read|
+
+### ShowMessage
+
+Shows a balloon above icon in system tray
+
+```
+ShowMessage(title,
+ message,
+ filename=None,
+ data=None,
+ data_base64=None,
+ messageicon=None,
+ time=(1000, 3000))
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|title|Title shown in balloon :type title:|
+|message|Message to be displayed :type message:|
+|filename|Optional icon filename :type filename:|
+|data|Optional in-ram icon :type data:|
+|data_base64|Optional base64 icon :type data_base64:|
+|time|Amount of time to display message in milliseconds. If tuple, first item is fade in/out duration :type time: Union[int, Tuple[int, int]]|
+|||
+| **return** | The event that happened during the display such as user clicked on message
:rtype: (Any) |
+
+### UnHide
+
+Restores a previously hidden icon
+
+```python
+UnHide()
+```
+
+### Update
+
+Updates the menu, tooltip or icon
+
+```
+Update(menu=None,
+ tooltip=None,
+ filename=None,
+ data=None,
+ data_base64=None)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|menu|menu defintion :type menu: ???|
+|tooltip|string representing tooltip :type tooltip: ???|
+|filename|icon filename :type filename: ???|
+|data|icon raw image :type data: ???|
+|data_base64|icon base 64 image :type data_base64: ???|
+
+### close
+
+Close the system tray window
+
+```python
+close()
+```
+
+### hide
+
+Hides the icon
+
+```python
+hide()
+```
+
+### notify
+
+Displays a "notification window", usually in the bottom right corner of your display. Has an icon, a title, and a message
+The window will slowly fade in and out if desired. Clicking on the window will cause it to move through the end the current "phase". For example, if the window was fading in and it was clicked, then it would immediately stop fading in and instead be fully visible. It's a way for the user to quickly dismiss the window.
+
+```
+notify(title,
+ message,
+ icon=...,
+ display_duration_in_ms=3000,
+ fade_in_duration=1000,
+ alpha=0.9,
+ location=None)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|title|Text to be shown at the top of the window in a larger font :type title: (str)|
+|message|Text message that makes up the majority of the window :type message: (str)|
+|icon|A base64 encoded PNG/GIF image or PNG/GIF filename that will be displayed in the window :type icon: Union[bytes, str]|
+|display_duration_in_ms|Number of milliseconds to show the window :type display_duration_in_ms: (int)|
+|fade_in_duration|Number of milliseconds to fade window in and out :type fade_in_duration: (int)|
+|alpha|Alpha channel. 0 - invisible 1 - fully visible :type alpha: (float)|
+|location|Location on the screen to display the window :type location: Tuple[int, int]|
+|||
+| **return** | (int) reason for returning
:rtype: (int) |
+
+### read
+
+Reads the context menu
+
+```
+read(timeout=None)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|timeout|Optional. Any value other than None indicates a non-blocking read|
+
+### show_message
+
+Shows a balloon above icon in system tray
+
+```
+show_message(title,
+ message,
+ filename=None,
+ data=None,
+ data_base64=None,
+ messageicon=None,
+ time=(1000, 3000))
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|title|Title shown in balloon :type title:|
+|message|Message to be displayed :type message:|
+|filename|Optional icon filename :type filename:|
+|data|Optional in-ram icon :type data:|
+|data_base64|Optional base64 icon :type data_base64:|
+|time|Amount of time to display message in milliseconds. If tuple, first item is fade in/out duration :type time: Union[int, Tuple[int, int]]|
+|||
+| **return** | The event that happened during the display such as user clicked on message
:rtype: (Any) |
+
+### un_hide
+
+Restores a previously hidden icon
+
+```python
+un_hide()
+```
+
+### update
+
+Updates the menu, tooltip or icon
+
+```
+update(menu=None,
+ tooltip=None,
+ filename=None,
+ data=None,
+ data_base64=None)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|menu|menu defintion :type menu: ???|
+|tooltip|string representing tooltip :type tooltip: ???|
+|filename|icon filename :type filename: ???|
+|data|icon raw image :type data: ???|
+|data_base64|icon base 64 image :type data_base64: ???|
## Tab Element
@@ -11588,35 +12159,50 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|title|(str) text to show on the tab|
-|layout|List[List[Element]] The element layout that will be shown in the tab|
-|title_color|(str) color of the tab text (note not currently working on tkinter)|
-|background_color|(str) color of background of the entire layout|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|disabled|(bool) If True button will be created disabled|
-|border_width|(int) width of border around element in pixels|
-|key|(any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|right_click_menu|List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.|
-|visible|(bool) set visibility state of the element|
-|element_justification|(str) All elements inside the Tab will have this justification 'left', 'right', 'center' are valid values|
-|metadata|(Any) User metadata that can be set to ANYTHING|
+|title|text to show on the tab :type title: (str)|
+|layout|The element layout that will be shown in the tab :type layout: List[List[Element]]|
+|title_color|color of the tab text (note not currently working on tkinter) :type title_color: (str)|
+|background_color|color of background of the entire layout :type background_color: (str)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|disabled|If True button will be created disabled :type disabled: (bool)|
+|border_width|width of border around element in pixels :type border_width: (int)|
+|key|Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window :type key: (any)|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|right_click_menu|A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. :type right_click_menu: List[List[Union[List[str],str]]]|
+|visible|set visibility state of the element :type visible: (bool)|
+|element_justification|All elements inside the Tab will have this justification 'left', 'right', 'center' are valid values :type element_justification: (str)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
-### ButtonReboundCallback
+### AddRow
-*** DEPRICATED ***
-Use Element.bind instead
+Not recommended use call. Used to add rows of Elements to the Frame Element.
```
-ButtonReboundCallback(event)
+AddRow(args=*<1 or N object>)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
-|event|(unknown) Not used in this function.|
+|*args|The list of elements for this row :type *args: List[Element]|
+
+### Layout
+
+Not user callable. Use layout parameter instead. Creates the layout using the supplied rows of Elements
+
+```
+Layout(rows)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|rows|List[List[Element]] The list of rows|
+|||
+| **return** | (Tab) used for chaining |
### Select
@@ -11638,7 +12224,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -11652,7 +12238,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -11666,8 +12252,22 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|disabled|(bool) disable or enable state of the element|
-|visible|(bool) control visibility of element|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|visible|control visibility of element :type visible: (bool)|
+
+### add_row
+
+Not recommended use call. Used to add rows of Elements to the Frame Element.
+
+```
+add_row(args=*<1 or N object>)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|*args|The list of elements for this row :type *args: List[Element]|
### bind
@@ -11685,21 +12285,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -11726,7 +12311,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -11737,6 +12322,22 @@ Hide the entire row an Element is located on.
hide_row()
```
+### layout
+
+Not user callable. Use layout parameter instead. Creates the layout using the supplied rows of Elements
+
+```
+layout(rows)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|rows|List[List[Element]] The list of rows|
+|||
+| **return** | (Tab) used for chaining |
+
### select
Create a tkinter event that mimics user clicking on a tab. Must have called window.Finalize / Read first!
@@ -11745,6 +12346,20 @@ Create a tkinter event that mimics user clicking on a tab. Must have called wind
select()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -11757,7 +12372,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -11772,7 +12387,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -11786,7 +12401,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -11809,8 +12438,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|disabled|(bool) disable or enable state of the element|
-|visible|(bool) control visibility of element|
+|disabled|disable or enable state of the element :type disabled: (bool)|
+|visible|control visibility of element :type visible: (bool)|
## TabGroup Element
@@ -11840,38 +12469,23 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|layout|List[List[Tab]] Layout of Tabs. Different than normal layouts. ALL Tabs should be on first row|
-|tab_location|(str) location that tabs will be displayed. Choices are left, right, top, bottom, lefttop, leftbottom, righttop, rightbottom, bottomleft, bottomright, topleft, topright|
-|title_color|(str) color of text on tabs|
-|tab_background_color|(str) color of all tabs that are not selected|
-|selected_title_color|(str) color of tab text when it is selected|
-|selected_background_color|(str) color of tab when it is selected|
-|background_color|(str) color of background area that tabs are located on|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|change_submits|(bool) * DEPRICATED DO NOT USE! Same as enable_events|
-|enable_events|(bool) If True then switching tabs will generate an Event|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|border_width|(int) width of border around element in pixels|
-|theme|(enum) DEPRICATED - You can only specify themes using set options or when window is created. It's not possible to do it on an element basis|
-|key|(any) Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|layout|Layout of Tabs. Different than normal layouts. ALL Tabs should be on first row :type layout: List[List[Tab]]|
+|tab_location|location that tabs will be displayed. Choices are left, right, top, bottom, lefttop, leftbottom, righttop, rightbottom, bottomleft, bottomright, topleft, topright :type tab_location: (str)|
+|title_color|color of text on tabs :type title_color: (str)|
+|tab_background_color|color of all tabs that are not selected :type tab_background_color: (str)|
+|selected_title_color|color of tab text when it is selected :type selected_title_color: (str)|
+|selected_background_color|color of tab when it is selected :type selected_background_color: (str)|
+|background_color|color of background area that tabs are located on :type background_color: (str)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|change_submits|* DEPRICATED DO NOT USE! Same as enable_events :type change_submits: (bool)|
+|enable_events|If True then switching tabs will generate an Event :type enable_events: (bool)|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|border_width|width of border around element in pixels :type border_width: (int)|
+|theme|DEPRICATED - You can only specify themes using set options or when window is created. It's not possible to do it on an element basis :type theme: (enum)|
+|key|Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window :type key: (any)|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### FindKeyFromTabName
@@ -11885,9 +12499,9 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tab_name||
+|tab_name|name of a tab :type tab_name: str|
|||
-| **return** | Union[key, None] Returns the key or None if no key found |
+| **return** | Returns the key or None if no key found
:rtype: Union[key, None] |
### Get
@@ -11900,7 +12514,7 @@ are using this method correctly?
|Name|Meaning|
|---|---|
-| **return** | Union[Any, None] The key of the currently selected tab or the tab's text if it has no key |
+| **return** | The key of the currently selected tab or the tab's text if it has no key
:rtype: Union[Any, None] |
### SetFocus
@@ -11914,7 +12528,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -11928,7 +12542,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### bind
@@ -11946,21 +12560,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -11991,9 +12590,9 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tab_name||
+|tab_name|name of a tab :type tab_name: str|
|||
-| **return** | Union[key, None] Returns the key or None if no key found |
+| **return** | Returns the key or None if no key found
:rtype: Union[key, None] |
### get
@@ -12006,7 +12605,7 @@ are using this method correctly?
|Name|Meaning|
|---|---|
-| **return** | Union[Any, None] The key of the currently selected tab or the tab's text if it has no key |
+| **return** | The key of the currently selected tab or the tab's text if it has no key
:rtype: Union[Any, None] |
### get_size
@@ -12016,7 +12615,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -12027,21 +12626,19 @@ Hide the entire row an Element is located on.
hide_row()
```
-### layout
+### set_cursor
-Can use like the Window.Layout method, but it's better to use the layout parameter when creating
+Sets the cursor for the current Element.
```
-layout(rows)
+set_cursor(cursor)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
-|rows|List[List[Element]] The rows of Elements|
-|||
-| **return** | (Frame) Used for chaining |
+|cursor|(str) The tkinter cursor name|
### set_focus
@@ -12055,7 +12652,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -12070,7 +12667,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -12084,7 +12681,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -12136,53 +12747,38 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|values|List[List[Union[str, int, float]]]|
-|headings|List[str] The headings to show on the top line|
-|visible_column_map|List[bool] One entry for each column. False indicates the column is not shown|
-|col_widths|List[int] Number of characters that each column will occupy|
-|def_col_width|(int) Default column width in characters|
-|auto_size_columns|(bool) if True columns will be sized automatically|
-|max_col_width|(int) Maximum width for all columns in characters|
-|select_mode|(enum) Select Mode. Valid values start with "TABLE_SELECT_MODE_". Valid values are: TABLE_SELECT_MODE_NONE TABLE_SELECT_MODE_BROWSE TABLE_SELECT_MODE_EXTENDED|
-|display_row_numbers|(bool) if True, the first column of the table will be the row #|
-|num_rows|(int) The number of rows of the table to display at a time|
-|row_height|(int) height of a single row in pixels|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|justification|(str) 'left', 'right', 'center' are valid choices|
-|text_color|(str) color of the text|
-|background_color|(str) color of background|
-|alternating_row_color|(str) if set then every other row will have this color in the background.|
-|header_text_color|(str) sets the text color for the header|
-|header_background_color|(str) sets the background color for the header|
-|header_font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|row_colors|List[Union[Tuple[int, str], Tuple[Int, str, str]] list of tuples of (row, background color) OR (row, foreground color, background color). Sets the colors of listed rows to the color(s) provided (note the optional foreground color)|
-|vertical_scroll_only|(bool) if True only the vertical scrollbar will be visible|
-|hide_vertical_scroll|(bool) if True vertical scrollbar will be hidden|
-|size|Tuple[int, int] DO NOT USE! Use num_rows instead|
-|change_submits|(bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead|
-|enable_events|(bool) Turns on the element specific events. Table events happen when row is clicked|
-|bind_return_key|(bool) if True, pressing return key will cause event coming from Table, ALSO a left button double click will generate an event if this parameter is True|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|right_click_menu|List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|values|??? :type values: List[List[Union[str, int, float]]]|
+|headings|The headings to show on the top line :type headings: List[str]|
+|visible_column_map|One entry for each column. False indicates the column is not shown :type visible_column_map: List[bool]|
+|col_widths|Number of characters that each column will occupy :type col_widths: List[int]|
+|def_col_width|Default column width in characters :type def_col_width: (int)|
+|auto_size_columns|if True columns will be sized automatically :type auto_size_columns: (bool)|
+|max_col_width|Maximum width for all columns in characters :type max_col_width: (int)|
+|select_mode|Select Mode. Valid values start with "TABLE_SELECT_MODE_". Valid values are: TABLE_SELECT_MODE_NONE TABLE_SELECT_MODE_BROWSE TABLE_SELECT_MODE_EXTENDED :type select_mode: (enum)|
+|display_row_numbers|if True, the first column of the table will be the row # :type display_row_numbers: (bool)|
+|num_rows|The number of rows of the table to display at a time :type num_rows: (int)|
+|row_height|height of a single row in pixels :type row_height: (int)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|justification|'left', 'right', 'center' are valid choices :type justification: (str)|
+|text_color|color of the text :type text_color: (str)|
+|background_color|color of background :type background_color: (str)|
+|alternating_row_color|if set then every other row will have this color in the background. :type alternating_row_color: (str)|
+|header_text_color|sets the text color for the header :type header_text_color: (str)|
+|header_background_color|sets the background color for the header :type header_background_color: (str)|
+|header_font|specifies the font family, size, etc :type header_font: Union[str, Tuple[str, int]]|
+|row_colors|list of tuples of (row, background color) OR (row, foreground color, background color). Sets the colors of listed rows to the color(s) provided (note the optional foreground color) :type row_colors: List[Union[Tuple[int, str], Tuple[Int, str, str]]|
+|vertical_scroll_only|if True only the vertical scrollbar will be visible :type vertical_scroll_only: (bool)|
+|hide_vertical_scroll|if True vertical scrollbar will be hidden :type hide_vertical_scroll: (bool)|
+|size|DO NOT USE! Use num_rows instead :type size: Tuple[int, int]|
+|change_submits|DO NOT USE. Only listed for backwards compat - Use enable_events instead :type change_submits: (bool)|
+|enable_events|Turns on the element specific events. Table events happen when row is clicked :type enable_events: (bool)|
+|bind_return_key|if True, pressing return key will cause event coming from Table, ALSO a left button double click will generate an event if this parameter is True :type bind_return_key: (bool)|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|key|Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element :type key: (Any)|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|right_click_menu|A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. :type right_click_menu: List[List[Union[List[str],str]]]|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### Get
@@ -12194,7 +12790,7 @@ user when Table was created or Updated.
|Name|Meaning|
|---|---|
-| **return** | List[List[Any]] the current table values (for now what was originally provided up updated) |
+| **return** | the current table values (for now what was originally provided up updated)
:rtype: List[List[Any]] |
### SetFocus
@@ -12208,7 +12804,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -12222,7 +12818,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -12241,12 +12837,12 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|values|List[List[Union[str, int, float]]] A new 2-dimensional table to show|
-|num_rows|(int) How many rows to display at a time|
-|visible|(bool) if True then will be visible|
-|select_rows|List[int] List of rows to select as if user did|
-|alternating_row_color|(str) the color to make every other row|
-|row_colors|List[Union[Tuple[int, str], Tuple[Int, str, str]] list of tuples of (row, background color) OR (row, foreground color, background color). Changes the colors of listed rows to the color(s) provided (note the optional foreground color)|
+|values|A new 2-dimensional table to show :type values: List[List[Union[str, int, float]]]|
+|num_rows|How many rows to display at a time :type num_rows: (int)|
+|visible|if True then will be visible :type visible: (bool)|
+|select_rows|List of rows to select as if user did :type select_rows: List[int]|
+|alternating_row_color|the color to make every other row :type alternating_row_color: (str)|
+|row_colors|list of tuples of (row, background color) OR (row, foreground color, background color). Changes the colors of listed rows to the color(s) provided (note the optional foreground color) :type row_colors: List[Union[Tuple[int, str], Tuple[Int, str, str]]|
### bind
@@ -12264,21 +12860,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -12307,7 +12888,7 @@ user when Table was created or Updated.
|Name|Meaning|
|---|---|
-| **return** | List[List[Any]] the current table values (for now what was originally provided up updated) |
+| **return** | the current table values (for now what was originally provided up updated)
:rtype: List[List[Any]] |
### get_size
@@ -12317,7 +12898,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -12328,6 +12909,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -12340,7 +12935,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -12355,7 +12950,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -12369,7 +12964,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -12397,12 +13006,12 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|values|List[List[Union[str, int, float]]] A new 2-dimensional table to show|
-|num_rows|(int) How many rows to display at a time|
-|visible|(bool) if True then will be visible|
-|select_rows|List[int] List of rows to select as if user did|
-|alternating_row_color|(str) the color to make every other row|
-|row_colors|List[Union[Tuple[int, str], Tuple[Int, str, str]] list of tuples of (row, background color) OR (row, foreground color, background color). Changes the colors of listed rows to the color(s) provided (note the optional foreground color)|
+|values|A new 2-dimensional table to show :type values: List[List[Union[str, int, float]]]|
+|num_rows|How many rows to display at a time :type num_rows: (int)|
+|visible|if True then will be visible :type visible: (bool)|
+|select_rows|List of rows to select as if user did :type select_rows: List[int]|
+|alternating_row_color|the color to make every other row :type alternating_row_color: (str)|
+|row_colors|list of tuples of (row, background color) OR (row, foreground color, background color). Changes the colors of listed rows to the color(s) provided (note the optional foreground color) :type row_colors: List[Union[Tuple[int, str], Tuple[Int, str, str]]|
## Text Element
@@ -12432,38 +13041,23 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|text|(str) The text to display. Can include /n to achieve multiple lines|
-|size|Tuple[int, int] (width, height) width = characters-wide, height = rows-high|
-|auto_size_text|(bool) if True size of the Text Element will be sized to fit the string provided in 'text' parm|
-|click_submits|(bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead|
-|enable_events|(bool) Turns on the element specific events. Text events happen when the text is clicked|
-|relief|(str/enum) relief style around the text. Values are same as progress meter relief values. Should be a constant that is defined at starting with "RELIEF_" - `RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID`|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|text_color|(str) color of the text|
-|background_color|(str) color of background|
-|border_width|(int) number of pixels for the border (if using a relief)|
-|justification|(str) how string should be aligned within space provided by size. Valid choices = `left`, `right`, `center`|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element|
-|right_click_menu|List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|text|The text to display. Can include /n to achieve multiple lines :type text: (str)|
+|size|(width, height) width = characters-wide, height = rows-high :type size: Tuple[int, int]|
+|auto_size_text|if True size of the Text Element will be sized to fit the string provided in 'text' parm :type auto_size_text: (bool)|
+|click_submits|DO NOT USE. Only listed for backwards compat - Use enable_events instead :type click_submits: (bool)|
+|enable_events|Turns on the element specific events. Text events happen when the text is clicked :type enable_events: (bool)|
+|relief|relief style around the text. Values are same as progress meter relief values. Should be a constant that is defined at starting with "RELIEF_" - `RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID` :type relief: (str/enum)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|text_color|color of the text :type text_color: (str)|
+|background_color|color of background :type background_color: (str)|
+|border_width|number of pixels for the border (if using a relief) :type border_width: (int)|
+|justification|how string should be aligned within space provided by size. Valid choices = `left`, `right`, `center` :type justification: (str)|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|key|Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element :type key: (Any)|
+|right_click_menu|A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. :type right_click_menu: List[List[Union[List[str],str]]]|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### SetFocus
@@ -12477,7 +13071,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -12491,7 +13085,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -12509,11 +13103,11 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(str) new text to show|
-|background_color|(str) color of background|
-|text_color|(str) color of the text|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|visible|(bool) set visibility state of the element|
+|value|new text to show :type value: (str)|
+|background_color|color of background :type background_color: (str)|
+|text_color|color of the text :type text_color: (str)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|visible|set visibility state of the element :type visible: (bool)|
### bind
@@ -12531,21 +13125,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -12572,7 +13151,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -12583,6 +13162,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -12595,7 +13188,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -12610,7 +13203,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -12624,7 +13217,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -12651,91 +13258,11 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|value|(str) new text to show|
-|background_color|(str) color of background|
-|text_color|(str) color of the text|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|visible|(bool) set visibility state of the element|
-
-## ToolTip Element
-
- Create a tooltip for a given widget
- (inspired by https://stackoverflow.com/a/36221216)
- This is an INTERNALLY USED only class. Users should not refer to this class at all.
-
-```
-ToolTip(widget,
- text,
- timeout=400)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|widget|(widget type varies) The tkinter widget|
-|text|(str) text for the tooltip. It can inslude|
-|timeout|(int) Time in milliseconds that mouse must remain still before tip is shown|
-
-### enter
-
-Called by tkinter when mouse enters a widget
-
-```
-enter(event=None)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|from tkinter. Has x,y coordinates of mouse|
-
-### hidetip
-
-Destroy the tooltip window
-
-```python
-hidetip()
-```
-
-### leave
-
-Called by tktiner when mouse exits a widget
-
-```
-leave(event=None)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|from tkinter. Event info that's not used by function.|
-
-### schedule
-
-Schedule a timer to time how long mouse is hovering
-
-```python
-schedule()
-```
-
-### showtip
-
-Creates a topoltip window with the tooltip text inside of it
-
-```python
-showtip()
-```
-
-### unschedule
-
-Cancel timer used to time mouse hover
-
-```python
-unschedule()
-```
+|value|new text to show :type value: (str)|
+|background_color|color of background :type background_color: (str)|
+|text_color|color of the text :type text_color: (str)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|visible|set visibility state of the element :type visible: (bool)|
## Tree Element
@@ -12776,48 +13303,33 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|data|(TreeData) The data represented using a PySimpleGUI provided TreeData class|
-|headings|List[str] List of individual headings for each column|
-|visible_column_map|List[bool] Determines if a column should be visible. If left empty, all columns will be shown|
-|col_widths|List[int] List of column widths so that individual column widths can be controlled|
-|col0_width|(int) Size of Column 0 which is where the row numbers will be optionally shown|
-|def_col_width|(int) default column width|
-|auto_size_columns|(bool) if True, the size of a column is determined using the contents of the column|
-|max_col_width|(int) the maximum size a column can be|
-|select_mode|(enum) Use same values as found on Table Element. Valid values include: TABLE_SELECT_MODE_NONE TABLE_SELECT_MODE_BROWSE TABLE_SELECT_MODE_EXTENDED|
-|show_expanded|(bool) if True then the tree will be initially shown with all nodes completely expanded|
-|change_submits|(bool) DO NOT USE. Only listed for backwards compat - Use enable_events instead|
-|enable_events|(bool) Turns on the element specific events. Tree events happen when row is clicked|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|justification|(str) 'left', 'right', 'center' are valid choices|
-|text_color|(str) color of the text|
-|background_color|(str) color of background|
-|header_text_color|(str) sets the text color for the header|
-|header_background_color|(str) sets the background color for the header|
-|header_font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|num_rows|(int) The number of rows of the table to display at a time|
-|row_height|(int) height of a single row in pixels|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element|
-|tooltip|(str) text, that will appear when mouse hovers over the element|
-|right_click_menu|List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.|
-|visible|(bool) set visibility state of the element|
-|metadata|(Any) User metadata that can be set to ANYTHING|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|data|The data represented using a PySimpleGUI provided TreeData class :type data: (TreeData)|
+|headings|List of individual headings for each column :type headings: List[str]|
+|visible_column_map|Determines if a column should be visible. If left empty, all columns will be shown :type visible_column_map: List[bool]|
+|col_widths|List of column widths so that individual column widths can be controlled :type col_widths: List[int]|
+|col0_width|Size of Column 0 which is where the row numbers will be optionally shown :type col0_width: (int)|
+|def_col_width|default column width :type def_col_width: (int)|
+|auto_size_columns|if True, the size of a column is determined using the contents of the column :type auto_size_columns: (bool)|
+|max_col_width|the maximum size a column can be :type max_col_width: (int)|
+|select_mode|Use same values as found on Table Element. Valid values include: TABLE_SELECT_MODE_NONE TABLE_SELECT_MODE_BROWSE TABLE_SELECT_MODE_EXTENDED :type select_mode: (enum)|
+|show_expanded|if True then the tree will be initially shown with all nodes completely expanded :type show_expanded: (bool)|
+|change_submits|DO NOT USE. Only listed for backwards compat - Use enable_events instead :type change_submits: (bool)|
+|enable_events|Turns on the element specific events. Tree events happen when row is clicked :type enable_events: (bool)|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|justification|'left', 'right', 'center' are valid choices :type justification: (str)|
+|text_color|color of the text :type text_color: (str)|
+|background_color|color of background :type background_color: (str)|
+|header_text_color|sets the text color for the header :type header_text_color: (str)|
+|header_background_color|sets the background color for the header :type header_background_color: (str)|
+|header_font|specifies the font family, size, etc :type header_font: Union[str, Tuple[str, int]]|
+|num_rows|The number of rows of the table to display at a time :type num_rows: (int)|
+|row_height|height of a single row in pixels :type row_height: (int)|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
+|key|Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element :type key: (Any)|
+|tooltip|text, that will appear when mouse hovers over the element :type tooltip: (str)|
+|right_click_menu|[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. :type right_click_menu: List[List|
+|visible|set visibility state of the element :type visible: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### SetFocus
@@ -12831,7 +13343,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -12845,7 +13357,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### Update
@@ -12864,12 +13376,12 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|values|(TreeData) Representation of the tree|
-|key|(Any) identifies a particular item in tree to update|
-|value|(Any) sets the node identified by key to a particular value|
-|text|(str) sets the node identified by ket to this string|
-|icon|Union[bytes, str] can be either a base64 icon or a filename for the icon|
-|visible|(bool) control visibility of element|
+|values|Representation of the tree :type values: (TreeData)|
+|key|identifies a particular item in tree to update :type key: (Any)|
+|value|sets the node identified by key to a particular value :type value: (Any)|
+|text|sets the node identified by ket to this string :type text: (str)|
+|icon|can be either a base64 icon or a filename for the icon :type icon: Union[bytes, str]|
+|visible|control visibility of element :type visible: (bool)|
### add_treeview_data
@@ -12883,7 +13395,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|node|(TreeData) The node to insert. Will insert all nodes from starting point downward, recursively|
+|node|The node to insert. Will insert all nodes from starting point downward, recursively :type node: (TreeData)|
### bind
@@ -12901,21 +13413,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -12942,7 +13439,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -12953,6 +13450,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -12965,7 +13476,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -12980,7 +13491,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -12994,22 +13505,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
-### treeview_selected
+### unbind
-Not a user function. Callback function that happens when an item is selected from the tree. In this
-method, it saves away the reported selections so they can be properly returned.
+Removes a previously bound tkinter event from an Element.
```
-treeview_selected(event)
+unbind(bind_string)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
-|event|(Any) An event parameter passed in by tkinter. Not used|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -13037,12 +13547,12 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|values|(TreeData) Representation of the tree|
-|key|(Any) identifies a particular item in tree to update|
-|value|(Any) sets the node identified by key to a particular value|
-|text|(str) sets the node identified by ket to this string|
-|icon|Union[bytes, str] can be either a base64 icon or a filename for the icon|
-|visible|(bool) control visibility of element|
+|values|Representation of the tree :type values: (TreeData)|
+|key|identifies a particular item in tree to update :type key: (Any)|
+|value|sets the node identified by key to a particular value :type value: (Any)|
+|text|sets the node identified by ket to this string :type text: (str)|
+|icon|can be either a base64 icon or a filename for the icon :type icon: Union[bytes, str]|
+|visible|control visibility of element :type visible: (bool)|
## TreeData Element
@@ -13073,11 +13583,11 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|parent|(Node) the parent Node|
-|key|(Any) Used to uniquely identify this node|
-|text|(str) The text that is displayed at this node's location|
-|values|List[Any] The list of values that are displayed at this node|
-|icon|Union[str, bytes]|
+|parent|the parent Node :type parent: (Node)|
+|key|Used to uniquely identify this node :type key: (Any)|
+|text|The text that is displayed at this node's location :type text: (str)|
+|values|The list of values that are displayed at this node :type values: List[Any]|
+|icon|icon :type icon: Union[str, bytes]|
### Node
@@ -13108,11 +13618,11 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|parent|(Node) the parent Node|
-|key|(Any) Used to uniquely identify this node|
-|text|(str) The text that is displayed at this node's location|
-|values|List[Any] The list of values that are displayed at this node|
-|icon|Union[str, bytes]|
+|parent|the parent Node :type parent: (Node)|
+|key|Used to uniquely identify this node :type key: (Any)|
+|text|The text that is displayed at this node's location :type text: (str)|
+|values|The list of values that are displayed at this node :type values: List[Any]|
+|icon|icon :type icon: Union[str, bytes]|
## VerticalSeparator Element
@@ -13127,22 +13637,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|pad|(int, int) or ((int, int),(int,int)) Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom))|
-
-### ButtonReboundCallback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-ButtonReboundCallback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
+|pad|Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) :type pad: (int, int) or ((int, int),(int,int))|
### SetFocus
@@ -13156,7 +13651,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### SetTooltip
@@ -13170,7 +13665,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
### bind
@@ -13188,21 +13683,6 @@ Parameter Descriptions:
|bind_string|The string tkinter expected in its bind function|
|key_modifier|Additional data to be added to the element's key when event is returned|
-### button_rebound_callback
-
-*** DEPRICATED ***
-Use Element.bind instead
-
-```
-button_rebound_callback(event)
-```
-
-Parameter Descriptions:
-
-|Name|Meaning|
-|---|---|
-|event|(unknown) Not used in this function.|
-
### expand
Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@@ -13229,7 +13709,7 @@ Return the size of an element in Pixels. Care must be taken as some elements us
|Name|Meaning|
|---|---|
-| **return** | Tuple[int, int] - Width, Height of the element |
+| **return** | width and height of the element
:rtype: Tuple[int, int] |
### hide_row
@@ -13240,6 +13720,20 @@ Hide the entire row an Element is located on.
hide_row()
```
+### set_cursor
+
+Sets the cursor for the current Element.
+
+```
+set_cursor(cursor)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|cursor|(str) The tkinter cursor name|
+
### set_focus
Sets the current focus to be on this element
@@ -13252,7 +13746,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|force|(bool) if True will call focus_force otherwise calls focus_set|
+|force|if True will call focus_force otherwise calls focus_set :type force: bool|
### set_size
@@ -13267,7 +13761,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|size|Tuple[int, int] The size in characters, rows typically. In some cases they are pixels|
+|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]|
### set_tooltip
@@ -13281,7 +13775,21 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|tooltip_text|(str) the text to show in tooltip.|
+|tooltip_text|the text to show in tooltip. :type tooltip_text: str|
+
+### unbind
+
+Removes a previously bound tkinter event from an Element.
+
+```
+unbind(bind_string)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|bind_string|The string tkinter expected in its bind function|
### unhide_row
@@ -13292,7 +13800,7 @@ Unhides (makes visible again) the row container that the Element is located on.
unhide_row()
```
-## Window Element
+## Window
Represents a single Window
@@ -13340,43 +13848,43 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|title|(str) The title that will be displayed in the Titlebar and on the Taskbar|
-|layout|List[List[Elements]] The layout for the window. Can also be specified in the Layout method|
-|default_element_size|Tuple[int, int] (width, height) size in characters (wide) and rows (high) for all elements in this window|
-|default_button_element_size|Tuple[int, int] (width, height) size in characters (wide) and rows (high) for all Button elements in this window|
-|auto_size_text|(bool) True if Elements in Window should be sized to exactly fir the length of text|
-|auto_size_buttons|(bool) True if Buttons in this Window should be sized to exactly fit the text on this.|
-|location|Tuple[int, int] (x,y) location, in pixels, to locate the upper left corner of the window on the screen. Default is to center on screen.|
-|size|Tuple[int, int] (width, height) size in pixels for this window. Normally the window is autosized to fit contents, not set to an absolute size by the user|
-|element_padding|Tuple[int, int] or ((int, int),(int,int)) Default amount of padding to put around elements in window (left/right, top/bottom) or ((left, right), (top, bottom))|
-|margins|Tuple[int, int] (left/right, top/bottom) Amount of pixels to leave inside the window's frame around the edges before your elements are shown.|
-|button_color|Tuple[str, str] (text color, button color) Default button colors for all buttons in the window|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|progress_bar_color|Tuple[str, str] (bar color, background color) Sets the default colors for all progress bars in the window|
-|background_color|(str) color of background|
-|border_depth|(int) Default border depth (width) for all elements in the window|
-|auto_close|(bool) If True, the window will automatically close itself|
-|auto_close_duration|(int) Number of seconds to wait before closing the window|
-|icon|Union[str, str] Can be either a filename or Base64 value.|
-|force_toplevel|(bool) If True will cause this window to skip the normal use of a hidden master window|
-|alpha_channel|(float) Sets the opacity of the window. 0 = invisible 1 = completely visible. Values bewteen 0 & 1 will produce semi-transparent windows in SOME environments (The Raspberry Pi always has this value at 1 and cannot change.|
-|return_keyboard_events|(bool) if True key presses on the keyboard will be returned as Events from Read calls|
-|use_default_focus|(bool) If True will use the default focus algorithm to set the focus to the "Correct" element|
-|text_justification|(str) Union ['left', 'right', 'center'] Default text justification for all Text Elements in window|
-|no_titlebar|(bool) If true, no titlebar nor frame will be shown on window. This means you cannot minimize the window and it will not show up on the taskbar|
-|grab_anywhere|(bool) If True can use mouse to click and drag to move the window. Almost every location of the window will work except input fields on some systems|
-|keep_on_top|(bool) If True, window will be created on top of all other windows on screen. It can be bumped down if another window created with this parm|
-|resizable|(bool) If True, allows the user to resize the window. Note the not all Elements will change size or location when resizing.|
-|disable_close|(bool) If True, the X button in the top right corner of the window will no work. Use with caution and always give a way out toyour users|
-|disable_minimize|(bool) if True the user won't be able to minimize window. Good for taking over entire screen and staying that way.|
-|right_click_menu|List[List[Union[List[str],str]]] A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.|
-|transparent_color|(str) Any portion of the window that has this color will be completely transparent. You can even click through these spots to the window under this window.|
-|debugger_enabled|(bool) If True then the internal debugger will be enabled|
-|finalize|(bool) If True then the Finalize method will be called. Use this rather than chaining .Finalize for cleaner code|
-|element_justification|(str) All elements in the Window itself will have this justification 'left', 'right', 'center' are valid values|
-|ttk_theme|(str) Set the tkinter ttk "theme" of the window. Default = DEFAULT_TTK_THEME. Sets all ttk widgets to this theme as their default|
-|use_ttk_buttons|(bool) Affects all buttons in window. True = use ttk buttons. False = do not use ttk buttons. None = use ttk buttons only if on a Mac|
-|metadata|(Any) User metadata that can be set to ANYTHING|
+|title|The title that will be displayed in the Titlebar and on the Taskbar :type title: (str)|
+|layout|The layout for the window. Can also be specified in the Layout method :type layout: List[List[Elements]]|
+|default_element_size|(width, height) size in characters (wide) and rows (high) for all elements in this window :type default_element_size: Tuple[int, int]|
+|default_button_element_size|(width, height) size in characters (wide) and rows (high) for all Button elements in this window :type default_button_element_size: Tuple[int, int]|
+|auto_size_text|True if Elements in Window should be sized to exactly fir the length of text :type auto_size_text: (bool)|
+|auto_size_buttons|True if Buttons in this Window should be sized to exactly fit the text on this. :type auto_size_buttons: (bool)|
+|location|(x,y) location, in pixels, to locate the upper left corner of the window on the screen. Default is to center on screen. :type location: Tuple[int, int]|
+|size|(width, height) size in pixels for this window. Normally the window is autosized to fit contents, not set to an absolute size by the user :type size: Tuple[int, int]|
+|element_padding|Default amount of padding to put around elements in window (left/right, top/bottom) or ((left, right), (top, bottom)) :type element_padding: Tuple[int, int] or ((int, int),(int,int))|
+|margins|(left/right, top/bottom) Amount of pixels to leave inside the window's frame around the edges before your elements are shown. :type margins: Tuple[int, int]|
+|button_color|(text color, button color) Default button colors for all buttons in the window :type button_color: Tuple[str, str]|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|progress_bar_color|(bar color, background color) Sets the default colors for all progress bars in the window :type progress_bar_color: Tuple[str, str]|
+|background_color|color of background :type background_color: (str)|
+|border_depth|Default border depth (width) for all elements in the window :type border_depth: (int)|
+|auto_close|If True, the window will automatically close itself :type auto_close: (bool)|
+|auto_close_duration|Number of seconds to wait before closing the window :type auto_close_duration: (int)|
+|icon|Can be either a filename or Base64 value. For Windows if filename, it MUST be ICO format. For Linux, must NOT be ICO :type icon: Union[str, str]|
+|force_toplevel|If True will cause this window to skip the normal use of a hidden master window :type force_toplevel: (bool)|
+|alpha_channel|Sets the opacity of the window. 0 = invisible 1 = completely visible. Values bewteen 0 & 1 will produce semi-transparent windows in SOME environments (The Raspberry Pi always has this value at 1 and cannot change. :type alpha_channel: (float)|
+|return_keyboard_events|if True key presses on the keyboard will be returned as Events from Read calls :type return_keyboard_events: (bool)|
+|use_default_focus|If True will use the default focus algorithm to set the focus to the "Correct" element :type use_default_focus: (bool)|
+|text_justification|Union ['left', 'right', 'center'] Default text justification for all Text Elements in window :type text_justification: (str)|
+|no_titlebar|If true, no titlebar nor frame will be shown on window. This means you cannot minimize the window and it will not show up on the taskbar :type no_titlebar: (bool)|
+|grab_anywhere|If True can use mouse to click and drag to move the window. Almost every location of the window will work except input fields on some systems :type grab_anywhere: (bool)|
+|keep_on_top|If True, window will be created on top of all other windows on screen. It can be bumped down if another window created with this parm :type keep_on_top: (bool)|
+|resizable|If True, allows the user to resize the window. Note the not all Elements will change size or location when resizing. :type resizable: (bool)|
+|disable_close|If True, the X button in the top right corner of the window will no work. Use with caution and always give a way out toyour users :type disable_close: (bool)|
+|disable_minimize|if True the user won't be able to minimize window. Good for taking over entire screen and staying that way. :type disable_minimize: (bool)|
+|right_click_menu|A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. :type right_click_menu: List[List[Union[List[str],str]]]|
+|transparent_color|Any portion of the window that has this color will be completely transparent. You can even click through these spots to the window under this window. :type transparent_color: (str)|
+|debugger_enabled|If True then the internal debugger will be enabled :type debugger_enabled: (bool)|
+|finalize|If True then the Finalize method will be called. Use this rather than chaining .Finalize for cleaner code :type finalize: (bool)|
+|element_justification|All elements in the Window itself will have this justification 'left', 'right', 'center' are valid values :type element_justification: (str)|
+|ttk_theme|Set the tkinter ttk "theme" of the window. Default = DEFAULT_TTK_THEME. Sets all ttk widgets to this theme as their default :type ttk_theme: (str)|
+|use_ttk_buttons|Affects all buttons in window. True = use ttk buttons. False = do not use ttk buttons. None = use ttk buttons only if on a Mac :type use_ttk_buttons: (bool)|
+|metadata|User metadata that can be set to ANYTHING :type metadata: Any|
### AddRow
@@ -13385,7 +13893,7 @@ Generally speaking this is NOT how users should be building Window layouts.
Users, create a single layout (a list of lists) and pass as a parameter to Window object, or call Window.Layout(layout)
```
-AddRow(args)
+AddRow(args=*<1 or N object>)
```
Parameter Descriptions:
@@ -13446,7 +13954,7 @@ Get the current location of the window's top left corner
|Name|Meaning|
|---|---|
-| **return** | Tuple[(int), (int)] The x and y location in tuple form (x,y) |
+| **return** | The x and y location in tuple form (x,y)
:rtype: Tuple[(int), (int)] |
### Disable
@@ -13503,10 +14011,10 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element|
-|silent_on_error|(bool) If True do not display popup nor print warning of key errors|
+|key|Used with window.FindElement and with return values to uniquely identify this element :type key: (Any)|
+|silent_on_error|If True do not display popup nor print warning of key errors :type silent_on_error: (bool)|
|||
-| **return** | Union[Element, Error Element, None] Return value can be:
* the Element that matches the supplied key if found
* an Error Element if silent_on_error is False
* None if silent_on_error True |
+| **return** | Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
:rtype: Union[Element, Error Element, None] |
### Element
@@ -13537,10 +14045,10 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element|
-|silent_on_error|(bool) If True do not display popup nor print warning of key errors|
+|key|Used with window.FindElement and with return values to uniquely identify this element :type key: (Any)|
+|silent_on_error|If True do not display popup nor print warning of key errors :type silent_on_error: (bool)|
|||
-| **return** | Union[Element, Error Element, None] Return value can be:
* the Element that matches the supplied key if found
* an Error Element if silent_on_error is False
* None if silent_on_error True |
+| **return** | Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
:rtype: Union[Element, Error Element, None] |
### Enable
@@ -13570,9 +14078,9 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|values_dict|(Dict[Any:Any]) {Element key : value} pairs|
+|values_dict|{Element key : value} pairs :type values_dict: (Dict[Any:Any])|
|||
-| **return** | (Window) returns self so can be chained with other methods |
+| **return** | returns self so can be chained with other methods
:rtype: (Window) |
### Finalize
@@ -13584,7 +14092,7 @@ Lots of action!
|Name|Meaning|
|---|---|
-| **return** | (Window) Returns 'self' so that method "Chaining" can happen (read up about it as it's very cool!) |
+| **return** | Returns 'self' so that method "Chaining" can happen (read up about it as it's very cool!)
:rtype: (Window) |
### Find
@@ -13615,10 +14123,10 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element|
-|silent_on_error|(bool) If True do not display popup nor print warning of key errors|
+|key|Used with window.FindElement and with return values to uniquely identify this element :type key: (Any)|
+|silent_on_error|If True do not display popup nor print warning of key errors :type silent_on_error: (bool)|
|||
-| **return** | Union[Element, Error Element, None] Return value can be:
* the Element that matches the supplied key if found
* an Error Element if silent_on_error is False
* None if silent_on_error True |
+| **return** | Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
:rtype: Union[Element, Error Element, None] |
### FindElement
@@ -13649,10 +14157,10 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element|
-|silent_on_error|(bool) If True do not display popup nor print warning of key errors|
+|key|Used with window.FindElement and with return values to uniquely identify this element :type key: (Any)|
+|silent_on_error|If True do not display popup nor print warning of key errors :type silent_on_error: (bool)|
|||
-| **return** | Union[Element, Error Element, None] Return value can be:
* the Element that matches the supplied key if found
* an Error Element if silent_on_error is False
* None if silent_on_error True |
+| **return** | Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
:rtype: Union[Element, Error Element, None] |
### FindElementWithFocus
@@ -13662,7 +14170,7 @@ Returns the Element that currently has focus as reported by tkinter. If no eleme
|Name|Meaning|
|---|---|
-| **return** | Union[Element, None] An Element if one has been found with focus or None if no element found |
+| **return** | An Element if one has been found with focus or None if no element found
:rtype: Union[Element, None] |
### GetScreenDimensions
@@ -13672,7 +14180,7 @@ Get the screen dimensions. NOTE - you must have a window already open for this
|Name|Meaning|
|---|---|
-| **return** | Union[Tuple[None, None], Tuple[width, height]] Tuple containing width and height of screen in pixels |
+| **return** | Tuple containing width and height of screen in pixels
:rtype: Union[Tuple[None, None], Tuple[width, height]] |
### GrabAnyWhereOff
@@ -13715,9 +14223,9 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|rows|List[List[Elements]] Your entire layout|
+|rows|Your entire layout :type rows: List[List[Elements]]|
|||
-| **return** | (Window} self so that you can chain method calls |
+| **return** | self so that you can chain method calls
:rtype: (Window) |
### LoadFromDisk
@@ -13731,7 +14239,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|filename|(str) Pickle Filename to load|
+|filename|Pickle Filename to load :type filename: (str)|
### Maximize
@@ -13763,8 +14271,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|x|(int) x coordinate in pixels|
-|y|(int) y coordinate in pixels|
+|x|x coordinate in pixels :type x: (int)|
+|y|y coordinate in pixels :type y: (int)|
### Normal
@@ -13781,17 +14289,20 @@ Pass in a timeout (in milliseconds) to wait for a maximum of timeout millisecond
if no other GUI events happen first.
```
-Read(timeout=None, timeout_key="__TIMEOUT__")
+Read(timeout=None,
+ timeout_key="__TIMEOUT__",
+ close=False)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
-|timeout|(int) Milliseconds to wait until the Read will return IF no other GUI events happen first|
-|timeout_key|(Any) The value that will be returned from the call if the timer expired|
+|timeout|Milliseconds to wait until the Read will return IF no other GUI events happen first :type timeout: (int)|
+|timeout_key|The value that will be returned from the call if the timer expired :type timeout_key: (Any)|
+|close|if True the window will be closed prior to returning :type close: (bool)|
|||
-| **return** | Tuple[(Any), Union[Dict[Any:Any]], List[Any], None] (event, values)
(event or timeout_key or None, Dictionary of values or List of values from all elements in the Window) |
+| **return** | (event, values)
:rtype: Tuple[(Any), Union[Dict[Any:Any]], List[Any], None] |
### Reappear
@@ -13811,7 +14322,7 @@ Without this call your changes to a Window will not be visible to the user until
|Name|Meaning|
|---|---|
-| **return** | (Window) `self` so that method calls can be easily "chained" |
+| **return** | `self` so that method calls can be easily "chained"
:rtype: (Window) |
### SaveToDisk
@@ -13826,7 +14337,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|filename|(str) Filename to save the values to in pickled form|
+|filename|Filename to save the values to in pickled form :type filename: (str)|
### SendToBack
@@ -13848,14 +14359,16 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|alpha|(float) 0 to 1. 0 is completely transparent. 1 is completely visible and solid (can't see through)|
+|alpha|0 to 1. 0 is completely transparent. 1 is completely visible and solid (can't see through) :type alpha: (float)|
### SetIcon
-Sets the icon that is shown on the title bar and on the task bar. Can pass in:
-* a filename which must be a .ICO icon file for windows
-* a bytes object
-* a BASE64 encoded file held in a variable
+Changes the icon that is shown on the title bar and on the task bar.
+NOTE - The file type is IMPORTANT and depends on the OS!
+Can pass in:
+* filename which must be a .ICO icon file for windows, PNG file for Linux
+* bytes object
+* BASE64 encoded file held in a variable
```
SetIcon(icon=None, pngbase64=None)
@@ -13865,8 +14378,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|icon|(str) Filename or bytes object|
-|pngbase64|(str) Base64 encoded GIF or PNG file|
+|icon|Filename or bytes object :type icon: (str)|
+|pngbase64|Base64 encoded image :type pngbase64: (str)|
### SetTransparentColor
@@ -13880,7 +14393,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|color|(str) Color string that defines the transparent color|
+|color|Color string that defines the transparent color :type color: (str)|
### Size
@@ -13890,7 +14403,7 @@ Return the current size of the window in pixels
|Name|Meaning|
|---|---|
-| **return** | Tuple[(int), (int)] the (width, height) of the window |
+| **return** | (width, height) of the window
:rtype: Tuple[(int), (int)] |
### UnHide
@@ -13918,7 +14431,7 @@ Generally speaking this is NOT how users should be building Window layouts.
Users, create a single layout (a list of lists) and pass as a parameter to Window object, or call Window.Layout(layout)
```
-add_row(args)
+add_row(args=*<1 or N object>)
```
Parameter Descriptions:
@@ -13966,8 +14479,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|bind_string|The string tkinter expected in its bind function|
-|key|The event that will be generated when the tkinter event occurs|
+|bind_string|The string tkinter expected in its bind function :type bind_string: (str)|
+|key|The event that will be generated when the tkinter event occurs :type key: Any|
### bring_to_front
@@ -13995,7 +14508,7 @@ Get the current location of the window's top left corner
|Name|Meaning|
|---|---|
-| **return** | Tuple[(int), (int)] The x and y location in tuple form (x,y) |
+| **return** | The x and y location in tuple form (x,y)
:rtype: Tuple[(int), (int)] |
### disable
@@ -14052,10 +14565,10 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element|
-|silent_on_error|(bool) If True do not display popup nor print warning of key errors|
+|key|Used with window.FindElement and with return values to uniquely identify this element :type key: (Any)|
+|silent_on_error|If True do not display popup nor print warning of key errors :type silent_on_error: (bool)|
|||
-| **return** | Union[Element, Error Element, None] Return value can be:
* the Element that matches the supplied key if found
* an Error Element if silent_on_error is False
* None if silent_on_error True |
+| **return** | Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
:rtype: Union[Element, Error Element, None] |
### element
@@ -14086,10 +14599,20 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element|
-|silent_on_error|(bool) If True do not display popup nor print warning of key errors|
+|key|Used with window.FindElement and with return values to uniquely identify this element :type key: (Any)|
+|silent_on_error|If True do not display popup nor print warning of key errors :type silent_on_error: (bool)|
|||
-| **return** | Union[Element, Error Element, None] Return value can be:
* the Element that matches the supplied key if found
* an Error Element if silent_on_error is False
* None if silent_on_error True |
+| **return** | Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
:rtype: Union[Element, Error Element, None] |
+
+### element_list
+
+Returns a list of all elements in the window
+
+`element_list()`
+
+|Name|Meaning|
+|---|---|
+| **return** | List of all elements in the window and container elements in the window
:rtype: List[Element] |
### enable
@@ -14107,6 +14630,23 @@ Enables the internal debugger. By default, the debugger IS enabled
enable_debugger()
```
+### extend_layout
+
+Adds new rows to an existing container element inside of this window
+
+```
+extend_layout(container, rows)
+```
+
+Parameter Descriptions:
+
+|Name|Meaning|
+|---|---|
+|container|(Union[Frame, Column, Tab]) - The container Element the layout will be placed inside of :type container: (Union[Frame, Column, Tab])|
+|rows|(List[List[Element]]) - The layout to be added :type rows: (List[List[Element]])|
+|||
+| **return** | (Window) self so could be chained
:rtype: (Window) |
+
### fill
Fill in elements that are input fields with data based on a 'values dictionary'
@@ -14119,9 +14659,9 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|values_dict|(Dict[Any:Any]) {Element key : value} pairs|
+|values_dict|{Element key : value} pairs :type values_dict: (Dict[Any:Any])|
|||
-| **return** | (Window) returns self so can be chained with other methods |
+| **return** | returns self so can be chained with other methods
:rtype: (Window) |
### finalize
@@ -14133,7 +14673,7 @@ Lots of action!
|Name|Meaning|
|---|---|
-| **return** | (Window) Returns 'self' so that method "Chaining" can happen (read up about it as it's very cool!) |
+| **return** | Returns 'self' so that method "Chaining" can happen (read up about it as it's very cool!)
:rtype: (Window) |
### find
@@ -14164,10 +14704,10 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element|
-|silent_on_error|(bool) If True do not display popup nor print warning of key errors|
+|key|Used with window.FindElement and with return values to uniquely identify this element :type key: (Any)|
+|silent_on_error|If True do not display popup nor print warning of key errors :type silent_on_error: (bool)|
|||
-| **return** | Union[Element, Error Element, None] Return value can be:
* the Element that matches the supplied key if found
* an Error Element if silent_on_error is False
* None if silent_on_error True |
+| **return** | Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
:rtype: Union[Element, Error Element, None] |
### find_element
@@ -14198,10 +14738,10 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|key|(Any) Used with window.FindElement and with return values to uniquely identify this element|
-|silent_on_error|(bool) If True do not display popup nor print warning of key errors|
+|key|Used with window.FindElement and with return values to uniquely identify this element :type key: (Any)|
+|silent_on_error|If True do not display popup nor print warning of key errors :type silent_on_error: (bool)|
|||
-| **return** | Union[Element, Error Element, None] Return value can be:
* the Element that matches the supplied key if found
* an Error Element if silent_on_error is False
* None if silent_on_error True |
+| **return** | Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;
:rtype: Union[Element, Error Element, None] |
### find_element_with_focus
@@ -14211,7 +14751,7 @@ Returns the Element that currently has focus as reported by tkinter. If no eleme
|Name|Meaning|
|---|---|
-| **return** | Union[Element, None] An Element if one has been found with focus or None if no element found |
+| **return** | An Element if one has been found with focus or None if no element found
:rtype: Union[Element, None] |
### get_screen_dimensions
@@ -14221,7 +14761,7 @@ Get the screen dimensions. NOTE - you must have a window already open for this
|Name|Meaning|
|---|---|
-| **return** | Union[Tuple[None, None], Tuple[width, height]] Tuple containing width and height of screen in pixels |
+| **return** | Tuple containing width and height of screen in pixels
:rtype: Union[Tuple[None, None], Tuple[width, height]] |
### get_screen_size
@@ -14272,9 +14812,9 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|rows|List[List[Elements]] Your entire layout|
+|rows|Your entire layout :type rows: List[List[Elements]]|
|||
-| **return** | (Window} self so that you can chain method calls |
+| **return** | self so that you can chain method calls
:rtype: (Window) |
### load_from_disk
@@ -14288,7 +14828,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|filename|(str) Pickle Filename to load|
+|filename|Pickle Filename to load :type filename: (str)|
### maximize
@@ -14320,8 +14860,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|x|(int) x coordinate in pixels|
-|y|(int) y coordinate in pixels|
+|x|x coordinate in pixels :type x: (int)|
+|y|y coordinate in pixels :type y: (int)|
### normal
@@ -14338,17 +14878,20 @@ Pass in a timeout (in milliseconds) to wait for a maximum of timeout millisecond
if no other GUI events happen first.
```
-read(timeout=None, timeout_key="__TIMEOUT__")
+read(timeout=None,
+ timeout_key="__TIMEOUT__",
+ close=False)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
-|timeout|(int) Milliseconds to wait until the Read will return IF no other GUI events happen first|
-|timeout_key|(Any) The value that will be returned from the call if the timer expired|
+|timeout|Milliseconds to wait until the Read will return IF no other GUI events happen first :type timeout: (int)|
+|timeout_key|The value that will be returned from the call if the timer expired :type timeout_key: (Any)|
+|close|if True the window will be closed prior to returning :type close: (bool)|
|||
-| **return** | Tuple[(Any), Union[Dict[Any:Any]], List[Any], None] (event, values)
(event or timeout_key or None, Dictionary of values or List of values from all elements in the Window) |
+| **return** | (event, values)
:rtype: Tuple[(Any), Union[Dict[Any:Any]], List[Any], None] |
### reappear
@@ -14368,7 +14911,7 @@ Without this call your changes to a Window will not be visible to the user until
|Name|Meaning|
|---|---|
-| **return** | (Window) `self` so that method calls can be easily "chained" |
+| **return** | `self` so that method calls can be easily "chained"
:rtype: (Window) |
### save_to_disk
@@ -14383,7 +14926,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|filename|(str) Filename to save the values to in pickled form|
+|filename|Filename to save the values to in pickled form :type filename: (str)|
### send_to_back
@@ -14405,14 +14948,16 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|alpha|(float) 0 to 1. 0 is completely transparent. 1 is completely visible and solid (can't see through)|
+|alpha|0 to 1. 0 is completely transparent. 1 is completely visible and solid (can't see through) :type alpha: (float)|
### set_icon
-Sets the icon that is shown on the title bar and on the task bar. Can pass in:
-* a filename which must be a .ICO icon file for windows
-* a bytes object
-* a BASE64 encoded file held in a variable
+Changes the icon that is shown on the title bar and on the task bar.
+NOTE - The file type is IMPORTANT and depends on the OS!
+Can pass in:
+* filename which must be a .ICO icon file for windows, PNG file for Linux
+* bytes object
+* BASE64 encoded file held in a variable
```
set_icon(icon=None, pngbase64=None)
@@ -14422,8 +14967,8 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|icon|(str) Filename or bytes object|
-|pngbase64|(str) Base64 encoded GIF or PNG file|
+|icon|Filename or bytes object :type icon: (str)|
+|pngbase64|Base64 encoded image :type pngbase64: (str)|
### set_transparent_color
@@ -14437,7 +14982,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|color|(str) Color string that defines the transparent color|
+|color|Color string that defines the transparent color :type color: (str)|
### size
@@ -14447,7 +14992,7 @@ Return the current size of the window in pixels
|Name|Meaning|
|---|---|
-| **return** | Tuple[(int), (int)] the (width, height) of the window |
+| **return** | (width, height) of the window
:rtype: Tuple[(int), (int)] |
### un_hide
@@ -15382,7 +15927,7 @@ Show a scrolled Popup window containing the user's text that was supplied. Use
want, just like a print statement.
```
-ScrolledTextBox(args,
+ScrolledTextBox(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -15575,7 +16120,7 @@ Parameter Descriptions:
## Debug Window Output
```
-easy_print(args,
+easy_print(args=*<1 or N object>,
size=(None, None),
end=None,
sep=None,
@@ -15610,7 +16155,7 @@ easy_print_close()
```
```
-eprint(args,
+eprint(args=*<1 or N object>,
size=(None, None),
end=None,
sep=None,
@@ -15641,7 +16186,7 @@ Parameter Descriptions:
|do_not_reroute_stdout|(Default = True)|
```
-sgprint(args,
+sgprint(args=*<1 or N object>,
size=(None, None),
end=None,
sep=None,
@@ -15676,7 +16221,7 @@ sgprint_close()
```
```
-EasyPrint(args,
+EasyPrint(args=*<1 or N object>,
size=(None, None),
end=None,
sep=None,
@@ -15711,7 +16256,7 @@ EasyPrintClose()
```
```
-Print(args,
+Print(args=*<1 or N object>,
size=(None, None),
end=None,
sep=None,
@@ -15752,7 +16297,7 @@ OneLineProgressMeter(title,
current_value,
max_value,
key,
- args,
+ args=*<1 or N object>,
orientation="v",
bar_color=(None, None),
button_color=None,
@@ -15776,6 +16321,10 @@ Parameter Descriptions:
|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE)|
|border_width|width of border around element|
|grab_anywhere|If True can grab anywhere to move the window (Default = False)|
+|||
+| **return** | (bool) True if updated successfully. False if user closed the meter with the X or Cancel button |
+
+Cancels and closes a previously created One Line Progress Meter window
```
OneLineProgressMeterCancel(key)
@@ -15785,14 +16334,14 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|key|Used with window.FindElement and with return values to uniquely identify this element|
+|key|Key used when meter was created|
```
one_line_progress_meter(title,
current_value,
max_value,
key,
- args,
+ args=*<1 or N object>,
orientation="v",
bar_color=(None, None),
button_color=None,
@@ -15816,6 +16365,10 @@ Parameter Descriptions:
|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE)|
|border_width|width of border around element|
|grab_anywhere|If True can grab anywhere to move the window (Default = False)|
+|||
+| **return** | (bool) True if updated successfully. False if user closed the meter with the X or Cancel button |
+
+Cancels and closes a previously created One Line Progress Meter window
```
one_line_progress_meter_cancel(key)
@@ -15825,7 +16378,7 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|key|Used with window.FindElement and with return values to uniquely identify this element|
+|key|Key used when meter was created|
## Popup Functions
@@ -15833,7 +16386,7 @@ Popup - Display a popup Window with as many parms as you wish to include. This
"print" statement. It's also great for "pausing" your program's flow until the user can read some error messages.
```
-Popup(args,
+Popup(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -15856,24 +16409,24 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|*args|(Any) Variable number of your arguments. Load up the call with stuff to see!|
-|title|(str) Optional title for the window. If none provided, the first arg will be used instead.|
-|button_color|Tuple[str, str] Color of the buttons shown (text color, button color)|
-|background_color|(str) Window's background color|
-|text_color|(str) text color|
-|button_type|(enum) NOT USER SET! Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). There are many Popup functions and they call Popup, changing this parameter to get the desired effect.|
-|auto_close|(bool) If True the window will automatically close|
-|auto_close_duration|(int) time in seconds to keep window open before closing it automatically|
-|custom_text|Union[Tuple[str, str], str] A string or pair of strings that contain the text to display on the buttons|
-|non_blocking|(bool) If True then will immediately return from the function without waiting for the user's input.|
-|icon|Union[str, bytes] icon to display on the window. Same format as a Window call|
-|line_width|(int) Width of lines in characters. Defaults to MESSAGE_BOX_LINE_WIDTH|
-|font|Union[str, tuple(font name, size, modifiers) specifies the font family, size, etc|
-|no_titlebar|(bool) If True will not show the frame around the window and the titlebar across the top|
-|grab_anywhere|(bool) If True can grab anywhere to move the window. If no_titlebar is True, grab_anywhere should likely be enabled too|
-|location|Tuple[int, int] Location on screen to display the top left corner of window. Defaults to window centered on screen|
+|*args|Variable number of your arguments. Load up the call with stuff to see! :type *args: (Any)|
+|title|Optional title for the window. If none provided, the first arg will be used instead. :type title: (str)|
+|button_color|Color of the buttons shown (text color, button color) :type button_color: Tuple[str, str]|
+|background_color|Window's background color :type background_color: (str)|
+|text_color|text color :type text_color: (str)|
+|button_type|NOT USER SET! Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). There are many Popup functions and they call Popup, changing this parameter to get the desired effect. :type button_type: (enum)|
+|auto_close|If True the window will automatically close :type auto_close: (bool)|
+|auto_close_duration|time in seconds to keep window open before closing it automatically :type auto_close_duration: (int)|
+|custom_text|A string or pair of strings that contain the text to display on the buttons :type custom_text: Union[Tuple[str, str], str]|
+|non_blocking|If True then will immediately return from the function without waiting for the user's input. :type non_blocking: (bool)|
+|icon|icon to display on the window. Same format as a Window call :type icon: Union[str, bytes]|
+|line_width|Width of lines in characters. Defaults to MESSAGE_BOX_LINE_WIDTH :type line_width: (int)|
+|font|specifies the font family, size, etc :type font: Union[str, tuple(font name, size, modifiers]|
+|no_titlebar|If True will not show the frame around the window and the titlebar across the top :type no_titlebar: (bool)|
+|grab_anywhere|If True can grab anywhere to move the window. If no_titlebar is True, grab_anywhere should likely be enabled too :type grab_anywhere: (bool)|
+|location|Location on screen to display the top left corner of window. Defaults to window centered on screen :type location: Tuple[int, int]|
|||
-| **return** | Union[str, None] Returns text of the button that was pressed. None will be returned if user closed window with X |
+| **return** | Returns text of the button that was pressed. None will be returned if user closed window with X
:rtype: Union[str, None] |
Show animation one frame at a time. This function has its own internal clocking meaning you can call it at any frequency
and the rate the frames of video is shown remains constant. Maybe your frames update every 30 ms but your
@@ -15915,7 +16468,7 @@ Parameter Descriptions:
Display a Popup without a titlebar. Enables grab anywhere so you can move it
```
-PopupAnnoying(args,
+PopupAnnoying(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -15954,7 +16507,7 @@ Parameter Descriptions:
Popup that closes itself after some time period
```
-PopupAutoClose(args,
+PopupAutoClose(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -15995,7 +16548,7 @@ Parameter Descriptions:
Display Popup with "cancelled" button text
```
-PopupCancel(args,
+PopupCancel(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -16034,7 +16587,7 @@ Parameter Descriptions:
Popup with colored button and 'Error' as button text
```
-PopupError(args,
+PopupError(args=*<1 or N object>,
title=None,
button_color=(None, None),
background_color=None,
@@ -16185,27 +16738,27 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|message|(str) message displayed to user|
-|title|(str) Window title|
-|default_text|(str) default value to put into input area|
-|password_char|(str) character to be shown instead of actually typed characters|
-|size|Tuple[int, int] (width, height) of the InputText Element|
-|button_color|Tuple[str, str] Color of the button (text, background)|
-|background_color|(str) background color of the entire window|
-|text_color|(str) color of the message text|
-|icon|Union[bytes, str] filename or base64 string to be used for the window's icon|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|no_titlebar|(bool) If True no titlebar will be shown|
-|grab_anywhere|(bool) If True can click and drag anywhere in the window to move the window|
-|keep_on_top|(bool) If True the window will remain above all current windows|
-|location|Tuyple[int, int] (x,y) Location on screen to display the upper left corner of window|
+|message|(str) message displayed to user :type message: (str)|
+|title|(str) Window title :type title: (str)|
+|default_text|(str) default value to put into input area :type default_text: (str)|
+|password_char|(str) character to be shown instead of actually typed characters :type password_char: (str)|
+|size|(width, height) of the InputText Element :type size: Tuple[int, int]|
+|button_color|Color of the button (text, background) :type button_color: Tuple[str, str]|
+|background_color|(str) background color of the entire window :type background_color: (str)|
+|text_color|(str) color of the message text :type text_color: (str)|
+|icon|filename or base64 string to be used for the window's icon :type icon: Union[bytes, str]|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|no_titlebar|(bool) If True no titlebar will be shown :type no_titlebar: (bool)|
+|grab_anywhere|(bool) If True can click and drag anywhere in the window to move the window :type grab_anywhere: (bool)|
+|keep_on_top|(bool) If True the window will remain above all current windows :type keep_on_top: (bool)|
+|location|(x,y) Location on screen to display the upper left corner of window :type location: Tuple[int, int]|
|||
-| **return** | Union[str, None] Text entered or None if window was closed or cancel button clicked |
+| **return** | Text entered or None if window was closed or cancel button clicked
:rtype: Union[str, None] |
Display a Popup without a titlebar. Enables grab anywhere so you can move it
```
-PopupNoBorder(args,
+PopupNoBorder(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -16244,7 +16797,7 @@ Parameter Descriptions:
Show a Popup but without any buttons
```
-PopupNoButtons(args,
+PopupNoButtons(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -16283,7 +16836,7 @@ Parameter Descriptions:
Display a Popup without a titlebar. Enables grab anywhere so you can move it
```
-PopupNoFrame(args,
+PopupNoFrame(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -16322,7 +16875,7 @@ Parameter Descriptions:
Display a Popup without a titlebar. Enables grab anywhere so you can move it
```
-PopupNoTitlebar(args,
+PopupNoTitlebar(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -16361,7 +16914,7 @@ Parameter Descriptions:
Show Popup window and immediately return (does not block)
```
-PopupNoWait(args,
+PopupNoWait(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -16402,7 +16955,7 @@ Parameter Descriptions:
Show Popup window and immediately return (does not block)
```
-PopupNonBlocking(args,
+PopupNonBlocking(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -16443,7 +16996,7 @@ Parameter Descriptions:
Display Popup with OK button only
```
-PopupOK(args,
+PopupOK(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -16482,7 +17035,7 @@ Parameter Descriptions:
Display popup with OK and Cancel buttons
```
-PopupOKCancel(args,
+PopupOKCancel(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -16523,7 +17076,7 @@ Parameter Descriptions:
Show Popup box that doesn't block and closes itself
```
-PopupQuick(args,
+PopupQuick(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -16564,7 +17117,7 @@ Parameter Descriptions:
Show Popup window with no titlebar, doesn't block, and auto closes itself.
```
-PopupQuickMessage(args,
+PopupQuickMessage(args=*<1 or N object>,
title=None,
button_type=5,
button_color=None,
@@ -16606,7 +17159,7 @@ Show a scrolled Popup window containing the user's text that was supplied. Use
want, just like a print statement.
```
-PopupScrolled(args,
+PopupScrolled(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -16642,7 +17195,7 @@ Parameter Descriptions:
Popup that closes itself after some time period
```
-PopupTimed(args,
+PopupTimed(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -16683,7 +17236,7 @@ Parameter Descriptions:
Display Popup with Yes and No buttons
```
-PopupYesNo(args,
+PopupYesNo(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -16727,7 +17280,7 @@ Popup - Display a popup Window with as many parms as you wish to include. This
"print" statement. It's also great for "pausing" your program's flow until the user can read some error messages.
```
-popup(args,
+popup(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -16750,24 +17303,24 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|*args|(Any) Variable number of your arguments. Load up the call with stuff to see!|
-|title|(str) Optional title for the window. If none provided, the first arg will be used instead.|
-|button_color|Tuple[str, str] Color of the buttons shown (text color, button color)|
-|background_color|(str) Window's background color|
-|text_color|(str) text color|
-|button_type|(enum) NOT USER SET! Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). There are many Popup functions and they call Popup, changing this parameter to get the desired effect.|
-|auto_close|(bool) If True the window will automatically close|
-|auto_close_duration|(int) time in seconds to keep window open before closing it automatically|
-|custom_text|Union[Tuple[str, str], str] A string or pair of strings that contain the text to display on the buttons|
-|non_blocking|(bool) If True then will immediately return from the function without waiting for the user's input.|
-|icon|Union[str, bytes] icon to display on the window. Same format as a Window call|
-|line_width|(int) Width of lines in characters. Defaults to MESSAGE_BOX_LINE_WIDTH|
-|font|Union[str, tuple(font name, size, modifiers) specifies the font family, size, etc|
-|no_titlebar|(bool) If True will not show the frame around the window and the titlebar across the top|
-|grab_anywhere|(bool) If True can grab anywhere to move the window. If no_titlebar is True, grab_anywhere should likely be enabled too|
-|location|Tuple[int, int] Location on screen to display the top left corner of window. Defaults to window centered on screen|
+|*args|Variable number of your arguments. Load up the call with stuff to see! :type *args: (Any)|
+|title|Optional title for the window. If none provided, the first arg will be used instead. :type title: (str)|
+|button_color|Color of the buttons shown (text color, button color) :type button_color: Tuple[str, str]|
+|background_color|Window's background color :type background_color: (str)|
+|text_color|text color :type text_color: (str)|
+|button_type|NOT USER SET! Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). There are many Popup functions and they call Popup, changing this parameter to get the desired effect. :type button_type: (enum)|
+|auto_close|If True the window will automatically close :type auto_close: (bool)|
+|auto_close_duration|time in seconds to keep window open before closing it automatically :type auto_close_duration: (int)|
+|custom_text|A string or pair of strings that contain the text to display on the buttons :type custom_text: Union[Tuple[str, str], str]|
+|non_blocking|If True then will immediately return from the function without waiting for the user's input. :type non_blocking: (bool)|
+|icon|icon to display on the window. Same format as a Window call :type icon: Union[str, bytes]|
+|line_width|Width of lines in characters. Defaults to MESSAGE_BOX_LINE_WIDTH :type line_width: (int)|
+|font|specifies the font family, size, etc :type font: Union[str, tuple(font name, size, modifiers]|
+|no_titlebar|If True will not show the frame around the window and the titlebar across the top :type no_titlebar: (bool)|
+|grab_anywhere|If True can grab anywhere to move the window. If no_titlebar is True, grab_anywhere should likely be enabled too :type grab_anywhere: (bool)|
+|location|Location on screen to display the top left corner of window. Defaults to window centered on screen :type location: Tuple[int, int]|
|||
-| **return** | Union[str, None] Returns text of the button that was pressed. None will be returned if user closed window with X |
+| **return** | Returns text of the button that was pressed. None will be returned if user closed window with X
:rtype: Union[str, None] |
Show animation one frame at a time. This function has its own internal clocking meaning you can call it at any frequency
and the rate the frames of video is shown remains constant. Maybe your frames update every 30 ms but your
@@ -16809,7 +17362,7 @@ Parameter Descriptions:
Display a Popup without a titlebar. Enables grab anywhere so you can move it
```
-popup_annoying(args,
+popup_annoying(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -16848,7 +17401,7 @@ Parameter Descriptions:
Popup that closes itself after some time period
```
-popup_auto_close(args,
+popup_auto_close(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -16889,7 +17442,7 @@ Parameter Descriptions:
Display Popup with "cancelled" button text
```
-popup_cancel(args,
+popup_cancel(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -16928,7 +17481,7 @@ Parameter Descriptions:
Popup with colored button and 'Error' as button text
```
-popup_error(args,
+popup_error(args=*<1 or N object>,
title=None,
button_color=(None, None),
background_color=None,
@@ -17079,27 +17632,27 @@ Parameter Descriptions:
|Name|Meaning|
|---|---|
-|message|(str) message displayed to user|
-|title|(str) Window title|
-|default_text|(str) default value to put into input area|
-|password_char|(str) character to be shown instead of actually typed characters|
-|size|Tuple[int, int] (width, height) of the InputText Element|
-|button_color|Tuple[str, str] Color of the button (text, background)|
-|background_color|(str) background color of the entire window|
-|text_color|(str) color of the message text|
-|icon|Union[bytes, str] filename or base64 string to be used for the window's icon|
-|font|Union[str, Tuple[str, int]] specifies the font family, size, etc|
-|no_titlebar|(bool) If True no titlebar will be shown|
-|grab_anywhere|(bool) If True can click and drag anywhere in the window to move the window|
-|keep_on_top|(bool) If True the window will remain above all current windows|
-|location|Tuyple[int, int] (x,y) Location on screen to display the upper left corner of window|
+|message|(str) message displayed to user :type message: (str)|
+|title|(str) Window title :type title: (str)|
+|default_text|(str) default value to put into input area :type default_text: (str)|
+|password_char|(str) character to be shown instead of actually typed characters :type password_char: (str)|
+|size|(width, height) of the InputText Element :type size: Tuple[int, int]|
+|button_color|Color of the button (text, background) :type button_color: Tuple[str, str]|
+|background_color|(str) background color of the entire window :type background_color: (str)|
+|text_color|(str) color of the message text :type text_color: (str)|
+|icon|filename or base64 string to be used for the window's icon :type icon: Union[bytes, str]|
+|font|specifies the font family, size, etc :type font: Union[str, Tuple[str, int]]|
+|no_titlebar|(bool) If True no titlebar will be shown :type no_titlebar: (bool)|
+|grab_anywhere|(bool) If True can click and drag anywhere in the window to move the window :type grab_anywhere: (bool)|
+|keep_on_top|(bool) If True the window will remain above all current windows :type keep_on_top: (bool)|
+|location|(x,y) Location on screen to display the upper left corner of window :type location: Tuple[int, int]|
|||
-| **return** | Union[str, None] Text entered or None if window was closed or cancel button clicked |
+| **return** | Text entered or None if window was closed or cancel button clicked
:rtype: Union[str, None] |
Display a Popup without a titlebar. Enables grab anywhere so you can move it
```
-popup_no_border(args,
+popup_no_border(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -17138,7 +17691,7 @@ Parameter Descriptions:
Show a Popup but without any buttons
```
-popup_no_buttons(args,
+popup_no_buttons(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -17177,7 +17730,7 @@ Parameter Descriptions:
Display a Popup without a titlebar. Enables grab anywhere so you can move it
```
-popup_no_frame(args,
+popup_no_frame(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -17216,7 +17769,7 @@ Parameter Descriptions:
Display a Popup without a titlebar. Enables grab anywhere so you can move it
```
-popup_no_titlebar(args,
+popup_no_titlebar(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -17255,7 +17808,7 @@ Parameter Descriptions:
Show Popup window and immediately return (does not block)
```
-popup_no_wait(args,
+popup_no_wait(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -17296,7 +17849,7 @@ Parameter Descriptions:
Show Popup window and immediately return (does not block)
```
-popup_non_blocking(args,
+popup_non_blocking(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -17337,7 +17890,7 @@ Parameter Descriptions:
Display Popup with OK button only
```
-popup_ok(args,
+popup_ok(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -17376,7 +17929,7 @@ Parameter Descriptions:
Display popup with OK and Cancel buttons
```
-popup_ok_cancel(args,
+popup_ok_cancel(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -17417,7 +17970,7 @@ Parameter Descriptions:
Show Popup box that doesn't block and closes itself
```
-popup_quick(args,
+popup_quick(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -17458,7 +18011,7 @@ Parameter Descriptions:
Show Popup window with no titlebar, doesn't block, and auto closes itself.
```
-popup_quick_message(args,
+popup_quick_message(args=*<1 or N object>,
title=None,
button_type=5,
button_color=None,
@@ -17500,7 +18053,7 @@ Show a scrolled Popup window containing the user's text that was supplied. Use
want, just like a print statement.
```
-popup_scrolled(args,
+popup_scrolled(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -17536,7 +18089,7 @@ Parameter Descriptions:
Popup that closes itself after some time period
```
-popup_timed(args,
+popup_timed(args=*<1 or N object>,
title=None,
button_type=0,
button_color=None,
@@ -17577,7 +18130,7 @@ Parameter Descriptions:
Display Popup with Yes and No buttons
```
-popup_yes_no(args,
+popup_yes_no(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -17756,34 +18309,32 @@ Parameter Descriptions:
Shows the smaller "popout" window. Default location is the upper right corner of your screen
```
-show_debugger_popout_window(location=(None, None), args)
+show_debugger_popout_window(location=(None, None), args=*<1 or N object>)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
-|location|Tuple[int, int] Locations (x,y) on the screen to place upper left corner of the window|
-|*args|Not used|
+|location|Locations (x,y) on the screen to place upper left corner of the window :type location: Tuple[int, int]|
Shows the large main debugger window
```
-show_debugger_window(location=(None, None), args)
+show_debugger_window(location=(None, None), args=*<1 or N object>)
```
Parameter Descriptions:
|Name|Meaning|
|---|---|
-|location|Tuple[int, int] Locations (x,y) on the screen to place upper left corner of the window|
-|*args|Not used|
+|location|Locations (x,y) on the screen to place upper left corner of the window :ttype location: Tuple[int, int]|
Show a scrolled Popup window containing the user's text that was supplied. Use with as many items to print as you
want, just like a print statement.
```
-sprint(args,
+sprint(args=*<1 or N object>,
title=None,
button_color=None,
background_color=None,
@@ -17839,28 +18390,48 @@ Parameter Descriptions:
|||
| **return** | (str) the currently selected theme |
-Returns the background color specified by the current color theme
+Sets/Returns the background color currently in use
+Used for Windows and containers (Column, Frame, Tab) and tables
```
-theme_background_color() -> (str) - color string of the background color defined by current theme
+theme_background_color(color=None) -> (str) - color string of the background color currently in use
```
-Returns the button color specified by the current color theme
+Sets/Returns the border width currently in use
+Used by non ttk elements at the moment
```
-theme_button_color() -> Tuple[str, str] - TUPLE with color strings of the button color defined by current theme (button text color, button background color)
+theme_border_width(border_width=None) -> (int) - border width currently in use
```
-Returns the input element background color specified by the current color theme
+Sets/Returns the button color currently in use
```
-theme_input_background_color() -> (str) - color string of the input element background color defined by current theme
+theme_button_color(color=None) -> Tuple[str, str] - TUPLE with color strings of the button color currently in use (button text color, button background color)
```
-Returns the input element text color specified by the current color theme
+Sets/Returns the background color currently in use for all elements except containers
```
-theme_input_text_color() -> (str) - color string of the input element text color defined by current theme
+theme_element_background_color(color=None) -> (str) - color string of the element background color currently in use
+```
+
+Sets/Returns the text color used by elements that have text as part of their display (Tables, Trees and Sliders)
+
+```
+theme_element_text_color(color=None) -> (str) - color string currently in use
+```
+
+Sets/Returns the input element background color currently in use
+
+```
+theme_input_background_color(color=None) -> (str) - color string of the input element background color currently in use
+```
+
+Sets/Returns the input element entry color (not the text but the thing that's displaying the text)
+
+```
+theme_input_text_color(color=None) -> (str) - color string of the input element color currently in use
```
Returns a sorted list of the currently available color themes
@@ -17881,10 +18452,40 @@ Parameter Descriptions:
|---|---|
|columns|(int) number of themes in a single row|
-Returns the text color specified by the current color theme
+Sets/Returns the progress meter border width currently in use
```
-theme_text_color() -> (str) - color string of the text color defined by current theme
+theme_progress_bar_border_width(border_width=None) -> (int) - border width currently in use
+```
+
+Sets/Returns the progress bar colors by the current color theme
+
+```
+theme_progress_bar_color(color=None) -> Tuple[str, str] - TUPLE with color strings of the ProgressBar color currently in use(button text color, button background color)
+```
+
+Sets/Returns the slider border width currently in use
+
+```
+theme_slider_border_width(border_width=None) -> (int) - border width currently in use
+```
+
+Sets/Returns the slider color (used for sliders)
+
+```
+theme_slider_color(color=None) -> (str) - color string of the slider color currently in use
+```
+
+Sets/Returns the text color currently in use
+
+```
+theme_text_color(color=None) -> (str) - color string of the text color currently in use
+```
+
+Sets/Returns the background color for text elements
+
+```
+theme_text_element_background_color(color=None) -> (str) - color string of the text background color currently in use
```
## Old Themes (Look and Feel) - Replaced by theme()
@@ -19248,6 +19849,87 @@ Table and Tree header colors, expanded Graph methods
* Spin element - fixed bug that showed "None" if default value is "None"
* Test Harness sets incorrect look and feel on purpose so a random one is chosen
+## 4.14.0 PySimpleGUI 23-Dec-2019
+
+THEMES!
+
+* theme is replacing change_look_and_feel. The old calls will still be usable however
+* LOTS of new theme functions. Search for "theme_" to find them in this documentation. There's a section discussing themes too
+* "Dark Blue 3" is the default theme now. All windows will be colored using this theme unless the user sets another one
+* Removed the code that forced Macs to use gray
+* New element.set_cursor - can now set a cursor for any of the elements. Pass in a cursor string and cursor will appear when mouse over widget
+* Combo - enable setting to any value, not just those in the list
+* Combo - changed how initial value is set
+* Can change the font on tabs by setting font parameter in TabGroup
+* Table heading font now defaults correctly
+* Tree heading font now defaults correctly
+* Renamed DebugWin to _DebugWin to discourage use
+
+## 4.15.0 PySimpleGUI 08-Jan-2020
+
+Dynamic Window Layouts! Extend your layouts with `Window.extend_layout`
+Lots of fixes
+
+* Window.extend_layout
+* Graph.change_coordinates - realtime change of coordinate systems for the Graph element
+* theme_text_element_background_color - new function to expose this setting
+* Radio & Checkbox colors changed to be ligher/darker than background
+* Progress bar - allow updates of value > max value
+* Output element does deletes now so that cleanup works. Can use in multiple windows as a result
+* DrawArc (draw_arc) - New width / line width parameter
+* RGB does more error checking, converts types
+* More descriptive errors for find element
+* popup_error used interally now sets keep on top
+* Element Re-use wording changed so that it's clear the element is the problem not the layout when re-use detected
+* Window.Close (Window.close) - fix for not immediately seeing the window disappear on Linux when clicking "X"
+* Window.BringToFront (bring_to_front) - on Windows needed to use topmost to bring window to front insteade of lift
+* Multiline Scrollbar - removed the scrollbar color. It doesn't work on Windows so keeping consistent
+* Changed how Debug Windows are created. Uses finalize now instead of the read non-blocking
+* Fix for Debug Window being closed by X causing main window to also close
+* Changed all "black" and "white" in the Look and Feel table to #000000 and #FFFFFF
+* Added new color processing functions for internal use (hsl and hsv related)
+* popup - extended the automatic wrapping capabilities to messages containing \n
+* Test harness uses a nicer colors for event, value print outs.
+* _timeit decorator for timing functions
+
+## 4.15.1 PySimpleGUI 09-Jan-2020
+
+Quick patch to remove change to popup
+
+## 4.15.2 PySimpleGUI 15-Jan-2020
+
+Quick patch to remove f-string for 3.5 compat.
+
+## 4.16.0 PySimpleGUI 08-Jan-2020
+
+The "LONG time coming" release. System Tray, Read with close + loads more changes
+Note - there is a known problem with the built-in debugger created when the new read with close was added
+
+* System Tray - Simulates the System Tray feature currently in PySimpleGUIWx and PySimpleGUIQt. All calls are the same. The icon is located just above the system tray (bottom right corner)
+* Window.read - NEW close parameter will close the window for you after the read completes. Can make a single line window using this
+* Window.element_list - Returns a list of all elements in the window
+* Element.unbind - can remove a previously created binding
+* Element.set_size - retries using "length" if "height" setting fails
+* Listbox.update - select_mode parameter added
+* Listbox.update - no longer selects the first entry when all values are changed
+* Listbox.get - new. use to get the current values. Will be the same as the read return dictionary
+* Checkbox.update - added ability to change background and text colors. Uses the same combuted checkbox background color (may remove)
+* Multiline.update - fix for when no value is specified
+* Multiline - Check for None when creating. Ignores None rather than converting to string
+* Text.update - added changing value to string. Assumed caller was passing in string previously.
+* Text Element - justification can be specified with a single character. l=left, r=right, c=center. Previously had to fully spell out
+* Input Element - justification can be specified with a single character. l=left, r=right, c=center. Previously had to fully spell out
+* StatusBar Element - justification can be specified with a single character. l=left, r=right, c=center. Previously had to fully spell out
+* Image Element - can specify no image when creating. Previously gave a warning and required filename = '' to indicate nothing set
+* Table Element - justification can be specified as an "l" or "r" instead of full word left/right
+* Tree Element - justification can be specified as an "l" or "r" instead of full word left/right
+* Graph.draw_point - changed to using 1/2 the size rather than size. Set width = 0 so no outline will be drawn
+* Graph.draw_polygon - new drawing method! Can now draw polygons that fill
+* Layout error checking and reporting added for - Frame, Tab, TabGroup, Column, Window
+* Menu - Ability to set the font for the menu items
+* Debug window - fix for problem closing using the "Quit" button
+* print_to_element - print-like call that can be used to output to a Multiline element as if it is an Output element
+
### Upcoming
There will always be overlapping work as the ports will never actually be "complete" as there's always something new that can be built. However there's a definition for the base functionality for PySimpleGUI. This is what is being strived for with the currnt ports that are underway.
diff --git a/readme_creator/run_me.py b/readme_creator/run_me.py
index 282312c0..16ea9e22 100644
--- a/readme_creator/run_me.py
+++ b/readme_creator/run_me.py
@@ -92,7 +92,6 @@ if method == 'with logs':
########################################
if enable_popup:
import PySimpleGUI as sg
- sg.change_look_and_feel('Dark Green 2')
lines = open('usage.log.txt', mode='r').readlines()
sg.PopupScrolled('Completed making {}'.format(OUTPUT_FILENAME), ''.join(lines), size=(80,50))
diff --git a/readme_creator/show_all_tags.py b/readme_creator/show_all_tags.py
index 82306b33..afbe297e 100644
--- a/readme_creator/show_all_tags.py
+++ b/readme_creator/show_all_tags.py
@@ -6,36 +6,58 @@ import PySimpleGUIlib
Will output to STDOUT all of the different tags for classes, members and functions for a given PySimpleGUIlib.py
file. Functions that begin with _ are filtered out from the list.
Displays the results in a PySimpleGUI window which can be used to copy and paste into other places.
-
"""
-PySimpleGUIlib.theme('Dark Green 2')
-layout = [[PySimpleGUIlib.Output(size=(80,50))]]
+layout = [[PySimpleGUIlib.Output(size=(80,40))]]
window = PySimpleGUIlib.Window('Dump of tags', layout, resizable=True).Finalize()
-psg_members = inspect.getmembers(PySimpleGUIlib)
-psg_funcs = [o for o in psg_members if inspect.isfunction(o[1])]
+
+SHOW_UNDERSCORE_METHODS = not False
+
+def valid_field(pair):
+ bad_fields = 'LOOK_AND_FEEL_TABLE copyright __builtins__'.split(' ')
+ bad_prefix = 'TITLE_ TEXT_ ELEM_TYPE_ DEFAULT_ BUTTON_TYPE_ LISTBOX_SELECT METER_ POPUP_ THEME_'.split(' ')
+
+ field_name, python_object = pair
+ if type(python_object) is bytes:
+ return False
+ if field_name in bad_fields:
+ return False
+ if any([i for i in bad_prefix if field_name.startswith(i)]):
+ return False
+
+ return True
+
+psg_members = [i for i in inspect.getmembers(PySimpleGUIlib) if valid_field(i)]
+psg_funcs = [o[0] for o in psg_members if inspect.isfunction(o[1])]
psg_classes = [o for o in psg_members if inspect.isclass(o[1])]
+# psg_props = [o for o in psg_members if type(o[1]).__name__ == 'property']
+
# I don't know how this magic filtering works, I just know it works. "Private" stuff (begins with _) are somehow
# excluded from the list with the following 2 lines of code. Very nicely done Kol-ee-ya!
-psg_classes_ = list(set([i[1] for i in psg_classes])) # filtering of anything that starts with _ (methods, classes, etc)
-psg_classes = list(zip([i.__name__ for i in psg_classes_], psg_classes_))
+psg_classes = sorted(list(set([i[1] for i in psg_classes])), key=lambda x : x.__name__) # filtering of anything that starts with _ (methods, classes, etc)
-for i in sorted(psg_classes):
- if 'Tk' in i[0] or 'TK' in i[0] or 'Element' == i[0]: # or 'Window' == i[0]:
+for aclass in psg_classes:
+ class_name = aclass.__name__
+ if 'Tk' in class_name or 'TK' in class_name or 'Element' == class_name: # or 'Window' == class_name:
continue
- print(f'## {i[0]} Element')
- print('')
- print(f'')
- print(f'')
- print('')
- print('\n'.join([f"### {j[0]}\n\n\n" for j in inspect.getmembers(i[1]) if not j[0].startswith('_') ]))
+ print(f'### {class_name} Element ')
+ print(f'')
+ print(f'\n')
+ print('\n'.join([f"#### {name}\n\n" for name, obj in inspect.getmembers(aclass) if not name.startswith('_') ]))
print('\n------------------------- Functions start here -------------------------\n')
-for f in psg_funcs:
- if '_' != f[0][0]: # if doesn't START with _
- print(f"")
+if SHOW_UNDERSCORE_METHODS:
+ for i in psg_funcs:
+ if '_' in i:
+ print( f"" )
+else:
+ for i in psg_funcs:
+ print( f"" )
+
+
+
window.Read()
\ No newline at end of file
diff --git a/readme_creator/usage.log.txt b/readme_creator/usage.log.txt
index 3a43e67d..ee820424 100644
--- a/readme_creator/usage.log.txt
+++ b/readme_creator/usage.log.txt
@@ -1,2 +1,729 @@
-2019-11-28 11:22:09,766>INFO: STARTING
-2019-11-28 11:22:09,766>INFO: STARTING
+2020-03-08 19:26:20,630>INFO: STARTING
+2020-03-08 19:26:20,638>ERROR: function "print_to_element" not found in PySimpleGUI
+2020-03-08 19:26:21,059>INFO: DONE 713 TAGS:
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+ - COMPLETE
+2020-03-08 19:26:21,059>INFO: FAIL WITH 10 TAGS:
+ - FAIL
+ - FAIL
+ - FAIL
+ - FAIL
+ - FAIL
+ - FAIL
+ - FAIL
+ - FAIL
+ - FAIL
+ - FAIL
+2020-03-08 19:26:21,060>INFO: Deleting html comments
+2020-03-08 19:26:21,079>INFO: ending. writing to a file///////////////