diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..000d76e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +readme_creator/psg_gui.py diff --git a/readme_creator/1_HEADER_top_part.md b/readme_creator/1_HEADER_top_part.md index 04da2347..2cd4e583 100644 --- a/readme_creator/1_HEADER_top_part.md +++ b/readme_creator/1_HEADER_top_part.md @@ -42,11 +42,13 @@ HOW DO I INSERT IMAGES ??? ![Awesome Meter](https://img.shields.io/badge/Awesome_meter-100-yellow.svg) ![Python Version](https://img.shields.io/badge/Python-2.7_3.x-yellow.svg) -![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-4.16.0-red.svg?longCache=true&style=for-the-badge) - -![Python Version](https://img.shields.io/badge/PySimpleGUIQt_Version-0.30.0-orange.svg?longCache=true&style=for-the-badge) -![Python Version](https://img.shields.io/badge/PySimpleGUIWx_version-0.14.0-orange.svg?longCache=true&style=for-the-badge) -![Python Version](https://img.shields.io/badge/PySimpleGUIWeb_Version-0.33.0-orange.svg?longCache=true&style=for-the-badge) +[![PyPI Version](https://img.shields.io/pypi/v/pysimplegui.svg?style=for-the-badge)](https://pypi.org/project/pysimplegui/) tkinter +[![PyPI Version](https://img.shields.io/pypi/v/pysimpleguiqt.svg?style=for-the-badge)](https://pypi.org/project/pysimpleguiqt/) Qt +[![PyPI Version](https://img.shields.io/pypi/v/pysimpleguiweb.svg?style=for-the-badge)](https://pypi.org/project/pysimpleguiweb/) Web +[![PyPI Version](https://img.shields.io/pypi/v/pysimpleguiwx.svg?style=for-the-badge)](https://pypi.org/project/pysimpleguiwx/) Wx +![GitHub issues](https://img.shields.io/github/issues-raw/PySimpleGUI/PySimpleGUI?color=blue) ![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/PySimpleGUI/PySimpleGUI?color=blue) +[![Commit activity](https://img.shields.io/github/commit-activity/m/PySimpleGUI/PySimpleGUI.svg?style=for-the-badge)](../../commits/master) +[![Last commit](https://img.shields.io/github/last-commit/PySimpleGUI/PySimpleGUI.svg?style=for-the-badge)](../../commits/master) @@ -562,7 +564,7 @@ You won't look stupid posting an Issue on GitHub. It's just the opposite. **PySimpleGUI is an active project.** Bugs are fixed, features are added, often. Should you run into trouble, **open an issue** on the [GitHub site](http://www.PySimpleGUI.com) and you'll receive help. Posting questions on StackOverflow, Forums, Mailing lists, Reddit, etc, is not the fastest path to support and taking it may very well lead you astray as folks not familiar with the package struggle to help you. You may also run into the common response of "I don't know PySimpleGUI (and perhaps dislike it as a result), but I know you can do that with Qt". -Why only 1 location? It's simple.... it's where the bugs, enhancements, etc are tracked. It's THE spot on the Internet for this project. It's not some freakish being in control, telling people how to do things. It's so that YOU get the best and quickest support possible. +Why only 1 location? It's simple.... it's where the bugs, enhancements, etc are tracked. It's THE spot on the Internet for this project. There's not driven by a freakish being in control, telling people how to do things, reasoning. It's so that YOU get the best and quickest support possible. So, [open an Issue](https://github.com/PySimpleGUI/PySimpleGUI/issues/new/choose), choose "custom form" and fill it out completely. There are very good reasons behind all of the questions. Cutting corners only cuts your chances of getting help and getting quality help as it's difficult enough to debug remotely. Don't handicap people that want to help by not providing enough information. @@ -571,29 +573,6 @@ So, [open an Issue](https://github.com/PySimpleGUI/PySimpleGUI/issues/new/choose ***Don't sit and stew, trying the same thing over and over***, until you hate life... stop, and post an Issue on the GitHub. Someone **WILL** answer you. Support is included in the purchase price for this package (the quality level matches the price as well I'm afraid). Just don't be too upset when your free support turns out to be a little bit crappy, but it's free and typically good advice. -### PySimpleGUI Trolls - -Yea, they're out there. Would have NEVER in a billion years guessed that there would be objection to this package, coming from a small, but vocal, number of people. I naively believed everyone would be supportive, see the value, hold hands around the fire, sing songs, and in the very least be truthful. But, this ain't Kansas and the Internet is well... - -If someone is actively discouraging you from using this package, then know you are on the right track and you should give it a try. Stuff like this sometimes happens because the person works for a particular company or they have a GUI package of their own.... that's not popuplar, or they like to tear things down or I dunno... people can be really weird and emotional. - -I promise you're not going to be wrecked for life. It will not cause you to be a bad programmer with bad habits. It will not ruin your career. It's not going to teach you bad habits. One person I know got a bonus based on a PySimpleGUI program he wrote. - -***How about success being the goal?*** Spend time polishing your GUI and working on your primary code instead of struggling your way through the mountains of documentation in the Qt library, trying to set the color of something. How about getting your program done, working, and in use? - -Start with PySimpleGUI, then in the future if you want to code directly in Qt, it's not like you won't be able to learn something else due to your PySimpleGUI knowledge. Unable to write a `while` loop because you already learned using a `for` loop? That seems to be the logic. - -If anything, you'll have more knowledge than most people that are just starting because you'll have already built working GUIs, perhaps many of them and understand how to layout an efficient interface as well as having a good education in GUI Widgets and how they work. - -Here are the forces likely at work.... said Troll has been programming for a while now and really knows these GUI frameworks. Probably invested a lot of hours learning them and thus has some marketable skills (yes, follow the money). - -Enter snotty-nosed high-shool or first year programmer using PySimpleGUI that manages to make GUI windows with great ease... that look, well, pretty much the **same** as the windows Sir Troll ***was*** used to getting paid big bucks to make. What used to be a skill only a select few can do, now 1,000's, 10,000's, or 100,000s more programmers can do, quicker and easier. Bummer Mr. Troll. Bummer. - -"***It's supposed to be difficult to write a GUI***" was an actual reason listed why not to use PySimpleGUI by one person offering to help junior programmers learn Qt. Really? It's supposed to be difficult. Huh. Well, not in this Python universe. Maybe in C++ world it works that way?? - -Just know you're safe in trying and possibly even succeeding in the process. - - ### Target Audience PySimpleGUI is trying to serve the 80% of GUI *problems*. The other 20% go straight to tkinter, Qt, WxPython, Remi, or whatever fills that need. That 80% is **a huge problem space**. @@ -764,7 +743,7 @@ Or how about a ***custom GUI*** in 1 line of code? No kidding this is a valid p ```python import PySimpleGUI as sg -event, values = sg.Window('Get filename example', [[sg.Text('Filename')], [sg.Input(), sg.FileBrowse()], [sg.OK(), sg.Cancel()] ]).Read() +event, values = sg.Window('Get filename example', [[sg.Text('Filename')], [sg.Input(), sg.FileBrowse()], [sg.OK(), sg.Cancel()] ]).read(close=True) ``` ![get filename](https://user-images.githubusercontent.com/13696193/44960039-f1018880-aec5-11e8-8a43-3d7f8ff93b67.jpg) @@ -795,7 +774,7 @@ layout = [ [sg.Text('Filename')], window = sg.Window('Get filename example', layout) -event, values = window.Read() +event, values = window.read() window.close() ``` @@ -874,9 +853,9 @@ Beautiful windows are created, not simply given to you. There are people that d Some of these have been "polished", others like the Matplotlib example is more a functional example to show you it works. -![batterup2](https://user-images.githubusercontent.com/13696193/50378902-6aa2bb00-060a-11e9-8f2f-d746694fa4ee.gif) +![batterup](https://user-images.githubusercontent.com/46163555/77781297-b624ef80-702b-11ea-857a-b0809f061dc9.png) -![uno_final](https://user-images.githubusercontent.com/13696193/49945232-67952580-feba-11e8-90c8-7dc31c5f7c67.gif) +![Uno](https://user-images.githubusercontent.com/46163555/77781360-d05ecd80-702b-11ea-90f9-cb9fb3339c05.png) This chess program is capable of running multiple AI chess engines and was written by another user using PySimpleGUI. @@ -902,7 +881,7 @@ In release 4.9 another 32 Color Themes were added... here are the current choice Make beautiful looking, alpha-blended (partially transparent) Rainmeter-style Desktop Widgets that run in the background. -![cpu cores dashboard 2](https://user-images.githubusercontent.com/13696193/47611749-18964c80-da42-11e8-93c4-6821a6fce488.gif) +![cpumeter](https://user-images.githubusercontent.com/46163555/77781418-ec626f00-702b-11ea-90b3-668fb71d63b5.png) Want to build a Crossword Puzzle? No problem, the drawing primitives are there for you. @@ -943,7 +922,7 @@ It's possible to create some cool games by simply using the built-in PySimpleGUI Games haven't not been explored much, yet, using PySimpleGUI. -![pong](https://user-images.githubusercontent.com/13696193/45860012-2d8d0b00-bd33-11e8-9efd-3eaf4c30f324.gif) +![pong](https://user-images.githubusercontent.com/46163555/77781526-1c117700-702c-11ea-901b-4cb5f7a34cb4.png) # Windows Programs That Look Like Windows Programs @@ -956,7 +935,7 @@ Combining PySimpleGUI with PyInstaller creates something truly remarkable and sp The application you see below with a working menu was created in 20 lines of Python code. It is a single .EXE file that launches straight into the screen you see. And more good news, the only icon you see on the taskbar is the window itself... there is no pesky shell window. Nice, huh? -![menu demo](https://user-images.githubusercontent.com/13696193/45923097-8fbc4c00-beaa-11e8-87d2-01a5331811c8.gif) +![windowsprogram](https://user-images.githubusercontent.com/46163555/77781479-03a15c80-702c-11ea-9408-903e022e0418.png) With a simple GUI, it becomes practical to "associate" .py files with the python interpreter on Windows. Double click a py file and up pops a GUI window, a more pleasant experience than opening a dos Window and typing a command line. @@ -987,9 +966,9 @@ This meant classes could be used to build and use it, but classes can not be par What about those pesky callbacks? They're difficult for beginners to grasp and they're a bit of a pain in the ass to deal with. The way PySimpleGUI got around events was to utilize ***a "message passing" architecture*** instead. -Instead of a user function being called when there's some event, instead the information is "passed" to the user when they call the function `Window.Read()` +Instead of a user function being called when there's some event, instead the information is "passed" to the user when they call the function `Window.read()` -***Everything*** is returned through this `Window.Read` call. Of course the underlying GUI frameworks still perform callbacks, but they all happen inside of PySimpleGUI where they are turned into messages to pass to you. +***Everything*** is returned through this `Window.read` call. Of course the underlying GUI frameworks still perform callbacks, but they all happen inside of PySimpleGUI where they are turned into messages to pass to you. All of the boilerplate code, the event handling, widget creation, frames containing widgets, etc, are **exactly the same** objects and calls that you would be writing if you wrote directly in tktiner, Qt, etc. With all of this code out of the way and done for you, that leaves you with the task of doing something useful with the information the user entered. THAT, afterall, is the goal here.... getting user information and acting on it. @@ -1222,19 +1201,68 @@ Like above, you may have to install either pip or tkinter. To do this on Python `sudo apt install python-tkinter` +### Upgrading from GitHub Using PySimpleGUI + +Starting in version 4.17.0 there is code in the PySimpleGUI package that upgrades your previously pip installed package using the latest version checked into GitHub. + +Previously if you wanted to run the GitHub version, you would: +* Download the PySimpleGUI.py file from GitHub +* Place it in your applications's folder + +This required you to go back later and delete this file when you want to move on to the next version released to PyPI. + +The new capability is the ability to overwrite your PySimpleGUI.py file that you installed using `pip` with the currently posted version on GitHub. Using this method when you're ready to install the next version from PyPI or you want to maybe roll back to a PyPI release, you only need to run `pip`. You don't have to find and delete any PySimpleGUI.py files. + +***Important - Linux Users*** - There is currently a problem using this utility on Linux systems. It's being worked on and a patch will be released as soon as something is figured out. + + +#### Command Line Upgrade + +To upgrade PySimpleGUI from the command line type this command into your dos window + +`python -m PySimpleGUI upgrade` + +You will first be shown a confirmation window: + +![image](https://user-images.githubusercontent.com/46163555/77477572-f0f01300-6df2-11ea-812f-98a36e7c28e0.png) + +If you choose yes, then the new version will be installed and you'll see a red "completed" window + + +![image](https://user-images.githubusercontent.com/46163555/77477619-006f5c00-6df3-11ea-8b01-44b1bea22989.png) + + +#### GUI Upgrade + +The PySimpleGUI Test Harness is another mechanism you can use to upgrade. To start the test harness you "run" the PySimpleGUI package. + +`python -m PySimpleGUI.PySimpleGUI` + +Of course if you're running Linux you may run `python3` instead. + +From your code you can call `PySimpleGUI.main()`. This window may not look exactly like the one you see, but the thing that should be there is the red "Install" button. + +![image](https://user-images.githubusercontent.com/46163555/77478381-437dff00-6df4-11ea-994e-a443ff967917.png) + + +Clicking the install button will bring up the same confirmation window shown as the command line upgrade above. + ### Testing your installation and Troubleshooting Once you have installed, or copied the .py file to your app folder, you can test the installation using python. At the command prompt start up Python. #### The Quick Test -From your commant line type: -`python -m PySimpleGUI` +The PySimpleGUI Test Harness pictured in the previous section on GUI upgrades is the short program that's built into PySimpleGUI that serves multiple purposes. It exercises many/most of the available Elements, displays version and location data and works as a quick self-test. -Of course if you're on Linux/Mac and need to run using the command `python3` then of course type that. +From your command line type: +`python -m PySimpleGUI.PySimpleGUI` -This will display the same window as these instructions: +If you're on Linux/Mac and need to run using the command `python3` then of course type that. +This will display the test harnes window. + +You can also test by using the REPL.... #### Instructions for Testing Python 2.7: ```python @@ -1339,6 +1367,13 @@ See.... written with the "Developer" in mind, at all times. It's about YOU, Mr/ The other ports of PySimpleGUI (Qt, WxPython, Web) have not yet had their docstrings updated. They're NEXT in line to be better documented. Work on a tool has already begun to make that happen sooner than later. +#### Type Checking With Docstrings + +In version 4.17.0 a new format started being used for docstrings. This new format more clearly specified the types for each parameter. It will take some time to get all of the parameter types correctly identied and documented. + +Pay attention when you're working with PyCharm and you'll see where you may have a mismatch... or where there's a bad docstring, take your pick. It will shade your code in a way that makes mismatched types very clear to see. + + ## Using - Python 3 To use in your code, simply import.... @@ -1358,7 +1393,10 @@ Yes, it's just that easy to have a window appear on the screen using Python. Wi If you must run 3.7, try 3.7.2. It does work with PySimpleGUI with no known issues. -***PySimpleGUI with Python 3.7.3 and 3.7.4+.*** tkinter is having issues with all the newer releases. Things like Table colors stopped working entirely. It's unclear if there's been a change that makes the tkinter API no longer working which means they are not backwards compatible. That would be a real shame. If so, more work needs to be done in PySimpleGUI +***PySimpleGUI with Python 3.7.3 and 3.7.4+.*** tkinter is having issues with all the newer releases. Things like Table colors stopped working entirely. + +March 2020 - Still not quite sure if all issues have been ironed out with tkinter in the 3.7 and 3.8 releases. + ## Python 2.7 diff --git a/readme_creator/2_readme.md b/readme_creator/2_readme.md index b666b353..62ffd4d3 100644 --- a/readme_creator/2_readme.md +++ b/readme_creator/2_readme.md @@ -56,7 +56,7 @@ For the time being, class variables will remain the way they are currently. It # 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. +"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. @@ -64,28 +64,51 @@ When you've reached the point with Popups that you are thinking of filing a GitH 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. +But, for now, let's stick with these 1-line window calls, the Popups. This is the list of popup calls available to you: + +popup_animated +popup_annoying +popup_auto_close +popup_cancel +popup_error +popup_get_file +popup_get_folder +popup_get_text +popup_no_border +popup_no_buttons +popup_no_frame +popup_no_titlebar +popup_no_wait +popup_notify +popup_non_blocking +popup_ok +popup_ok_cancel +popup_quick +popup_quick_message +popup_scrolled +popup_timed +popup_yes_no ## 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. +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. +`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). +There are a number of Popup output calls, each with a slightly different look or functionality (e.g. different button labels, window options). The list of Popup output functions are: -- Popup -- PopupOk -- PopupYesNo -- PopupCancel -- PopupOkCancel -- PopupError -- PopupTimed, PopupAutoClose -- PopupNoWait, PopupNonBlocking +- popup +- popup_ok +- popup_yes_no +- popup_cancel +- popup_ok_cancel +- popup_error +- popup_timed, popup_auto_close, popup_quick, popup_quick_message +- popup_no_waitWait, popup_non_blocking 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. @@ -96,14 +119,14 @@ The function `PopupTimed` or `PopupAutoClose` are popup windows that will automa 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 +sg.popup('Popup') # Shows OK button +sg.popup_ok('PopupOk') # Shows OK button +sg.popup_yes_no('PopupYesNo') # Shows Yes and No buttons +sg.popup_cancel('PopupCancel') # Shows Cancelled button +sg.popup_ok_cancel('PopupOKCancel') # Shows OK and Cancel buttons +sg.popup_error('PopupError') # Shows red error button +sg.popup_timed('PopupTimed') # Automatically closes +sg.popup_auto_close('PopupAutoClose') # Same as PopupTimed ``` Preview of popups: @@ -125,11 +148,8 @@ Preview of popups: The other output Popups are variations on parameters. Usually the button_type parameter is the primary one changed. +The choices for button_type are (you should not specify these yourself however): - -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 @@ -139,79 +159,82 @@ 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. +**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 `popup_yes_no` will set the button type to POPUP_BUTTONS_YES_NO for you. - - - - -#### Scrolled Output +### Scrolled Output There is a scrolled version of Popups should you have a lot of information to display. - + - -```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) +sg.popup_scrolled(my_text) ``` ![scrolledtextbox 2](https://user-images.githubusercontent.com/13696193/43667324-712aa0d4-9745-11e8-83a9-a0d0570d0865.jpg) -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. +The `popup_scrolled` 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))` +`sg.popup_scrolled(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 +### Non-Blocking Popups - popup_no_wait and the non_blocking parameter - + - -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. +The Popup call PopupNoWait or PopupNonBlocking will create a popup window and then immediately return control back to you. You can turn other popup calls into non-blocking popups if they have a `non_blocking` parameter. Setting `non_blocking` to True will cause the function to return immediately rather than waiting for the window to be closed. 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 Parameter Combinations + +So that you don't have to specify a potentially long list common parameters there are a number of popup functions that set combinations of parameters. For example `popup_quick_message` will show a non-blocking popup that autocloses and does not have a titlebar. You could achieve this same end result using the plain `popup` call. + + + ## 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 + +There are Popup calls for single-item inputs. These follow the pattern of `popup_get` followed by the type of item to get. There are 3 of these input Popups to choose from, each with settings enabling customization. + +- `popup_get_text` - get a single line of text +- `popup_get_file` - get a filename +- `popup_get_folder` - 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 + + +### popup_get_text Use this Popup to get a line of text from the user. - + ```python import PySimpleGUI as sg -text = sg.PopupGetText('Title', 'Please input something') -sg.Popup('Results', 'The value returned from PopupGetText', text) +text = sg.popup_get_text('Title', 'Please input something') +sg.popup('Results', 'The value returned from PopupGetText', text) ``` ![popupgettext](https://user-images.githubusercontent.com/13696193/44957281-8721b880-ae9e-11e8-98cd-d06369f4187e.jpg) ![popup gettext response](https://user-images.githubusercontent.com/13696193/44957282-8721b880-ae9e-11e8-84ae-dc8bb30504a0.jpg) -### 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. +### popup_get_file - +Gets one or more filenames from the user. There are options to configure the type of dialog box to show. Normally an "Open File" dialog box is shown. + + If configured as an Open File Popup then (save_as is not True) the dialog box will look like this. @@ -227,34 +250,34 @@ If you choose a filename that already exists, you'll get a warning popup box ask A typical call produces this window. ```python -text = sg.PopupGetFile('Please enter a file name') -sg.Popup('Results', 'The value returned from PopupGetFile', text) +text = sg.popup_get_file('Please enter a file name') +sg.popup('Results', 'The value returned from PopupGetFile', text) ``` ![popupgetfile](https://user-images.githubusercontent.com/13696193/44957857-2fd31680-aea5-11e8-8eb7-f6b91c202cc8.jpg) -### PopupGetFolder +### popup_get_folder 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. - + This is a typpical call ```python - text = sg.PopupGetFolder('Please enter a folder name') - sg.Popup('Results', 'The value returned from PopupGetFolder', text) + text = sg.popup_get_folder('Please enter a folder name') + sg.popup('Results', 'The value returned from PopupGetFolder', text) ``` ![popupgetfolder](https://user-images.githubusercontent.com/13696193/44957861-45484080-aea5-11e8-926c-cf607a45251c.jpg) -### PopupAnimated +### popup_animated ![ring](https://user-images.githubusercontent.com/13696193/51296743-6ee4ad00-19eb-11e9-91f5-cd8086ad1b50.gif) 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. - + ***To close animated popups***, call PopupAnimated with `image_source=None`. This will close all of the currently open PopupAnimated windows. @@ -263,25 +286,13 @@ The animated Popup enables you to easily display a "loading" style animation spe # 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') + sg.one_line_progress_meter('My Meter', i+1, 10000, 'key','Optional message') ``` That line of code resulted in this window popping up and updating. @@ -293,12 +304,12 @@ With a little trickery you can provide a way to break out of your loop using the ***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) +# Debug Output (easy_print = 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 +print = sg.Print ``` at the top of your code. @@ -321,16 +332,22 @@ import PySimpleGUI as sg print=sg.Print for i in range(100): -print(i) + 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`. +Just like the standard print call, `easy_print` supports the `sep` and `end` keyword arguments. Other names that can be used to call `easy_print` include `Print`, `eprint`, If you want to close the window, call the function `easy_print_close`. -You can change the size of the debug window using the `SetOptions` call with the `debug_win_size` parameter. +You can change the size of the debug window using the `set_options` 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. +There is an option to tell PySimpleGUI to reroute all of your stdout and stderr output to this window. To do so call easy_print 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 `easy_print_close()` or `PrintClose()` + + +### Printing To Multiline Elements + +Another technique for outputting information that you would normally print is to use the function `Multiline.print`. You'll find it discussed further into this document. The basic idea is that you can easily modify your normal `print` calls to route your printed information to your 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) @@ -341,7 +358,7 @@ This first section on custom windows is for your typical, blocking, non-persiste 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)` +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". @@ -410,7 +427,7 @@ layout = [[sg.Text('Enter a Number')], [sg.Input()], [sg.OK()] ] -event, values = sg.Window('Enter a number example', layout).Read() +event, values = sg.Window('Enter a number example', layout).read() sg.Popup(event, values[0]) ``` @@ -796,12 +813,12 @@ By default return values are a list of values, one entry for each input field, b 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() +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, values = sg.Window('My title', window_rows).read() event, value_list = window.read() value1 = value_list[0] value2 = value_list[1] @@ -820,7 +837,7 @@ For windows longer than 3 or 4 fields you will want to use a dictionary to help The most common window read statement you'll encounter looks something like this: -`window = sg.Window("My title", layout).Read()` +`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`. @@ -955,7 +972,7 @@ Clicking the Submit button caused the window call to return. The call to Popup **`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. +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. @@ -1020,7 +1037,7 @@ event, values = window.read() A non-blocking / Async Read call looks like this: ```python -event, values = window.Read(timeout=100) +event, values = window.read(timeout=100) ``` You can learn more about these async / non-blocking windows toward the end of this document. @@ -1107,7 +1124,7 @@ The first step is to create the window object using the desired window customiza 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. +**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 @@ -1411,7 +1428,7 @@ If you really wanted to crunch things down, you can make it a 2 line program (an ```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() +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() ``` @@ -1730,6 +1747,26 @@ If the element is one of the input elements (one that will cause an generate an 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. +### `WRITE_ONLY_KEY` Modifier + +Sometimes you have input elements (e.g. `Multiline`) that you are using as an output. The contents of these elements may get very long. You don't need ot "read" these elements and doing so will potentially needlessly return a lot of data. + +To tell PySimpleGUI that you do not want an element to return a value when `Window.read` is called, add the string `WRITE_ONLY_KEY` to your key name. + +If your `Multiline` element was defined like this originally: + +```python +sg.Multiline(size=(40,8), key='-MLINE-') +``` + +Then to turn off return values for that element, the `Multiline` element would be written like this: + +```python +sg.Multiline(size=(40,8), key='-MLINE-' + sg.WRITE_ONLY_KEY) +``` + + + ## Common Element Parameters Some parameters that you will see on almost all Element creation calls include: @@ -1994,6 +2031,43 @@ layout = [[sg.Multiline('This is what a Multi-line Text Element looks like', siz ![multiline](https://user-images.githubusercontent.com/13696193/44959853-b139a180-aec3-11e8-972f-f52188510c88.jpg) +This element has been expanded upon quite a bit over time. Two of the more exciting additions have been + +* Ability to output unique text and background colors on a per-character basis +* The `print` method that allows you to easily reroute your normally printed output to a multiline element instead + +The `Multiline.print()` call is made using the same element-lookup technique you're used to using to call `update`. One of these lookups generally appear: + +```python +window['-MULTILINE KEY-'] +``` + +To change one of your normal prints to output to your multiline element, you simply add the above lookup expression to the front of your print statement. + +```python +print('My variables are', a, b, c) # a normal print statement + +window['-MULTILINE KEY-'].print('My variables are', a, b, c) # Routed to your multiline element +``` + +It gets even better though.... you can add color to your prints + +```python +# Outputs red text on a yellow background +window['-MULTILINE KEY-'].print('My variables are', a, b, c, text_color='red', background_color='yellow') + +``` + + +### Redefine print + +Another way to use this print capability is to redefine the `print` statement itself. This will allow you to leave your code entirely as is. By adding this line of code your entire program will output all printed information to a multiline element. + +```python +print = lambda *args, **kwargs: window['-MULTILINE KEY-'].print(*args, **kwargs) +``` + + ## Text Input Element | `InputText == Input == In` @@ -2008,7 +2082,7 @@ 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. +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. @@ -2312,26 +2386,36 @@ All buttons can have their text changed by changing the `button_text` parameter 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_`" +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 is one of the quickest and easiest ways to transform tkinter from a "1990s looking GUI" into a "modern GUI". If you don't like the default buttons, then simply bring your own button images and use those instead. -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`. +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. You can get the theme's background color by calling `theme_background_color()` + +`TRANSPARENT_BUTTON` - **Important** - This is a legacy value that is misleading. It is currently defined as this constant value: ```python -sg.Button('Restart Song', button_color=sg.TRANSPARENT_BUTTON, +TRANSPARENT_BUTTON = ('#F0F0F0', '#F0F0F0') +``` + +As you can see it is simply a tuple of 2 gray colors. The effect is that the button text and the button background color to a specific shade of gray. Way back in time, before you could change the background colors and all windows were gray, this value worked. But now that your button can be on any background color, you'll want to set the buttons color to match the background so that your button blends with the background color. + +```python +sg.Button('Restart Song', button_color=(sg.theme_background_color(), sg.theme_background_color()), image_filename=image_restart, image_size=(50, 50), image_subsample=2, border_width=0) ``` -Three parameters are used for button images. + +There are several parameters in `Button` elements that are used for button images. ``` -image_filename - Filename. Can be a relative path -image_size - Size of image file in pixels +image_filename - Filename of image. Can be a relative path +image_data - A Base64 image +image_size - Size of image in pixels image_subsample - Amount to divide the size by. 2 means your image will be 1/2 the size. 3 means 1/3 ``` @@ -2340,15 +2424,18 @@ Here's an example window made with button images. ![media file player](https://user-images.githubusercontent.com/13696193/43161977-9ee7cace-8f57-11e8-8ff8-3ea24b69dab9.jpg) 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, +sg.Button('Pause', button_color=(sg.theme_background_color(), sg.theme_background_color()), 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. +Experimentation is sometimes required for these concepts to really sink in and they can vary depending on the underlying GUI framework. + +Button Images do work so play with them. You can use PIL to change the size of your images before passing to PySimpleGUI. ### Realtime Buttons @@ -2361,8 +2448,6 @@ This window has 2 button types. There's the normal "Read Button" (Quit) and 4 " Here is the code to make, show and get results from this window: - - ```python import PySimpleGUI as sg @@ -2384,15 +2469,15 @@ window = sg.Window('Robotics Remote Control', gui_rows) # your program's main loop while (True): # This is the code that reads and updates your window - event, values = window.Read(timeout=50) + event, values = window.read(timeout=50) print(event) if event in ('Quit', None): break -window.Close() # Don't forget to close your window! +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. +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 @@ -2513,7 +2598,7 @@ If you are looking for a way to quickly add the ability to show scrolling text w **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. +***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 @@ -2596,7 +2681,7 @@ layout = [[sg.Slider(range=(1,100), default_value=10, orientation='v', size=(8,2 window = sg.Window('Compact 1-line window with column', layout) event, values = window.read() -window.Close() +window.close() sg.Popup(event, values, line_width=200) @@ -2798,7 +2883,7 @@ Table and Tree Elements are of the most complex in PySimpleGUI. They have a lot ### `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 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 @@ -3317,7 +3402,7 @@ If you're using a read with a timeout value, then an event value of None signifi 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) + event, value = window.read(timeout=10) if event is None: break # the use has closed the window if event == sg.TIMEOUT_KEY: @@ -3360,7 +3445,7 @@ 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. + 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 @@ -3410,8 +3495,8 @@ 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.Button('Pause', key='button', button_color=('white', '#001480')), + sg.Button('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) @@ -3422,7 +3507,7 @@ paused = False start_time = int(round(time.time() * 100)) while (True): # --------- Read and update window -------- - event, values = window.Read(timeout=10) + 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, @@ -3777,7 +3862,7 @@ win1 = sg.Window('Window 1', layout) win2_active = False while True: - ev1, vals1 = win1.Read(timeout=100) + ev1, vals1 = win1.read(timeout=100) win1['-OUTPUT-'].update(vals1[0]) if ev1 is None or ev1 == 'Exit': break @@ -3790,10 +3875,10 @@ while True: win2 = sg.Window('Window 2', layout2) if win2_active: - ev2, vals2 = win2.Read(timeout=100) + ev2, vals2 = win2.read(timeout=100) if ev2 is None or ev2 == 'Exit': win2_active = False - win2.Close() + win2.close() ``` @@ -3812,7 +3897,7 @@ layout = [[ sg.Text('Window 1'),], win1 = sg.Window('Window 1', layout) win2_active=False while True: - ev1, vals1 = win1.Read(timeout=100) + ev1, vals1 = win1.read(timeout=100) if ev1 is None: break win1.FindElement('-OUTPUT-').update(vals1[0]) @@ -3825,9 +3910,9 @@ while True: win2 = sg.Window('Window 2', layout2) while True: - ev2, vals2 = win2.Read() + ev2, vals2 = win2.read() if ev2 is None or ev2 == 'Exit': - win2.Close() + win2.close() win2_active = False win1.UnHide() break @@ -3886,7 +3971,7 @@ while True: To this non-blocking: ```python while True: - event, values = window.Read(timeout=200) + event, values = window.read(timeout=200) if event == sg.TIMEOUT_KEY: continue ``` @@ -3897,7 +3982,7 @@ This timeout value of 200 means that your debugger GUI will be updated 5 times a ### 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. +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. @@ -3913,13 +3998,13 @@ 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) + event, values = window.read(timeout=500) if event == sg.TIMEOUT_KEY: continue if event is None: break print(event, values) -window.Close() +window.close() ``` ## Debugger Windows @@ -3982,7 +4067,7 @@ There are 3 ways to open the Main Debugger Window ![SNAG-0440](https://user-images.githubusercontent.com/13696193/62797391-a01ceb80-baa9-11e9-845d-3cd02ca0dbcc.jpg) -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`. +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. @@ -4005,7 +4090,7 @@ In this example the Custom Watch entered was `values[0]`. After clicking on the ![SNAG-0444](https://user-images.githubusercontent.com/13696193/62797514-e8d4a480-baa9-11e9-9a86-cfe99342dedb.jpg) -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. +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. @@ -5494,7 +5579,7 @@ Without further delay... here are all of the Elements and the Window class ### update -## SystemTray Element +## SystemTray @@ -5606,21 +5691,18 @@ Without further delay... here are all of the Elements and the Window class - ### FindKeyFromTabName ### Get - ### SetFocus ### SetTooltip - ### bind @@ -5807,7 +5889,7 @@ Without further delay... here are all of the Elements and the Window class ### update -## TreeData Element +## TreeData (for Tree Element) @@ -6152,7 +6234,6 @@ Without further delay... here are all of the Elements and the Window class - diff --git a/readme_creator/4_Release_notes.md b/readme_creator/4_Release_notes.md index ba42b96c..cd63aace 100644 --- a/readme_creator/4_Release_notes.md +++ b/readme_creator/4_Release_notes.md @@ -1093,7 +1093,7 @@ Quick patch to remove change to popup Quick patch to remove f-string for 3.5 compat. -## 4.16.0 PySimpleGUI 08-Jan-2020 +## 4.16.0 PySimpleGUI 20-Feb-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 @@ -1124,6 +1124,55 @@ Note - there is a known problem with the built-in debugger created when the new * print_to_element - print-like call that can be used to output to a Multiline element as if it is an Output element +## 4.17.0 PySimpleGUI 24-Mar-2020 + +The "it's been a minute" release +Improved DocStrings and documentation! +Upgrade utility +"Printing" directly to Multiline + +* New upgrade utility to upgrade your installed package using GitHub version + * Can invoke from command line. Run `python -m PySimpleGUI.PySimpleGUI upgrade` + * The test harness GUI has an upgrade button +* Multiline.print - Add multiline element to the front of any print statement. Also supports color output +* Debug informmation like path and version displayed in test harness GUI +* Added back the TRANSPARENT_BUTTON variable until can find a better way to deprecate +* All elements were losing padding when made invisible. Fixed +* Image.update - fixed crash due to not checking for type before getting size +* Image.update_animation_no_buffering - playback GIF animations of any length +* Graph element - Fixed divide by zero error in convert function +* TabGroup will now autonumber keys if none specified +* Measuring strings more accurately during layout + * Using specific font for measurement + * Used to compute TTK button height + * Used to compute Slider length + * Used to compute header widths in Tables, Trees + * Used to compute column widths in Tables, Trees + * Used to compute row heights in Tables +* Removed padx from row frames. Was using window's margins. Now padx & pady = 0. Was causing too every Column element to have extra padding +* Added no_titlebar to one line progress meter +* popup_notify - Creates a "notification window" that is like the System Tray Message window +* shell_with_animation - launch a shell command that runs while an animated GIF is shown +* Fixed problem with debugger not working after the recent close parameter addition to Window.read + + +## 4.18.0 PySimpleGUI 26-Mar-2020 + +An "Oh F**k" Release - Table column sizes were bad + +* Fixed bug in Table Element's column size computation +* popup_animated has new title parameter +* Checkbox - update can change the text + + +## 4.18.1 PySimpleGUI 12-Apr-2020 + +Emergency patch - f-string managed to get into the code resulting crashes on 3.5 systems (Pi's for example) + +## 4.18.2 PySimpleGUI 12-Apr-2020 + +The Epic Fail release.... import error on 3.5 for subprocess. + ### Upcoming diff --git a/readme_creator/Makefile b/readme_creator/Makefile new file mode 100644 index 00000000..3be31754 --- /dev/null +++ b/readme_creator/Makefile @@ -0,0 +1,9 @@ +build: + python3 make_real_readme.py + rm usage.log.txt + +build2: + python3 make_real_readme.py + +clean: + rm usage.log.txt diff --git a/readme_creator/PySimpleGUIlib.py b/readme_creator/PySimpleGUIlib.py index a7cb340f..11dd805c 100644 --- a/readme_creator/PySimpleGUIlib.py +++ b/readme_creator/PySimpleGUIlib.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 -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" +version = __version__ = "4.18.0 Released 26 Mar 2020" port = 'PySimpleGUI' @@ -222,7 +222,8 @@ def _timeit_summary(func): Code I write now, outside PySimpleGUI, IS PEP8 compliant. The variable and function naming in particular are not compliant. There is - liberal use of CamelVariableAndFunctionNames. If you've got a serious enough problem with this + liberal use of CamelVariableAndFunctionNames, but for anything externally facing, there are aliases + available for all functions. If you've got a serious enough problem with 100% PEP8 compliance that you'll pass on this package, then that's your right and I invite you to do so. However, if perhaps you're a practical thinker where it's the results that matter, then you'll have no trouble with this code base. There is consisency however. @@ -276,6 +277,7 @@ OFFICIAL_PYSIMPLEGUI_BUTTON_COLOR = ('white', BLUES[0]) CURRENT_LOOK_AND_FEEL = 'DarkBlue3' + DEFAULT_ERROR_BUTTON_COLOR = ("#FFFFFF", "#FF0000") DEFAULT_BACKGROUND_COLOR = None DEFAULT_ELEMENT_BACKGROUND_COLOR = None @@ -297,6 +299,9 @@ DEFAULT_SCROLLBAR_COLOR = None # 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 = ('#F0F0F0', '#F0F0F0') # Use (sg.theme_background_color(), sg.theme_background_color()) instead!!! + # -------------------------------------------------------------------------------- # Progress Bar Relief Choices RELIEF_RAISED = 'raised' @@ -596,7 +601,7 @@ class Element(): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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) @@ -1052,7 +1057,7 @@ class InputText(Element): :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) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :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. @@ -1182,7 +1187,7 @@ class Combo(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -1331,7 +1336,7 @@ class OptionMenu(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -1441,7 +1446,7 @@ class Listbox(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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. @@ -1636,7 +1641,7 @@ class Radio(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -1766,7 +1771,7 @@ class Checkbox(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -1811,12 +1816,14 @@ class Checkbox(Element): """ return self.TKIntVar.get() - def Update(self, value=None, background_color=None, text_color=None, disabled=None, visible=None): + def Update(self, value=None, text=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: if True checks the checkbox, False clears it :type value: (bool) + :param text: Text to display next to checkbox + :type text: (str) :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 @@ -1840,6 +1847,9 @@ class Checkbox(Element): self.TKCheckbutton.configure(state='disabled') elif disabled == False: self.TKCheckbutton.configure(state='normal') + if text is not None: + self.Text = str(text) + self.TKCheckbutton.configure(text=self.Text) if background_color is not None: self.TKCheckbutton.configure(background=background_color) self.BackgroundColor = background_color @@ -1917,7 +1927,7 @@ class Spin(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -2054,7 +2064,7 @@ class Multiline(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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. @@ -2224,7 +2234,7 @@ class Text(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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. @@ -2329,7 +2339,7 @@ class StatusBar(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -2511,7 +2521,7 @@ class TKOutput(tk.Frame): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) """ self.frame = tk.Frame(parent) tk.Frame.__init__(self, self.frame) @@ -2587,7 +2597,7 @@ class Output(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -2612,6 +2622,12 @@ class Output(Element): @property def TKOut(self): + """ + Returns the TKOutput object used to create the element + + :return: The TKOutput object + :rtype: (TKOutput) + """ 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() ***') @@ -2645,7 +2661,7 @@ class Output(Element): """ return self._TKOut.output.get(1.0, tk.END) - def expand(self, expand_x=False, expand_y=False): + def expand(self, expand_x=False, expand_y=False, expand_row=True): """ Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -2666,7 +2682,7 @@ class Output(Element): self._TKOut.output.pack(expand=True, fill=fill) self._TKOut.frame.pack(expand=True, fill=fill) - self.ParentRowFrame.pack(expand=True, fill=fill) + self.ParentRowFrame.pack(expand=expand_row, fill=fill) def __del__(self): """ @@ -2741,7 +2757,7 @@ class Button(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -3111,7 +3127,7 @@ class ButtonMenu(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -3230,7 +3246,7 @@ class ProgressBar(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param visible: set visibility state of the element :type visible: (bool) :param metadata: User metadata that can be set to ANYTHING @@ -3317,7 +3333,7 @@ class Image(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -3515,7 +3531,7 @@ class Canvas(Element): :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 - :type pad: int + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),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 @@ -3538,6 +3554,12 @@ class Canvas(Element): @property def TKCanvas(self): + """ + Returns the underlying tkiner Canvas widget + + :return: The tkinter canvas widget + :rtype: (tk.Canvas) + """ 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) ***') @@ -3577,7 +3599,7 @@ class Graph(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -3627,8 +3649,12 @@ class Graph(Element): """ if None in (x_in, y_in): return None, None - scale_x = (self.CanvasSize[0] - 0) / (self.TopRight[0] - self.BottomLeft[0]) - scale_y = (0 - self.CanvasSize[1]) / (self.TopRight[1] - self.BottomLeft[1]) + try: + scale_x = (self.CanvasSize[0] - 0) / (self.TopRight[0] - self.BottomLeft[0]) + scale_y = (0 - self.CanvasSize[1]) / (self.TopRight[1] - self.BottomLeft[1]) + except: + scale_x = scale_y = 0 + new_x = 0 + scale_x * (x_in - self.BottomLeft[0]) new_y = self.CanvasSize[1] + scale_y * (y_in - self.BottomLeft[1]) return new_x, new_y @@ -4130,6 +4156,12 @@ class Graph(Element): @property def TKCanvas(self): + """ + Returns the underlying tkiner Canvas widget + + :return: The tkinter canvas widget + :rtype: (tk.Canvas) + """ 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() ***') @@ -4249,7 +4281,7 @@ class Frame(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -4417,7 +4449,7 @@ class VerticalSeparator(Element): def __init__(self, pad=None): """ :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) """ self.Orientation = 'vertical' # for now only vertical works @@ -4455,7 +4487,7 @@ class Tab(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -4663,7 +4695,7 @@ class TabGroup(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -4882,7 +4914,7 @@ class Slider(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -5106,7 +5138,7 @@ class Column(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -5285,7 +5317,7 @@ class Pane(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -5602,7 +5634,7 @@ class Menu(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -5746,7 +5778,7 @@ class Table(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -5978,7 +6010,7 @@ class Tree(Element): :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((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 @@ -6818,6 +6850,9 @@ class Window: :return: (event, values) :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: + _refresh_debugger() results = self._read(timeout=timeout, timeout_key=timeout_key) if close: self.close() @@ -6840,9 +6875,7 @@ class Window: :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: - _refresh_debugger() + timeout = int(timeout) if timeout is not None else None if timeout == 0: # timeout of zero runs the old readnonblocking event, values = self._ReadNonBlocking() @@ -8151,7 +8184,7 @@ def FileBrowse(button_text='Browse', target=(ThisRow, -1), file_types=(("ALL Fil :param disabled: set disable state for element (Default = False) :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :return: returns a button @@ -8191,7 +8224,7 @@ def FilesBrowse(button_text='Browse', target=(ThisRow, -1), file_types=(("ALL Fi :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :return: returns a button @@ -8229,7 +8262,7 @@ def FileSaveAs(button_text='Save As...', target=(ThisRow, -1), file_types=(("ALL :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :return: returns a button @@ -8267,7 +8300,7 @@ def SaveAs(button_text='Save As...', target=(ThisRow, -1), file_types=(("ALL Fil :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)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :return: returns a button @@ -8300,7 +8333,7 @@ def Save(button_text='Save', size=(None, None), auto_size_button=None, button_co :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 in pixels (left/right, top/bottom) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :return: returns a button @@ -8332,7 +8365,7 @@ def Submit(button_text='Submit', size=(None, None), auto_size_button=None, butto :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 in pixels (left/right, top/bottom) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :return: returns a button @@ -8365,7 +8398,7 @@ def Open(button_text='Open', size=(None, None), auto_size_button=None, button_co :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 in pixels (left/right, top/bottom) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] @@ -8396,7 +8429,7 @@ def OK(button_text='OK', size=(None, None), auto_size_button=None, button_color= :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 in pixels (left/right, top/bottom) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :return: returns a button @@ -8428,7 +8461,7 @@ def Ok(button_text='Ok', size=(None, None), auto_size_button=None, button_color= :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 in pixels (left/right, top/bottom) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :return: returns a button @@ -8460,7 +8493,7 @@ def Cancel(button_text='Cancel', size=(None, None), auto_size_button=None, butto :param 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) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] @@ -8491,7 +8524,7 @@ def Quit(button_text='Quit', size=(None, None), auto_size_button=None, button_co :param 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) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :return: returns a button @@ -8523,7 +8556,7 @@ def Exit(button_text='Exit', size=(None, None), auto_size_button=None, button_co :param 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) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] @@ -8554,7 +8587,7 @@ def Yes(button_text='Yes', size=(None, None), auto_size_button=None, button_colo :param 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) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :return: returns a button @@ -8586,7 +8619,7 @@ def No(button_text='No', size=(None, None), auto_size_button=None, button_color= :param 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) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] @@ -8617,7 +8650,7 @@ def Help(button_text='Help', size=(None, None), auto_size_button=None, button_co :param 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) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :return: returns a button @@ -8649,7 +8682,7 @@ def Debug(button_text='', size=(None, None), auto_size_button=None, button_color :param 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) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :return: returns a button @@ -8689,7 +8722,7 @@ def SimpleButton(button_text, image_filename=None, image_data=None, image_size=( :type disabled: (bool) :param focus: if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :return: returns a button @@ -8730,7 +8763,7 @@ def CloseButton(button_text, image_filename=None, image_data=None, image_size=(N :type disabled: (bool) :param focus: if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :return: returns a button @@ -8774,7 +8807,7 @@ def ReadButton(button_text, image_filename=None, image_data=None, image_size=(No :type disabled: (bool) :param focus: if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] @@ -8818,7 +8851,7 @@ def RealtimeButton(button_text, image_filename=None, image_data=None, image_size :param 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) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] @@ -8858,7 +8891,7 @@ def DummyButton(button_text, image_filename=None, image_data=None, image_size=(N :param 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) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :return: returns a button @@ -8904,7 +8937,7 @@ def CalendarButton(button_text, target=(None, None), close_when_date_chosen=True :param 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) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :param locale: @@ -8954,7 +8987,7 @@ def ColorChooserButton(button_text, target=(None, None), image_filename=None, im :param 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) - :type pad: (int, int) or ((int,int),(int,int)) + :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) :param key: key for uniquely identify this element (for window.FindElement) :type key: Union[str, int, tuple] :return: returns a button @@ -9817,7 +9850,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 * _char_width_in_pixels(font)) + button_style.configure(style_name, padding=height * _char_width_in_pixels(font)) # should this be height instead? 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 @@ -10331,7 +10364,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): photo = tk.PhotoImage(data=element.Data) else: photo = None - print('*ERROR laying out form.... Image Element has no image specified*') + # print('*ERROR laying out form.... Image Element has no image specified*') if photo is not None: if element_size == ( @@ -10353,19 +10386,20 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): element.tktext_label.image = photo # tktext_label.configure(anchor=tk.NW, image=photo) element.tktext_label.pack(side=tk.LEFT, padx=elementpad[0], pady=elementpad[1]) - if element.Visible is False: - element.tktext_label.pack_forget() - if element.Tooltip is not None: - element.TooltipObject = ToolTip(element.tktext_label, text=element.Tooltip, - timeout=DEFAULT_TOOLTIP_TIME) - if element.EnableEvents: - element.tktext_label.bind('', element._ClickHandler) - if element.RightClickMenu or toplevel_form.RightClickMenu: - menu = element.RightClickMenu or toplevel_form.RightClickMenu - top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False) - AddMenuItem(top_menu, menu[1], element) - element.TKRightClickMenu = top_menu - element.tktext_label.bind('', element._RightClickMenuCallback) + + if element.Visible is False: + element.tktext_label.pack_forget() + if element.Tooltip is not None: + element.TooltipObject = ToolTip(element.tktext_label, text=element.Tooltip, + timeout=DEFAULT_TOOLTIP_TIME) + if element.EnableEvents: + element.tktext_label.bind('', element._ClickHandler) + if element.RightClickMenu or toplevel_form.RightClickMenu: + menu = element.RightClickMenu or toplevel_form.RightClickMenu + top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False) + AddMenuItem(top_menu, menu[1], element) + element.TKRightClickMenu = top_menu + element.tktext_label.bind('', element._RightClickMenuCallback) # ------------------------- Canvas placement element ------------------------- # elif element_type == ELEM_TYPE_CANVAS: width, height = element_size @@ -10616,6 +10650,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): else: anchor = tk.CENTER column_widths = {} + # create column width list for row in element.Values: for i, col in enumerate(row): col_width = min(len(str(col)), element.MaxColumnWidth) @@ -10656,14 +10691,13 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): for i, heading in enumerate(headings): treeview.heading(heading, text=heading) if element.AutoSizeColumns: - width = max(column_widths[i], _string_width_in_pixels(font, heading) + 10) + width = max(column_widths[i], len(heading)) * _char_width_in_pixels(font) else: try: width = element.ColumnWidths[i] * _char_width_in_pixels(font) except: 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): if element.DisplayRowNumbers: @@ -10769,8 +10803,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): width = element.ColumnWidths[i] except: width = element.DefaultColumnWidth - treeview.column(heading, width=width * _char_width_in_pixels(font), anchor=anchor) - + treeview.column(heading, width=width * _char_width_in_pixels(font)+ 10, anchor=anchor) def add_treeview_data(node): """ @@ -11145,8 +11178,7 @@ class QuickMeter(object): active_meters = {} exit_reasons = {} - def __init__(self, title, current_value, max_value, key, *args, orientation='v', bar_color=(None, None), - button_color=(None, None), size=DEFAULT_PROGRESS_BAR_SIZE, border_width=None, grab_anywhere=False): + def __init__(self, title, current_value, max_value, key, *args, orientation='v', bar_color=(None, None), button_color=(None, None), size=DEFAULT_PROGRESS_BAR_SIZE, border_width=None, grab_anywhere=False, no_titlebar=False): """ :param title: text to display in eleemnt @@ -11171,6 +11203,8 @@ class QuickMeter(object): :type border_width: (int) :param grab_anywhere: If True: can grab anywhere to move the window (Default = False) :type grab_anywhere: (bool) + :param no_titlebar: If True: window will be created without a titlebar + :type no_titlebar: (bool) """ self.start_time = datetime.datetime.utcnow() self.key = key @@ -11180,6 +11214,7 @@ class QuickMeter(object): self.grab_anywhere = grab_anywhere self.button_color = button_color self.border_width = border_width + self.no_titlebar = no_titlebar self.title = title self.current_value = current_value self.max_value = max_value @@ -11206,7 +11241,7 @@ class QuickMeter(object): col2 += [[T('', size=(30, 10), key='_STATS_')], [Cancel(button_color=self.button_color), Stretch()]] layout = [Column(col), Column(col2)] - self.window = Window(self.title, grab_anywhere=self.grab_anywhere, border_depth=self.border_width) + self.window = Window(self.title, grab_anywhere=self.grab_anywhere, border_depth=self.border_width, no_titlebar=self.no_titlebar) self.window.Layout([layout]).Finalize() return self.window @@ -11257,8 +11292,7 @@ class QuickMeter(object): return self.stat_messages -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): +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, no_titlebar=False): """ :param title: text to display in eleemnt :type title: (str) @@ -11273,7 +11307,7 @@ def OneLineProgressMeter(title, current_value, max_value, key, *args, orientatio :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 + :type bar_color: Tuple(str, 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) @@ -11282,12 +11316,13 @@ def OneLineProgressMeter(title, current_value, max_value, key, *args, orientatio :type border_width: (int) :param grab_anywhere: If True: can grab anywhere to move the window (Default = False) :type grab_anywhere: (bool) + :param no_titlebar: If True: no titlebar will be shown on the window + :type no_titlebar: (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, - button_color=button_color, size=size, border_width=border_width, grab_anywhere=grab_anywhere) + meter = QuickMeter(title, current_value, max_value, key, *args, orientation=orientation, bar_color=bar_color, button_color=button_color, size=size, border_width=border_width, grab_anywhere=grab_anywhere, no_titlebar=no_titlebar) QuickMeter.active_meters[key] = meter else: meter = QuickMeter.active_meters[key] @@ -11302,6 +11337,7 @@ def OneLineProgressMeterCancel(key): Cancels and closes a previously created One Line Progress Meter window :param key: Key used when meter was created + :type key: (Any) """ try: meter = QuickMeter.active_meters[key] @@ -11414,12 +11450,17 @@ class _DebugWin(): def PrintClose(): + """ + Close a previously opened EasyPrint window + """ 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): """ + Works like a "print" statement but with windowing options. Routes output to the "Debug Window" + :param *args: stuff to output :type *args: (Any) :param size: (w,h) w=characters-wide, h=rows-high @@ -11461,6 +11502,9 @@ eprint = EasyPrint def EasyPrintClose(): + """ + Close a previously opened EasyPrint window + """ if _DebugWin.debug_window is not None: _DebugWin.debug_window.Close() _DebugWin.debug_window = None @@ -12758,8 +12802,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: @@ -12773,6 +12817,7 @@ def theme_background_color(color=None): Used for Windows and containers (Column, Frame, Tab) and tables :return: (str) - color string of the background color currently in use + :rtype: (str) """ if color is not None: set_options(background_color=color) @@ -12784,6 +12829,7 @@ def theme_element_background_color(color=None): Sets/Returns the background color currently in use for all elements except containers :return: (str) - color string of the element background color currently in use + :rtype: (str) """ if color is not None: set_options(element_background_color=color) @@ -12795,6 +12841,7 @@ def theme_text_color(color=None): Sets/Returns the text color currently in use :return: (str) - color string of the text color currently in use + :rtype: (str) """ if color is not None: set_options(text_color=color) @@ -12806,6 +12853,7 @@ def theme_text_element_background_color(color=None): Sets/Returns the background color for text elements :return: (str) - color string of the text background color currently in use + :rtype: (str) """ if color is not None: set_options(text_element_background_color=color) @@ -12816,6 +12864,7 @@ def theme_input_background_color(color=None): Sets/Returns the input element background color currently in use :return: (str) - color string of the input element background color currently in use + :rtype: (str) """ if color is not None: set_options(input_elements_background_color=color) @@ -12827,6 +12876,7 @@ def theme_input_text_color(color=None): Sets/Returns the input element entry color (not the text but the thing that's displaying the text) :return: (str) - color string of the input element color currently in use + :rtype: (str) """ if color is not None: set_options(input_text_color=color) @@ -12839,6 +12889,7 @@ 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) + :rtype: (str) """ if color is not None: set_options(button_color=color) @@ -12850,6 +12901,7 @@ 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) + :rtype: (str) """ if color is not None: set_options(progress_meter_color=color) @@ -12861,6 +12913,7 @@ 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 + :rtype: (str) """ if color is not None: set_options(scrollbar_color=color) @@ -12873,6 +12926,7 @@ def theme_border_width(border_width=None): Used by non ttk elements at the moment :return: (int) - border width currently in use + :rtype: (str) """ if border_width is not None: set_options(border_width=border_width) @@ -12884,6 +12938,7 @@ def theme_slider_border_width(border_width=None): Sets/Returns the slider border width currently in use :return: (int) - border width currently in use + :rtype: (str) """ if border_width is not None: set_options(slider_border_width=border_width) @@ -12895,6 +12950,7 @@ 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 + :rtype: (str) """ if border_width is not None: set_options(progress_meter_border_depth=border_width) @@ -12907,6 +12963,7 @@ 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 + :rtype: (str) """ if color is not None: set_options(element_text_color=color) @@ -12918,6 +12975,7 @@ def theme_list(): Returns a sorted list of the currently available color themes :return: List[str] - A sorted list of the currently available color themes + :rtype: (str) """ return list_of_look_and_feel_values() @@ -13178,7 +13236,7 @@ def Popup(*args, title=None, button_color=None, background_color=None, text_colo :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) + :type button_type: (int) :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 @@ -13428,7 +13486,7 @@ def PopupNonBlocking(*args, title=None, button_type=POPUP_BUTTONS_OK, button_col :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) + :type button_type: (int) :param button_color: button color (foreground, background) :type button_color: Tuple[str, str] :param background_color: color of background @@ -13477,7 +13535,7 @@ def PopupQuick(*args, title=None, button_type=POPUP_BUTTONS_OK, button_color=Non :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) + :type button_type: (int) :param button_color: button color (foreground, background) :type button_color: Tuple[str, str] :param background_color: color of background @@ -13525,7 +13583,7 @@ def PopupQuickMessage(*args, title=None, button_type=POPUP_BUTTONS_NO_BUTTONS, b :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) + :type button_type: (int) :param button_color: button color (foreground, background) :type button_color: Tuple[str, str] :param background_color: color of background @@ -13571,7 +13629,7 @@ def PopupNoTitlebar(*args, title=None, button_type=POPUP_BUTTONS_OK, button_colo :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) + :type button_type: (int) :param button_color: button color (foreground, background) :type button_color: Tuple[str, str] :param background_color: color of background @@ -13622,15 +13680,13 @@ def PopupAutoClose(*args, title=None, button_type=POPUP_BUTTONS_OK, button_color :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) - + :type button_type: (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 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 @@ -14165,8 +14221,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, - time_between_frames=0, transparent_color=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, title=''): """ 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 @@ -14197,6 +14252,8 @@ def PopupAnimated(image_source, message=None, background_color=None, text_color= :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) + :param title: Title that will be shown on the window + :type title: (str) """ if image_source is None: for image in Window._animated_popup_dict: @@ -14213,7 +14270,7 @@ def PopupAnimated(image_source, message=None, background_color=None, text_color= if message: layout.append([Text(message, background_color=background_color, text_color=text_color, font=font)]) - window = Window('Animated GIF', layout, no_titlebar=no_titlebar, grab_anywhere=grab_anywhere, + window = Window(title, 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=True, element_justification='c') @@ -15142,9 +15199,14 @@ def _upgrade_from_github(): def _upgrade_gui(): + try: + cur_ver = version[:version.index('\n')] + except: + cur_ver = version + 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')]), + 'You are running verrsion {}'.format(cur_ver), '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() @@ -15162,7 +15224,11 @@ def main(): # theme('dark brown 2') # theme('dark red') # theme('Light Green 6') - ver = version[:version.index('\n')] + try: + ver = version[:version.index('\n')] + except: + ver = version + 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)) @@ -15237,7 +15303,7 @@ def main(): tab4 = Tab('Variable Choice', [[Frame('Variable Choice Group', frame4, title_color='blue')]], tooltip='tab 4', title_color='red') layout1 = [ - [Image(data=DEFAULT_BASE64_ICON), Image(data=DEFAULT_BASE64_LOADING_GIF, key='_IMAGE_'), + [Image(data=DEFAULT_BASE64_ICON, enable_events=True, key='-LOGO-'), Image(data=DEFAULT_BASE64_LOADING_GIF, enable_events=True, 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')], @@ -15358,10 +15424,12 @@ theme(CURRENT_LOOK_AND_FEEL) # -------------------------------- ENTRY POINT IF RUN STANDALONE -------------------------------- # if __name__ == '__main__': + # To execute the upgrade from command line, type: + # python -m PySimpleGUI.PySimpleGUI upgrade if len(sys.argv) > 1 and sys.argv[1] == 'upgrade': _upgrade_gui() - exit(69) + exit(0) main() - exit(69) + exit(0) diff --git a/readme_creator/readme.md b/readme_creator/readme.md index 3a7f2ee7..6263872c 100644 --- a/readme_creator/readme.md +++ b/readme_creator/readme.md @@ -14,11 +14,12 @@ ![Awesome Meter](https://img.shields.io/badge/Awesome_meter-100-yellow.svg) ![Python Version](https://img.shields.io/badge/Python-2.7_3.x-yellow.svg) -![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-4.16.0-red.svg?longCache=true&style=for-the-badge) - -![Python Version](https://img.shields.io/badge/PySimpleGUIQt_Version-0.30.0-orange.svg?longCache=true&style=for-the-badge) -![Python Version](https://img.shields.io/badge/PySimpleGUIWx_version-0.14.0-orange.svg?longCache=true&style=for-the-badge) -![Python Version](https://img.shields.io/badge/PySimpleGUIWeb_Version-0.33.0-orange.svg?longCache=true&style=for-the-badge) +[![PyPI Version](https://img.shields.io/pypi/v/pysimplegui.svg?style=for-the-badge)](https://pypi.org/project/pysimplegui/) tkinter +[![PyPI Version](https://img.shields.io/pypi/v/pysimpleguiqt.svg?style=for-the-badge)](https://pypi.org/project/pysimpleguiqt/) Qt +[![PyPI Version](https://img.shields.io/pypi/v/pysimpleguiweb.svg?style=for-the-badge)](https://pypi.org/project/pysimpleguiweb/) Web +[![PyPI Version](https://img.shields.io/pypi/v/pysimpleguiwx.svg?style=for-the-badge)](https://pypi.org/project/pysimpleguiwx/) Wx +[![Commit activity](https://img.shields.io/github/commit-activity/m/PySimpleGUI/PySimpleGUI.svg?style=for-the-badge)](../../commits/master) +[![Last commit](https://img.shields.io/github/last-commit/PySimpleGUI/PySimpleGUI.svg?style=for-the-badge)](../../commits/master) # PySimpleGUI User's Manual @@ -510,7 +511,7 @@ You won't look stupid posting an Issue on GitHub. It's just the opposite. **PySimpleGUI is an active project.** Bugs are fixed, features are added, often. Should you run into trouble, **open an issue** on the [GitHub site](http://www.PySimpleGUI.com) and you'll receive help. Posting questions on StackOverflow, Forums, Mailing lists, Reddit, etc, is not the fastest path to support and taking it may very well lead you astray as folks not familiar with the package struggle to help you. You may also run into the common response of "I don't know PySimpleGUI (and perhaps dislike it as a result), but I know you can do that with Qt". -Why only 1 location? It's simple.... it's where the bugs, enhancements, etc are tracked. It's THE spot on the Internet for this project. It's not some freakish being in control, telling people how to do things. It's so that YOU get the best and quickest support possible. +Why only 1 location? It's simple.... it's where the bugs, enhancements, etc are tracked. It's THE spot on the Internet for this project. There's not driven by a freakish being in control, telling people how to do things, reasoning. It's so that YOU get the best and quickest support possible. So, [open an Issue](https://github.com/PySimpleGUI/PySimpleGUI/issues/new/choose), choose "custom form" and fill it out completely. There are very good reasons behind all of the questions. Cutting corners only cuts your chances of getting help and getting quality help as it's difficult enough to debug remotely. Don't handicap people that want to help by not providing enough information. @@ -518,28 +519,6 @@ So, [open an Issue](https://github.com/PySimpleGUI/PySimpleGUI/issues/new/choose ***Don't sit and stew, trying the same thing over and over***, until you hate life... stop, and post an Issue on the GitHub. Someone **WILL** answer you. Support is included in the purchase price for this package (the quality level matches the price as well I'm afraid). Just don't be too upset when your free support turns out to be a little bit crappy, but it's free and typically good advice. -### PySimpleGUI Trolls - -Yea, they're out there. Would have NEVER in a billion years guessed that there would be objection to this package, coming from a small, but vocal, number of people. I naively believed everyone would be supportive, see the value, hold hands around the fire, sing songs, and in the very least be truthful. But, this ain't Kansas and the Internet is well... - -If someone is actively discouraging you from using this package, then know you are on the right track and you should give it a try. Stuff like this sometimes happens because the person works for a particular company or they have a GUI package of their own.... that's not popuplar, or they like to tear things down or I dunno... people can be really weird and emotional. - -I promise you're not going to be wrecked for life. It will not cause you to be a bad programmer with bad habits. It will not ruin your career. It's not going to teach you bad habits. One person I know got a bonus based on a PySimpleGUI program he wrote. - -***How about success being the goal?*** Spend time polishing your GUI and working on your primary code instead of struggling your way through the mountains of documentation in the Qt library, trying to set the color of something. How about getting your program done, working, and in use? - -Start with PySimpleGUI, then in the future if you want to code directly in Qt, it's not like you won't be able to learn something else due to your PySimpleGUI knowledge. Unable to write a `while` loop because you already learned using a `for` loop? That seems to be the logic. - -If anything, you'll have more knowledge than most people that are just starting because you'll have already built working GUIs, perhaps many of them and understand how to layout an efficient interface as well as having a good education in GUI Widgets and how they work. - -Here are the forces likely at work.... said Troll has been programming for a while now and really knows these GUI frameworks. Probably invested a lot of hours learning them and thus has some marketable skills (yes, follow the money). - -Enter snotty-nosed high-shool or first year programmer using PySimpleGUI that manages to make GUI windows with great ease... that look, well, pretty much the **same** as the windows Sir Troll ***was*** used to getting paid big bucks to make. What used to be a skill only a select few can do, now 1,000's, 10,000's, or 100,000s more programmers can do, quicker and easier. Bummer Mr. Troll. Bummer. - -"***It's supposed to be difficult to write a GUI***" was an actual reason listed why not to use PySimpleGUI by one person offering to help junior programmers learn Qt. Really? It's supposed to be difficult. Huh. Well, not in this Python universe. Maybe in C++ world it works that way?? - -Just know you're safe in trying and possibly even succeeding in the process. - ### Target Audience PySimpleGUI is trying to serve the 80% of GUI *problems*. The other 20% go straight to tkinter, Qt, WxPython, Remi, or whatever fills that need. That 80% is **a huge problem space**. @@ -810,9 +789,9 @@ Beautiful windows are created, not simply given to you. There are people that d Some of these have been "polished", others like the Matplotlib example is more a functional example to show you it works. -![batterup2](https://user-images.githubusercontent.com/13696193/50378902-6aa2bb00-060a-11e9-8f2f-d746694fa4ee.gif) +![batterup](https://user-images.githubusercontent.com/46163555/77781297-b624ef80-702b-11ea-857a-b0809f061dc9.png) -![uno_final](https://user-images.githubusercontent.com/13696193/49945232-67952580-feba-11e8-90c8-7dc31c5f7c67.gif) +![Uno](https://user-images.githubusercontent.com/46163555/77781360-d05ecd80-702b-11ea-90f9-cb9fb3339c05.png) This chess program is capable of running multiple AI chess engines and was written by another user using PySimpleGUI. @@ -836,7 +815,7 @@ In release 4.9 another 32 Color Themes were added... here are the current choice Make beautiful looking, alpha-blended (partially transparent) Rainmeter-style Desktop Widgets that run in the background. -![cpu cores dashboard 2](https://user-images.githubusercontent.com/13696193/47611749-18964c80-da42-11e8-93c4-6821a6fce488.gif) +![cpumeter](https://user-images.githubusercontent.com/46163555/77781418-ec626f00-702b-11ea-90b3-668fb71d63b5.png) Want to build a Crossword Puzzle? No problem, the drawing primitives are there for you. @@ -872,7 +851,7 @@ It's possible to create some cool games by simply using the built-in PySimpleGUI Games haven't not been explored much, yet, using PySimpleGUI. -![pong](https://user-images.githubusercontent.com/13696193/45860012-2d8d0b00-bd33-11e8-9efd-3eaf4c30f324.gif) +![pong](https://user-images.githubusercontent.com/46163555/77781526-1c117700-702c-11ea-901b-4cb5f7a34cb4.png) # Windows Programs That Look Like Windows Programs @@ -884,7 +863,7 @@ Combining PySimpleGUI with PyInstaller creates something truly remarkable and sp The application you see below with a working menu was created in 20 lines of Python code. It is a single .EXE file that launches straight into the screen you see. And more good news, the only icon you see on the taskbar is the window itself... there is no pesky shell window. Nice, huh? -![menu demo](https://user-images.githubusercontent.com/13696193/45923097-8fbc4c00-beaa-11e8-87d2-01a5331811c8.gif) +![windowsprogram](https://user-images.githubusercontent.com/46163555/77781479-03a15c80-702c-11ea-9408-903e022e0418.png) With a simple GUI, it becomes practical to "associate" .py files with the python interpreter on Windows. Double click a py file and up pops a GUI window, a more pleasant experience than opening a dos Window and typing a command line. @@ -1143,18 +1122,64 @@ Like above, you may have to install either pip or tkinter. To do this on Python `sudo apt install python-tkinter` +### Upgrading from GitHub Using PySimpleGUI + +Starting in version 4.17.0 there is code in the PySimpleGUI package that upgrades your previously pip installed package using the latest version checked into GitHub. + +Previously if you wanted to run the GitHub version, you would: +* Download the PySimpleGUI.py file from GitHub +* Place it in your applications's folder + +This required you to go back later and delete this file when you want to move on to the next version released to PyPI. + +The new capability is the ability to overwrite your PySimpleGUI.py file that you installed using `pip` with the currently posted version on GitHub. Using this method when you're ready to install the next version from PyPI or you want to maybe roll back to a PyPI release, you only need to run `pip`. You don't have to find and delete any PySimpleGUI.py files. + +***Important - Linux Users*** - There is currently a problem using this utility on Linux systems. It's being worked on and a patch will be released as soon as something is figured out. + +#### Command Line Upgrade + +To upgrade PySimpleGUI from the command line type this command into your dos window + +`python -m PySimpleGUI upgrade` + +You will first be shown a confirmation window: + +![image](https://user-images.githubusercontent.com/46163555/77477572-f0f01300-6df2-11ea-812f-98a36e7c28e0.png) + +If you choose yes, then the new version will be installed and you'll see a red "completed" window + +![image](https://user-images.githubusercontent.com/46163555/77477619-006f5c00-6df3-11ea-8b01-44b1bea22989.png) + +#### GUI Upgrade + +The PySimpleGUI Test Harness is another mechanism you can use to upgrade. To start the test harness you "run" the PySimpleGUI package. + +`python -m PySimpleGUI.PySimpleGUI` + +Of course if you're running Linux you may run `python3` instead. + +From your code you can call `PySimpleGUI.main()`. This window may not look exactly like the one you see, but the thing that should be there is the red "Install" button. + +![image](https://user-images.githubusercontent.com/46163555/77478381-437dff00-6df4-11ea-994e-a443ff967917.png) + +Clicking the install button will bring up the same confirmation window shown as the command line upgrade above. + ### Testing your installation and Troubleshooting Once you have installed, or copied the .py file to your app folder, you can test the installation using python. At the command prompt start up Python. #### The Quick Test -From your commant line type: -`python -m PySimpleGUI` +The PySimpleGUI Test Harness pictured in the previous section on GUI upgrades is the short program that's built into PySimpleGUI that serves multiple purposes. It exercises many/most of the available Elements, displays version and location data and works as a quick self-test. -Of course if you're on Linux/Mac and need to run using the command `python3` then of course type that. +From your command line type: +`python -m PySimpleGUI.PySimpleGUI` -This will display the same window as these instructions: +If you're on Linux/Mac and need to run using the command `python3` then of course type that. + +This will display the test harnes window. + +You can also test by using the REPL.... #### Instructions for Testing Python 2.7: ```python @@ -1251,6 +1276,12 @@ See.... written with the "Developer" in mind, at all times. It's about YOU, Mr/ The other ports of PySimpleGUI (Qt, WxPython, Web) have not yet had their docstrings updated. They're NEXT in line to be better documented. Work on a tool has already begun to make that happen sooner than later. +#### Type Checking With Docstrings + +In version 4.17.0 a new format started being used for docstrings. This new format more clearly specified the types for each parameter. It will take some time to get all of the parameter types correctly identied and documented. + +Pay attention when you're working with PyCharm and you'll see where you may have a mismatch... or where there's a bad docstring, take your pick. It will shade your code in a way that makes mismatched types very clear to see. + ## Using - Python 3 To use in your code, simply import.... @@ -1268,7 +1299,9 @@ Yes, it's just that easy to have a window appear on the screen using Python. Wi If you must run 3.7, try 3.7.2. It does work with PySimpleGUI with no known issues. -***PySimpleGUI with Python 3.7.3 and 3.7.4+.*** tkinter is having issues with all the newer releases. Things like Table colors stopped working entirely. It's unclear if there's been a change that makes the tkinter API no longer working which means they are not backwards compatible. That would be a real shame. If so, more work needs to be done in PySimpleGUI +***PySimpleGUI with Python 3.7.3 and 3.7.4+.*** tkinter is having issues with all the newer releases. Things like Table colors stopped working entirely. + +March 2020 - Still not quite sure if all issues have been ironed out with tkinter in the 3.7 and 3.8 releases. ## Python 2.7 @@ -1308,7 +1341,7 @@ For the time being, class variables will remain the way they are currently. It # 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. +"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. @@ -1316,27 +1349,50 @@ When you've reached the point with Popups that you are thinking of filing a GitH 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. +But, for now, let's stick with these 1-line window calls, the Popups. This is the list of popup calls available to you: + +popup_animated +popup_annoying +popup_auto_close +popup_cancel +popup_error +popup_get_file +popup_get_folder +popup_get_text +popup_no_border +popup_no_buttons +popup_no_frame +popup_no_titlebar +popup_no_wait +popup_notify +popup_non_blocking +popup_ok +popup_ok_cancel +popup_quick +popup_quick_message +popup_scrolled +popup_timed +popup_yes_no ## 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. +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. +`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). +There are a number of Popup output calls, each with a slightly different look or functionality (e.g. different button labels, window options). The list of Popup output functions are: -- Popup -- PopupOk -- PopupYesNo -- PopupCancel -- PopupOkCancel -- PopupError -- PopupTimed, PopupAutoClose -- PopupNoWait, PopupNonBlocking +- popup +- popup_ok +- popup_yes_no +- popup_cancel +- popup_ok_cancel +- popup_error +- popup_timed, popup_auto_close, popup_quick, popup_quick_message +- popup_no_waitWait, popup_non_blocking 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. @@ -1347,14 +1403,14 @@ The function `PopupTimed` or `PopupAutoClose` are popup windows that will automa 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 +sg.popup('Popup') # Shows OK button +sg.popup_ok('PopupOk') # Shows OK button +sg.popup_yes_no('PopupYesNo') # Shows Yes and No buttons +sg.popup_cancel('PopupCancel') # Shows Cancelled button +sg.popup_ok_cancel('PopupOKCancel') # Shows OK and Cancel buttons +sg.popup_error('PopupError') # Shows red error button +sg.popup_timed('PopupTimed') # Automatically closes +sg.popup_auto_close('PopupAutoClose') # Same as PopupTimed ``` Preview of popups: @@ -1397,32 +1453,30 @@ Popup(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*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** | Returns text of the button that was pressed. None will be returned if user closed window with X
:rtype: Union[str, None] | +|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 | +| int | 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 (you should not specify these yourself however): -The choices for button_type are: ``` POPUP_BUTTONS_YES_NO POPUP_BUTTONS_CANCELLED @@ -1432,16 +1486,16 @@ 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. +**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 `popup_yes_no` will set the button type to POPUP_BUTTONS_YES_NO for you. -#### Scrolled Output +### 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>, +popup_scrolled(args=*<1 or N object>, title=None, button_color=None, background_color=None, @@ -1460,47 +1514,43 @@ PopupScrolled(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|(Any) Variable number of items to display| -|title|(str) Title to display in the window.| -|button_color|Tuple[str, str] button color (foreground, background)| -|yes_no|(bool) If True, displays Yes and No buttons instead of Ok| -|auto_close|(bool) if True window will close itself| -|auto_close_duration|Union[int, float] Older versions only accept int. Time in seconds until window will close| -|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high| -|location|Tuple[int, int] Location on the screen to place the upper left corner of the window| -|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 | +|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) +sg.popup_scrolled(my_text) ``` ![scrolledtextbox 2](https://user-images.githubusercontent.com/13696193/43667324-712aa0d4-9745-11e8-83a9-a0d0570d0865.jpg) -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. +The `popup_scrolled` 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))` +`sg.popup_scrolled(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 +### Non-Blocking Popups - popup_no_wait and the non_blocking parameter Show Popup window and immediately return (does not block) ``` -PopupNoWait(args=*<1 or N object>, +popup_no_wait(args=*<1 or N object>, title=None, button_type=0, button_color=None, @@ -1520,42 +1570,49 @@ PopupNoWait(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = True)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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. +The Popup call PopupNoWait or PopupNonBlocking will create a popup window and then immediately return control back to you. You can turn other popup calls into non-blocking popups if they have a `non_blocking` parameter. Setting `non_blocking` to True will cause the function to return immediately rather than waiting for the window to be closed. 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 Parameter Combinations + +So that you don't have to specify a potentially long list common parameters there are a number of popup functions that set combinations of parameters. For example `popup_quick_message` will show a non-blocking popup that autocloses and does not have a titlebar. You could achieve this same end result using the plain `popup` call. + ## 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 + +There are Popup calls for single-item inputs. These follow the pattern of `popup_get` followed by the type of item to get. There are 3 of these input Popups to choose from, each with settings enabling customization. + +- `popup_get_text` - get a single line of text +- `popup_get_file` - get a filename +- `popup_get_folder` - 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 + +### popup_get_text 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, +popup_get_text(message, title=None, default_text="", password_char="", @@ -1573,42 +1630,42 @@ PopupGetText(message, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | Text entered or None if window was closed or cancel button clicked
:rtype: Union[str, None] | +|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) +text = sg.popup_get_text('Title', 'Please input something') +sg.popup('Results', 'The value returned from PopupGetText', text) ``` ![popupgettext](https://user-images.githubusercontent.com/13696193/44957281-8721b880-ae9e-11e8-98cd-d06369f4187e.jpg) ![popup gettext response](https://user-images.githubusercontent.com/13696193/44957282-8721b880-ae9e-11e8-84ae-dc8bb30504a0.jpg) -### 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. +### popup_get_file + +Gets one or more filenames 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, +popup_get_file(message, title=None, default_path="", default_extension="", @@ -1631,29 +1688,28 @@ PopupGetFile(message, Parameter Descriptions: -|Name|Meaning| -|---|---| -|message|(str) message displayed to user| -|title|(str) Window title| -|default_path|(str) path to display to user as starting point (filled into the input field)| -|default_extension|(str) If no extension entered by user, add this to filename (only used in saveas dialogs)| -|save_as|(bool) if True, the "save as" dialog is shown which will verify before overwriting| -|multiple_files|(bool) if True, then allows multiple files to be selected that are returned with ';' between each filename| -|file_types|Tuple[Tuple[str,str]] List of extensions to show using wildcards. All files (the default) = (("ALL Files", "*.*"),)| -|no_window|(bool) if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown| -|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| -|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 | +|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. @@ -1668,20 +1724,20 @@ If you choose a filename that already exists, you'll get a warning popup box ask A typical call produces this window. ```python -text = sg.PopupGetFile('Please enter a file name') -sg.Popup('Results', 'The value returned from PopupGetFile', text) +text = sg.popup_get_file('Please enter a file name') +sg.popup('Results', 'The value returned from PopupGetFile', text) ``` ![popupgetfile](https://user-images.githubusercontent.com/13696193/44957857-2fd31680-aea5-11e8-8eb7-f6b91c202cc8.jpg) -### PopupGetFolder +### popup_get_folder 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, +popup_get_folder(message, title=None, default_path="", no_window=False, @@ -1700,36 +1756,35 @@ PopupGetFolder(message, Parameter Descriptions: -|Name|Meaning| -|---|---| -|message|(str) message displayed to user| -|title|(str) Window title| -|default_path|(str) path to display to user as starting point (filled into the input field)| -|no_window|(bool) if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown| -|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| -|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 | +|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) + text = sg.popup_get_folder('Please enter a folder name') + sg.popup('Results', 'The value returned from PopupGetFolder', text) ``` ![popupgetfolder](https://user-images.githubusercontent.com/13696193/44957861-45484080-aea5-11e8-926c-cf607a45251c.jpg) -### PopupAnimated +### popup_animated ![ring](https://user-images.githubusercontent.com/13696193/51296743-6ee4ad00-19eb-11e9-91f5-cd8086ad1b50.gif) @@ -1741,7 +1796,7 @@ Show animation one frame at a time. This function has its own internal clocking loop. ``` -PopupAnimated(image_source, +popup_animated(image_source, message=None, background_color=None, text_color=None, @@ -1752,25 +1807,27 @@ PopupAnimated(image_source, location=(None, None), alpha_channel=None, time_between_frames=0, - transparent_color=None) + transparent_color=None, + title="") ``` Parameter Descriptions: -|Name|Meaning| -|---|---| -|image_source|Union[str, bytes] Either a filename or a base64 string.| -|message|(str) An optional message to be shown with the animation| -|background_color|(str) color of background| -|text_color|(str) color of the text| -|font|Union[str, tuple) specifies the font family, size, etc| -|no_titlebar|(bool) If True then the titlebar and window frame will not be shown| -|grab_anywhere|(bool) If True then you can move the window just clicking anywhere on window, hold and drag| -|keep_on_top|(bool) If True then Window will remain on top of all other windows currently shownn| -|location|(int, int) (x,y) location on the screen to place the top left corner of your window. Default is to center on screen| -|alpha_channel|(float) Window transparency 0 = invisible 1 = completely visible. Values between are see through| -|time_between_frames|(int) Amount of time in milliseconds between each frame| -|transparent_color|(str) This color will be completely see-through in your window. Can even click through| +|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 | +| str | title | Title that will be shown on the window | ***To close animated popups***, call PopupAnimated with `image_source=None`. This will close all of the currently open PopupAnimated windows. @@ -1778,23 +1835,43 @@ Parameter Descriptions: 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): +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, + no_titlebar=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') | +| Tuple(str, 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 | no_titlebar | If True: no titlebar will be shown on the window | +| (bool) | **RETURN** | True if updated successfully. False if user closed the meter with the X or Cancel button + 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') + sg.one_line_progress_meter('My Meter', i+1, 10000, 'key','Optional message') ``` That line of code resulted in this window popping up and updating. @@ -1806,12 +1883,12 @@ With a little trickery you can provide a way to break out of your loop using the ***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) +# Debug Output (easy_print = 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 +print = sg.Print ``` at the top of your code. @@ -1834,16 +1911,20 @@ import PySimpleGUI as sg print=sg.Print for i in range(100): -print(i) + 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`. +Just like the standard print call, `easy_print` supports the `sep` and `end` keyword arguments. Other names that can be used to call `easy_print` include `Print`, `eprint`, If you want to close the window, call the function `easy_print_close`. -You can change the size of the debug window using the `SetOptions` call with the `debug_win_size` parameter. +You can change the size of the debug window using the `set_options` 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. +There is an option to tell PySimpleGUI to reroute all of your stdout and stderr output to this window. To do so call easy_print 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()` +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 `easy_print_close()` or `PrintClose()` + +### Printing To Multiline Elements + +Another technique for outputting information that you would normally print is to use the function `Multiline.print`. You'll find it discussed further into this document. The basic idea is that you can easily modify your normal `print` calls to route your printed information to your window. --- # Custom window API Calls (Your First window) @@ -2450,7 +2531,7 @@ Clicking the Submit button caused the window call to return. The call to Popup **`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. +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. @@ -3446,6 +3527,41 @@ layout = [[sg.Multiline('This is what a Multi-line Text Element looks like', siz ![multiline](https://user-images.githubusercontent.com/13696193/44959853-b139a180-aec3-11e8-972f-f52188510c88.jpg) +This element has been expanded upon quite a bit over time. Two of the more exciting additions have been + +* Ability to output unique text and background colors on a per-character basis +* The `print` method that allows you to easily reroute your normally printed output to a multiline element instead + +The `Multiline.print()` call is made using the same element-lookup technique you're used to using to call `update`. One of these lookups generally appear: + +```python +window['-MULTILINE KEY-'] +``` + +To change one of your normal prints to output to your multiline element, you simply add the above lookup expression to the front of your print statement. + +```python +print('My variables are', a, b, c) # a normal print statement + +window['-MULTILINE KEY-'].print('My variables are', a, b, c) # Routed to your multiline element +``` + +It gets even better though.... you can add color to your prints + +```python +# Outputs red text on a yellow background +window['-MULTILINE KEY-'].print('My variables are', a, b, c, text_color='red', background_color='yellow') + +``` + +### Redefine print + +Another way to use this print capability is to redefine the `print` statement itself. This will allow you to leave your code entirely as is. By adding this line of code your entire program will output all printed information to a multiline element. + +```python +print = lambda *args, **kwargs: window['-MULTILINE KEY-'].print(*args, **kwargs) +``` + ## Text Input Element | `InputText == Input == In` ```python @@ -3747,19 +3863,29 @@ With this layout, the event that is returned from a `Window.Read()` call when th 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 is one of the quickest and easiest ways to transform tkinter from a "1990s looking GUI" into a "modern GUI". If you don't like the default buttons, then simply bring your own button images and use those instead. -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`. +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. You can get the theme's background color by calling `theme_background_color()` + +`TRANSPARENT_BUTTON` - **Important** - This is a legacy value that is misleading. It is currently defined as this constant value: ```python -sg.Button('Restart Song', button_color=sg.TRANSPARENT_BUTTON, +TRANSPARENT_BUTTON = ('#F0F0F0', '#F0F0F0') +``` + +As you can see it is simply a tuple of 2 gray colors. The effect is that the button text and the button background color to a specific shade of gray. Way back in time, before you could change the background colors and all windows were gray, this value worked. But now that your button can be on any background color, you'll want to set the buttons color to match the background so that your button blends with the background color. + +```python +sg.Button('Restart Song', button_color=(sg.theme_background_color(), sg.theme_background_color()), image_filename=image_restart, image_size=(50, 50), image_subsample=2, border_width=0) ``` -Three parameters are used for button images. + +There are several parameters in `Button` elements that are used for button images. ``` -image_filename - Filename. Can be a relative path -image_size - Size of image file in pixels +image_filename - Filename of image. Can be a relative path +image_data - A Base64 image +image_size - Size of image in pixels image_subsample - Amount to divide the size by. 2 means your image will be 1/2 the size. 3 means 1/3 ``` @@ -3768,15 +3894,18 @@ Here's an example window made with button images. ![media file player](https://user-images.githubusercontent.com/13696193/43161977-9ee7cace-8f57-11e8-8ff8-3ea24b69dab9.jpg) 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, +sg.Button('Pause', button_color=(sg.theme_background_color(), sg.theme_background_color()), 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. +Experimentation is sometimes required for these concepts to really sink in and they can vary depending on the underlying GUI framework. + +Button Images do work so play with them. You can use PIL to change the size of your images before passing to PySimpleGUI. ### Realtime Buttons @@ -3814,7 +3943,7 @@ while (True): if event in ('Quit', None): break -window.Close() # Don't forget to close your window! +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. @@ -4003,7 +4132,7 @@ layout = [[sg.Slider(range=(1,100), default_value=10, orientation='v', size=(8,2 window = sg.Window('Compact 1-line window with column', layout) event, values = window.read() -window.Close() +window.close() sg.Popup(event, values, line_width=200) @@ -5121,7 +5250,7 @@ while True: ev2, vals2 = win2.Read(timeout=100) if ev2 is None or ev2 == 'Exit': win2_active = False - win2.Close() + win2.close() ``` ## Multi-Window Design Pattern 2 - only 1 active window @@ -5154,7 +5283,7 @@ while True: while True: ev2, vals2 = win2.Read() if ev2 is None or ev2 == 'Exit': - win2.Close() + win2.close() win2_active = False win1.UnHide() break @@ -5242,7 +5371,7 @@ while True: if event is None: break print(event, values) -window.Close() +window.close() ``` ## Debugger Windows @@ -5588,7 +5717,7 @@ 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 Button Element - Defines all possible buttons. The shortcuts such as Submit, FileBrowse, ... each create a Button @@ -5623,34 +5752,34 @@ Button(button_text="", Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -5667,9 +5796,9 @@ Returns the current text shown on a button `GetText()` -|Name|Meaning| -|---|---| -| **return** | The text currently displayed on the button
:rtype: (str) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | The text currently displayed on the button | ### SetFocus @@ -5681,9 +5810,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -5695,9 +5824,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -5717,17 +5846,17 @@ Update(text=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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]| +|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 @@ -5738,13 +5867,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### click Generates a click of the button as if the user clicked the button @@ -5764,23 +5886,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### get_text @@ -5788,9 +5902,9 @@ Returns the current text shown on a button `get_text()` -|Name|Meaning| -|---|---| -| **return** | The text currently displayed on the button
:rtype: (str) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | The text currently displayed on the button | ### hide_row @@ -5809,12 +5923,6 @@ 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 @@ -5825,9 +5933,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -5840,9 +5948,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -5854,9 +5962,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -5866,12 +5974,6 @@ 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. @@ -5899,19 +6001,19 @@ update(text=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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]| +|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 +## ButtonMenu Element The Button Menu Element. Creates a button that when clicked will show a menu similar to right click menu @@ -5938,26 +6040,26 @@ ButtonMenu(button_text, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -5978,9 +6080,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -5992,9 +6094,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -6006,10 +6108,10 @@ Update(menu_definition, visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|menu_definition|(New menu definition (in menu definition format) :type menu_definition: List[List]| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| List[List] | menu_definition | (New menu definition (in menu definition format) | +| bool | visible | control visibility of element | ### bind @@ -6020,13 +6122,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -6037,23 +6132,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -6072,12 +6159,6 @@ 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 @@ -6088,9 +6169,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -6103,9 +6184,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -6117,9 +6198,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -6129,12 +6210,6 @@ 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. @@ -6154,12 +6229,12 @@ update(menu_definition, visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|menu_definition|(New menu definition (in menu definition format) :type menu_definition: List[List]| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| List[List] | menu_definition | (New menu definition (in menu definition format) | +| bool | visible | control visibility of element | -## Canvas Element +## Canvas Element ``` Canvas(canvas=None, @@ -6175,17 +6250,17 @@ Canvas(canvas=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),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 @@ -6197,9 +6272,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -6211,14 +6286,20 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### TKCanvas #### property: TKCanvas +Returns the underlying tkiner Canvas widget + +|Type|Name|Meaning| +|---|---|---| +|| **return** | The tkinter canvas widget | + ### bind Used to add tkinter events to an Element. @@ -6228,13 +6309,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -6245,23 +6319,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -6280,12 +6346,6 @@ 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 @@ -6296,9 +6356,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -6311,9 +6371,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -6325,14 +6385,20 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### tk_canvas #### property: tk_canvas +Returns the underlying tkiner Canvas widget + +|Type|Name|Meaning| +|---|---|---| +|| **return** | The tkinter canvas widget | + ### unbind Removes a previously bound tkinter event from an Element. @@ -6341,12 +6407,6 @@ 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. @@ -6356,7 +6416,7 @@ Unhides (makes visible again) the row container that the Element is located on. unhide_row() ``` -## Checkbox Element +## Checkbox Element Checkbox Element - Displays a checkbox and text next to it @@ -6380,23 +6440,23 @@ Checkbox(text, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -6404,9 +6464,9 @@ Return the current state of this checkbox `Get()` -|Name|Meaning| -|---|---| -| **return** | Current state of checkbox
:rtype: (bool) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | Current state of checkbox | ### SetFocus @@ -6418,9 +6478,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -6432,9 +6492,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -6443,6 +6503,7 @@ Note that changing visibility may cause element to change locations when made vi ``` Update(value=None, + text=None, background_color=None, text_color=None, disabled=None, @@ -6451,13 +6512,14 @@ Update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|Type|Name|Meaning| +|--|--|--| +| bool | value | if True checks the checkbox, False clears it | +| str | text | Text to display next to checkbox | +| 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 @@ -6468,13 +6530,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -6485,23 +6540,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### get Return the current state of this checkbox `get()` -|Name|Meaning| -|---|---| -| **return** | Current state of checkbox
:rtype: (bool) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | Current state of checkbox | ### get_size @@ -6509,9 +6556,9 @@ Return the size of an element in Pixels. Care must be taken as some elements us `get_size()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -6530,12 +6577,6 @@ 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 @@ -6546,9 +6587,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -6561,9 +6602,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -6575,9 +6616,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -6587,12 +6628,6 @@ 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. @@ -6609,6 +6644,7 @@ Note that changing visibility may cause element to change locations when made vi ``` update(value=None, + text=None, background_color=None, text_color=None, disabled=None, @@ -6617,15 +6653,16 @@ update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|Type|Name|Meaning| +|--|--|--| +| bool | value | if True checks the checkbox, False clears it | +| str | text | Text to display next to checkbox | +| 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 +## Column Element A container element that is used to create a layout within your window's layout @@ -6646,20 +6683,20 @@ Column(layout, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -6671,9 +6708,9 @@ AddRow(args=*<1 or N object>) Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|The list of elements for this row :type *args: List[Element]| +|Type|Name|Meaning| +|--|--|--| +| List[Element] | *args | The list of elements for this row | ### Layout @@ -6685,11 +6722,10 @@ Layout(rows) Parameter Descriptions: -|Name|Meaning| -|---|---| -|rows|The rows of Elements :type rows: List[List[Element]]| -||| -| **return** | Used for chaining
:rtype: (Column) | +|Type|Name|Meaning| +|--|--|--| +| List[List[Element]] | rows | The rows of Elements | +| (Column) | **RETURN** | Used for chaining ### SetFocus @@ -6701,9 +6737,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -6715,9 +6751,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -6729,9 +6765,9 @@ Update(visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| bool | visible | control visibility of element | ### add_row @@ -6743,9 +6779,9 @@ add_row(args=*<1 or N object>) Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|The list of elements for this row :type *args: List[Element]| +|Type|Name|Meaning| +|--|--|--| +| List[Element] | *args | The list of elements for this row | ### bind @@ -6756,13 +6792,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -6773,23 +6802,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -6810,11 +6831,10 @@ layout(rows) Parameter Descriptions: -|Name|Meaning| -|---|---| -|rows|The rows of Elements :type rows: List[List[Element]]| -||| -| **return** | Used for chaining
:rtype: (Column) | +|Type|Name|Meaning| +|--|--|--| +| List[List[Element]] | rows | The rows of Elements | +| (Column) | **RETURN** | Used for chaining ### set_cursor @@ -6824,12 +6844,6 @@ 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 @@ -6840,9 +6854,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -6855,9 +6869,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -6869,9 +6883,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -6881,12 +6895,6 @@ 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. @@ -6906,11 +6914,11 @@ update(visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| bool | visible | control visibility of element | -## Combo 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. @@ -6935,20 +6943,20 @@ Combo(values, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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 @@ -6957,9 +6965,9 @@ You should be using values from your call to window.Read instead. Know what you `Get()` -|Name|Meaning| -|---|---| -| **return** | Returns the value of what is currently chosen
:rtype: Union[Any, None] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | Returns the value of what is currently chosen | ### SetFocus @@ -6971,9 +6979,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -6985,9 +6993,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -7005,15 +7013,15 @@ Update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 @@ -7024,13 +7032,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -7041,14 +7042,6 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### get Returns the current (right now) value of the Combo. DO NOT USE THIS AS THE NORMAL WAY OF READING A COMBO! @@ -7056,9 +7049,9 @@ You should be using values from your call to window.Read instead. Know what you `get()` -|Name|Meaning| -|---|---| -| **return** | Returns the value of what is currently chosen
:rtype: Union[Any, None] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | Returns the value of what is currently chosen | ### get_size @@ -7066,9 +7059,9 @@ Return the size of an element in Pixels. Care must be taken as some elements us `get_size()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -7087,12 +7080,6 @@ 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 @@ -7103,9 +7090,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -7118,9 +7105,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -7132,9 +7119,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -7144,12 +7131,6 @@ 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. @@ -7175,17 +7156,17 @@ update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 +## Frame Element A Frame Element that contains other Elements. Encloses with a line around elements and a text label. @@ -7210,24 +7191,24 @@ Frame(title, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -7239,9 +7220,9 @@ AddRow(args=*<1 or N object>) Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|The list of elements for this row :type *args: List[Element]| +|Type|Name|Meaning| +|--|--|--| +| List[Element] | *args | The list of elements for this row | ### Layout @@ -7253,11 +7234,10 @@ Layout(rows) Parameter Descriptions: -|Name|Meaning| -|---|---| -|rows|The rows of Elements :type rows: List[List[Element]]| -||| -| **return** | Used for chaining
:rtype: (Frame) | +|Type|Name|Meaning| +|--|--|--| +| List[List[Element]] | rows | The rows of Elements | +| (Frame) | **RETURN** | Used for chaining ### SetFocus @@ -7269,9 +7249,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -7283,9 +7263,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -7297,10 +7277,10 @@ Update(value=None, visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|value|New text value to show on frame :type value: (Any)| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| Any | value | New text value to show on frame | +| bool | visible | control visibility of element | ### add_row @@ -7312,9 +7292,9 @@ add_row(args=*<1 or N object>) Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|The list of elements for this row :type *args: List[Element]| +|Type|Name|Meaning| +|--|--|--| +| List[Element] | *args | The list of elements for this row | ### bind @@ -7325,13 +7305,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -7342,23 +7315,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -7379,11 +7344,10 @@ layout(rows) Parameter Descriptions: -|Name|Meaning| -|---|---| -|rows|The rows of Elements :type rows: List[List[Element]]| -||| -| **return** | Used for chaining
:rtype: (Frame) | +|Type|Name|Meaning| +|--|--|--| +| List[List[Element]] | rows | The rows of Elements | +| (Frame) | **RETURN** | Used for chaining ### set_cursor @@ -7393,12 +7357,6 @@ 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 @@ -7409,9 +7367,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -7424,9 +7382,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -7438,9 +7396,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -7450,12 +7408,6 @@ 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. @@ -7475,12 +7427,12 @@ update(value=None, visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|value|New text value to show on frame :type value: (Any)| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| Any | value | New text value to show on frame | +| bool | visible | control visibility of element | -## Graph 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 @@ -7511,22 +7463,22 @@ Graph(canvas_size, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -7538,23 +7490,9 @@ BringFigureToFront(figure) Parameter Descriptions: -|Name|Meaning| -|---|---| -|figure|value returned by tkinter when creating the figure / drawing :type figure: (int)| - -### ButtonPressCallBack - -Not a user callable method. Used to get Graph click events. Called by tkinter when button is released - -``` -ButtonPressCallBack(event) -``` - -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|event|(event) event info from tkinter. Contains the x and y coordinates of a click| +|Type|Name|Meaning| +|--|--|--| +| int | figure | value returned by tkinter when creating the figure / drawing | ### DeleteFigure @@ -7566,9 +7504,9 @@ DeleteFigure(id) Parameter Descriptions: -|Name|Meaning| -|---|---| -|id|the id returned to you when calling one of the drawing methods :type id: (int)| +|Type|Name|Meaning| +|--|--|--| +| int | id | the id returned to you when calling one of the drawing methods | ### DrawArc @@ -7586,16 +7524,15 @@ DrawArc(top_left, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | id returned from tkinter that you'll need if you want to manipulate the arc
:rtype: Union[int, None] | +|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 @@ -7611,15 +7548,14 @@ DrawCircle(center_location, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | id returned from tkinter that you'll need if you want to manipulate the circle
:rtype: Union[int, None] | +|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 @@ -7636,16 +7572,15 @@ DrawImage(filename=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | id returned from tkinter that you'll need if you want to manipulate the image
:rtype: Union[int, None] | +|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 @@ -7660,14 +7595,13 @@ DrawLine(point_from, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | id returned from tktiner or None if user closed the window. id is used when you
:rtype: Union[int, None] | +|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 @@ -7683,15 +7617,14 @@ DrawOval(top_left, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | id returned from tkinter that you'll need if you want to manipulate the oval
:rtype: Union[int, None] | +|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 @@ -7705,13 +7638,12 @@ DrawPoint(point, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | id returned from tkinter that you'll need if you want to manipulate the point
:rtype: Union[int, None] | +|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 @@ -7726,14 +7658,13 @@ DrawPolygon(points, 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] | +|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 @@ -7749,15 +7680,14 @@ DrawRectangle(top_left, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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
:rtype: Union[int, None] | +|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 @@ -7774,16 +7704,15 @@ DrawText(text, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | id returned from tkinter that you'll need if you want to manipulate the text
:rtype: Union[int, None] | +|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 @@ -7803,11 +7732,10 @@ GetBoundingBox(figure) Parameter Descriptions: -|Name|Meaning| -|---|---| -|figure|a previously drawing figure :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]] | +|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 @@ -7819,25 +7747,10 @@ GetFiguresAtLocation(location) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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] | - -### 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| +|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 @@ -7849,10 +7762,10 @@ Move(x_direction, y_direction) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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]| +|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 @@ -7866,11 +7779,11 @@ MoveFigure(figure, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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]| +|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 @@ -7885,11 +7798,11 @@ RelocateFigure(figure, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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]| +|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 @@ -7901,9 +7814,9 @@ SendFigureToBack(figure) Parameter Descriptions: -|Name|Meaning| -|---|---| -|figure|value returned by tkinter when creating the figure / drawing :type figure: (int)| +|Type|Name|Meaning| +|--|--|--| +| int | figure | value returned by tkinter when creating the figure / drawing | ### SetFocus @@ -7915,9 +7828,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -7929,14 +7842,20 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### TKCanvas #### property: TKCanvas +Returns the underlying tkiner Canvas widget + +|Type|Name|Meaning| +|---|---|---| +|| **return** | The tkinter canvas widget | + ### Update Changes some of the settings for the Graph Element. Must call `Window.Read` or `Window.Finalize` prior @@ -7947,10 +7866,10 @@ Update(background_color=None, visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|background_color|color of background :type background_color: ???| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| ??? | background_color | color of background | +| bool | visible | control visibility of element | ### bind @@ -7961,13 +7880,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### bring_figure_to_front Changes Z-order of figures on the Graph. Brings the indicated figure to the front of all other drawn figures @@ -7978,23 +7890,9 @@ bring_figure_to_front(figure) Parameter Descriptions: -|Name|Meaning| -|---|---| -|figure|value returned by tkinter when creating the figure / drawing :type figure: (int)| - -### button_press_call_back - -Not a user callable method. Used to get Graph click events. Called by tkinter when button is released - -``` -button_press_call_back(event) -``` - -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|event|(event) event info from tkinter. Contains the x and y coordinates of a click| +|Type|Name|Meaning| +|--|--|--| +| int | figure | value returned by tkinter when creating the figure / drawing | ### change_coordinates @@ -8007,10 +7905,10 @@ change_coordinates(graph_bottom_left, graph_top_right) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 @@ -8022,9 +7920,9 @@ delete_figure(id) Parameter Descriptions: -|Name|Meaning| -|---|---| -|id|the id returned to you when calling one of the drawing methods :type id: (int)| +|Type|Name|Meaning| +|--|--|--| +| int | id | the id returned to you when calling one of the drawing methods | ### draw_arc @@ -8042,16 +7940,15 @@ draw_arc(top_left, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | id returned from tkinter that you'll need if you want to manipulate the arc
:rtype: Union[int, None] | +|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 @@ -8067,15 +7964,14 @@ draw_circle(center_location, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | id returned from tkinter that you'll need if you want to manipulate the circle
:rtype: Union[int, None] | +|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 @@ -8092,16 +7988,15 @@ draw_image(filename=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | id returned from tkinter that you'll need if you want to manipulate the image
:rtype: Union[int, None] | +|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 @@ -8116,14 +8011,13 @@ draw_line(point_from, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | id returned from tktiner or None if user closed the window. id is used when you
:rtype: Union[int, None] | +|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 @@ -8139,15 +8033,14 @@ draw_oval(top_left, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | id returned from tkinter that you'll need if you want to manipulate the oval
:rtype: Union[int, None] | +|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 @@ -8161,13 +8054,12 @@ draw_point(point, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | id returned from tkinter that you'll need if you want to manipulate the point
:rtype: Union[int, None] | +|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 @@ -8182,14 +8074,13 @@ draw_polygon(points, 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] | +|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 @@ -8205,15 +8096,14 @@ draw_rectangle(top_left, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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
:rtype: Union[int, None] | +|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 @@ -8230,16 +8120,15 @@ draw_text(text, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | id returned from tkinter that you'll need if you want to manipulate the text
:rtype: Union[int, None] | +|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 @@ -8259,14 +8148,6 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### get_bounding_box Given a figure, returns the upper left and lower right bounding box coordinates @@ -8277,11 +8158,10 @@ get_bounding_box(figure) Parameter Descriptions: -|Name|Meaning| -|---|---| -|figure|a previously drawing figure :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]] | +|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 @@ -8293,11 +8173,10 @@ get_figures_at_location(location) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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] | +|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 @@ -8305,9 +8184,9 @@ Return the size of an element in Pixels. Care must be taken as some elements us `get_size()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -8328,10 +8207,10 @@ move(x_direction, y_direction) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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]| +|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 @@ -8345,11 +8224,11 @@ move_figure(figure, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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]| +|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 @@ -8364,11 +8243,11 @@ relocate_figure(figure, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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]| +|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 @@ -8380,9 +8259,9 @@ send_figure_to_back(figure) Parameter Descriptions: -|Name|Meaning| -|---|---| -|figure|value returned by tkinter when creating the figure / drawing :type figure: (int)| +|Type|Name|Meaning| +|--|--|--| +| int | figure | value returned by tkinter when creating the figure / drawing | ### set_cursor @@ -8392,12 +8271,6 @@ 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 @@ -8408,9 +8281,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -8423,9 +8296,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -8437,14 +8310,20 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### tk_canvas #### property: tk_canvas +Returns the underlying tkiner Canvas widget + +|Type|Name|Meaning| +|---|---|---| +|| **return** | The tkinter canvas widget | + ### unbind Removes a previously bound tkinter event from an Element. @@ -8453,12 +8332,6 @@ 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. @@ -8478,12 +8351,12 @@ update(background_color=None, visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|background_color|color of background :type background_color: ???| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| ??? | background_color | color of background | +| bool | visible | control visibility of element | -## Image Element +## Image Element Image Element - show an image in the window. Should be a GIF or a PNG only @@ -8503,19 +8376,19 @@ Image(filename=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -8527,9 +8400,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -8541,9 +8414,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -8558,12 +8431,12 @@ Update(filename=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 @@ -8576,10 +8449,10 @@ UpdateAnimation(source, time_between_frames=0) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 @@ -8590,13 +8463,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -8607,23 +8473,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -8642,12 +8500,6 @@ 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 @@ -8658,9 +8510,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -8673,9 +8525,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -8687,9 +8539,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -8699,12 +8551,6 @@ 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. @@ -8727,12 +8573,12 @@ update(filename=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 @@ -8745,12 +8591,28 @@ update_animation(source, time_between_frames=0) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 +### 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` @@ -8778,27 +8640,27 @@ InputText(default_text="", Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((int, int),int) | 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 @@ -8806,9 +8668,9 @@ Read and return the current value of the input element. Must call `Window.Read` `Get()` -|Name|Meaning| -|---|---| -| **return** | current value of Input field or '' if error encountered
:rtype: (str) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | current value of Input field or '' if error encountered | ### SetFocus @@ -8820,9 +8682,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -8834,9 +8696,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -8854,15 +8716,15 @@ Update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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]| +|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 @@ -8873,13 +8735,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -8890,23 +8745,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### get Read and return the current value of the input element. Must call `Window.Read` or `Window.Finalize` prior `get()` -|Name|Meaning| -|---|---| -| **return** | current value of Input field or '' if error encountered
:rtype: (str) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | current value of Input field or '' if error encountered | ### get_size @@ -8914,9 +8761,9 @@ Return the size of an element in Pixels. Care must be taken as some elements us `get_size()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -8935,12 +8782,6 @@ 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 @@ -8951,9 +8792,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -8966,9 +8807,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -8980,9 +8821,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -8992,12 +8833,6 @@ 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. @@ -9023,17 +8858,17 @@ update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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]| +|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 +## 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. @@ -9062,26 +8897,26 @@ Listbox(values, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -9089,9 +8924,9 @@ Returns the items currently selected as a list of indexes `GetIndexes()` -|Name|Meaning| -|---|---| -| **return** | A list of offsets into values that is currently selected
:rtype: List[int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | A list of offsets into values that is currently selected | ### GetListValues @@ -9099,9 +8934,9 @@ Returns list of Values provided by the user in the user's format `GetListValues()` -|Name|Meaning| -|---|---| -| **return** | List of values. Can be any / mixed types -> []
:rtype: List[Any] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | List of values. Can be any / mixed types -> [] | ### SetFocus @@ -9113,9 +8948,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -9127,9 +8962,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### SetValue @@ -9141,9 +8976,9 @@ SetValue(values) Parameter Descriptions: -|Name|Meaning| -|---|---| -|values|new values to choose based on previously set values :type values: List[Any]| +|Type|Name|Meaning| +|--|--|--| +| List[Any] | values | new values to choose based on previously set values | ### Update @@ -9160,14 +8995,14 @@ Update(values=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 @@ -9178,13 +9013,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -9195,14 +9023,6 @@ expand(expand_x=False, expand_row=True) ``` -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_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 @@ -9210,9 +9030,9 @@ 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] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | The list of currently selected items. The actual items are returned, not the indexes | ### get_indexes @@ -9220,9 +9040,9 @@ Returns the items currently selected as a list of indexes `get_indexes()` -|Name|Meaning| -|---|---| -| **return** | A list of offsets into values that is currently selected
:rtype: List[int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | A list of offsets into values that is currently selected | ### get_list_values @@ -9230,9 +9050,9 @@ Returns list of Values provided by the user in the user's format `get_list_values()` -|Name|Meaning| -|---|---| -| **return** | List of values. Can be any / mixed types -> []
:rtype: List[Any] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | List of values. Can be any / mixed types -> [] | ### get_size @@ -9240,9 +9060,9 @@ Return the size of an element in Pixels. Care must be taken as some elements us `get_size()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -9261,12 +9081,6 @@ 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 @@ -9277,9 +9091,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -9292,9 +9106,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -9306,9 +9120,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### set_value @@ -9320,9 +9134,9 @@ set_value(values) Parameter Descriptions: -|Name|Meaning| -|---|---| -|values|new values to choose based on previously set values :type values: List[Any]| +|Type|Name|Meaning| +|--|--|--| +| List[Any] | values | new values to choose based on previously set values | ### unbind @@ -9332,12 +9146,6 @@ 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. @@ -9362,16 +9170,16 @@ update(values=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 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. @@ -9402,16 +9210,16 @@ Menu(menu_definition, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -9423,9 +9231,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -9437,9 +9245,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -9451,10 +9259,10 @@ Update(menu_definition=None, visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|menu_definition|??? :type menu_definition: List[List[Tuple[str, List[str]]]| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| List[List[Tuple[str, List[str]]] | menu_definition | ??? | +| bool | visible | control visibility of element | ### bind @@ -9465,13 +9273,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -9482,23 +9283,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -9517,12 +9310,6 @@ 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 @@ -9533,9 +9320,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -9548,9 +9335,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -9562,9 +9349,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -9574,12 +9361,6 @@ 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. @@ -9599,12 +9380,12 @@ update(menu_definition=None, visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|menu_definition|??? :type menu_definition: List[List[Tuple[str, List[str]]]| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| List[List[Tuple[str, List[str]]] | menu_definition | ??? | +| bool | visible | control visibility of element | -## Multiline 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 @@ -9635,28 +9416,28 @@ Multiline(default_text="", Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -9664,9 +9445,9 @@ Return current contents of the Multiline Element `Get()` -|Name|Meaning| -|---|---| -| **return** | current contents of the Multiline Element (used as an input type of Multiline
:rtype: (str) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | current contents of the Multiline Element (used as an input type of Multiline | ### SetFocus @@ -9678,9 +9459,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -9692,9 +9473,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -9715,16 +9496,16 @@ Update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 @@ -9735,13 +9516,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -9752,23 +9526,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### get Return current contents of the Multiline Element `get()` -|Name|Meaning| -|---|---| -| **return** | current contents of the Multiline Element (used as an input type of Multiline
:rtype: (str) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | current contents of the Multiline Element (used as an input type of Multiline | ### get_size @@ -9776,9 +9542,9 @@ Return the size of an element in Pixels. Care must be taken as some elements us `get_size()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -9789,6 +9555,28 @@ Hide the entire row an Element is located on. 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. @@ -9797,12 +9585,6 @@ 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 @@ -9813,9 +9595,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -9828,9 +9610,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -9842,9 +9624,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -9854,12 +9636,6 @@ 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. @@ -9888,18 +9664,18 @@ update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 +## 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 @@ -9923,20 +9699,19 @@ OptionMenu(values, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -9948,9 +9723,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -9962,9 +9737,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -9979,12 +9754,12 @@ Update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 @@ -9995,13 +9770,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -10012,23 +9780,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -10047,12 +9807,6 @@ 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 @@ -10063,9 +9817,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -10078,9 +9832,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -10092,9 +9846,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -10104,12 +9858,6 @@ 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. @@ -10132,14 +9880,14 @@ update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 Output Element - a multi-lined text area where stdout and stderr are re-routed to. @@ -10158,18 +9906,18 @@ Output(size=(None, None), Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -10177,9 +9925,9 @@ Returns the current contents of the output. Similar to Get method other Element `Get()` -|Name|Meaning| -|---|---| -| **return** | the current value of the output
:rtype: (str) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | the current value of the output | ### SetFocus @@ -10191,9 +9939,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -10205,14 +9953,20 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### TKOut #### property: TKOut +Returns the TKOutput object used to create the element + +|Type|Name|Meaning| +|---|---|---| +|| **return** | The TKOutput object | + ### Update Changes some of the settings for the Output Element. Must call `Window.Read` or `Window.Finalize` prior @@ -10223,10 +9977,10 @@ Update(value=None, visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|value|string that will replace current contents of the output area :type value: (str)| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| str | value | string that will replace current contents of the output area | +| bool | visible | control visibility of element | ### bind @@ -10237,27 +9991,22 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### 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(expand_x=False, + expand_y=False, + expand_row=True) ``` Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 @@ -10265,9 +10014,9 @@ Return the size of an element in Pixels. Care must be taken as some elements us `get_size()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -10286,12 +10035,6 @@ 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 @@ -10302,9 +10045,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -10317,9 +10060,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -10331,14 +10074,20 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### tk_out #### property: tk_out +Returns the TKOutput object used to create the element + +|Type|Name|Meaning| +|---|---|---| +|| **return** | The TKOutput object | + ### unbind Removes a previously bound tkinter event from an Element. @@ -10347,12 +10096,6 @@ 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. @@ -10372,12 +10115,12 @@ update(value=None, visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|value|string that will replace current contents of the output area :type value: (str)| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| str | value | string that will replace current contents of the output area | +| bool | visible | control visibility of element | -## Pane Element +## Pane Element A sliding Pane that is unique to tkinter. Uses Columns to create individual panes @@ -10398,20 +10141,20 @@ Pane(pane_list, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -10423,9 +10166,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -10437,9 +10180,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -10451,9 +10194,9 @@ Update(visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| bool | visible | control visibility of element | ### bind @@ -10464,13 +10207,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -10481,23 +10217,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -10516,12 +10244,6 @@ 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 @@ -10532,9 +10254,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -10547,9 +10269,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -10561,9 +10283,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -10573,12 +10295,6 @@ 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. @@ -10598,11 +10314,11 @@ update(visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| bool | visible | control visibility of element | -## ProgressBar Element +## ProgressBar Element Progress Bar Element - Displays a colored bar that is shaded as progress of some operation is made @@ -10623,20 +10339,20 @@ ProgressBar(max_value, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -10648,9 +10364,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -10662,9 +10378,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -10676,9 +10392,9 @@ Update(visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| bool | visible | control visibility of element | ### UpdateBar @@ -10690,10 +10406,10 @@ UpdateBar(current_count, max=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|current_count|sets the current value :type current_count: (int)| -|max|changes the max value :type max: (int)| +|Type|Name|Meaning| +|--|--|--| +| int | current_count | sets the current value | +| int | max | changes the max value | ### bind @@ -10704,13 +10420,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -10721,23 +10430,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -10756,12 +10457,6 @@ 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 @@ -10772,9 +10467,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -10787,9 +10482,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -10801,9 +10496,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -10813,12 +10508,6 @@ 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. @@ -10838,9 +10527,9 @@ update(visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| bool | visible | control visibility of element | ### update_bar @@ -10852,12 +10541,12 @@ update_bar(current_count, max=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|current_count|sets the current value :type current_count: (int)| -|max|changes the max value :type max: (int)| +|Type|Name|Meaning| +|--|--|--| +| int | current_count | sets the current value | +| int | max | changes the max value | -## Radio Element +## 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. @@ -10883,24 +10572,24 @@ Radio(text, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -10908,9 +10597,9 @@ A snapshot of the value of Radio Button -> (bool) `Get()` -|Name|Meaning| -|---|---| -| **return** | True if this radio button is selected
:rtype: (bool) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | True if this radio button is selected | ### ResetGroup @@ -10930,9 +10619,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -10944,9 +10633,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -10960,11 +10649,11 @@ Update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 @@ -10975,13 +10664,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -10992,23 +10674,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### get A snapshot of the value of Radio Button -> (bool) `get()` -|Name|Meaning| -|---|---| -| **return** | True if this radio button is selected
:rtype: (bool) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | True if this radio button is selected | ### get_size @@ -11016,9 +10690,9 @@ Return the size of an element in Pixels. Care must be taken as some elements us `get_size()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -11045,12 +10719,6 @@ 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 @@ -11061,9 +10729,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -11076,9 +10744,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -11090,9 +10758,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -11102,12 +10770,6 @@ 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. @@ -11129,13 +10791,13 @@ update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 +## Slider Element A slider, horizontal or vertical @@ -11164,28 +10826,28 @@ Slider(range=(None, None), Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -11197,9 +10859,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -11211,9 +10873,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -11228,12 +10890,12 @@ Update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 @@ -11244,13 +10906,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -11261,23 +10916,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -11296,12 +10943,6 @@ 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 @@ -11312,9 +10953,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -11327,9 +10968,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -11341,9 +10982,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -11353,12 +10994,6 @@ 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. @@ -11381,14 +11016,14 @@ update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 +## Spin Element A spinner with up/down buttons and a single line of text. Choose 1 values from list @@ -11412,23 +11047,23 @@ Spin(values, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -11438,9 +11073,9 @@ item returned will be an int (not a string) `Get()` -|Name|Meaning| -|---|---| -| **return** | The currently visible entry
:rtype: (Any) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | The currently visible entry | ### SetFocus @@ -11452,9 +11087,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -11466,9 +11101,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -11483,12 +11118,12 @@ Update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 @@ -11499,13 +11134,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -11516,14 +11144,6 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### get Return the current chosen value showing in spinbox. @@ -11532,9 +11152,9 @@ item returned will be an int (not a string) `get()` -|Name|Meaning| -|---|---| -| **return** | The currently visible entry
:rtype: (Any) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | The currently visible entry | ### get_size @@ -11542,9 +11162,9 @@ Return the size of an element in Pixels. Care must be taken as some elements us `get_size()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -11563,12 +11183,6 @@ 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 @@ -11579,9 +11193,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -11594,9 +11208,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -11608,9 +11222,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -11620,12 +11234,6 @@ 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. @@ -11648,14 +11256,14 @@ update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 +## StatusBar Element A StatusBar Element creates the sunken text-filled strip at the bottom. Many Windows programs have this line @@ -11679,23 +11287,23 @@ StatusBar(text, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -11707,9 +11315,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -11721,9 +11329,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -11739,13 +11347,13 @@ Update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 @@ -11756,13 +11364,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -11773,23 +11374,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -11808,12 +11401,6 @@ 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 @@ -11824,9 +11411,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -11839,9 +11426,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -11853,9 +11440,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -11865,12 +11452,6 @@ 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. @@ -11894,15 +11475,15 @@ update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 +## SystemTray A "Simulated System Tray" that duplicates the API calls available to PySimpleGUIWx and PySimpleGUIQt users. @@ -11921,14 +11502,14 @@ SystemTray(menu=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| +|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 @@ -11954,12 +11535,6 @@ 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 @@ -11976,16 +11551,15 @@ ShowMessage(title, 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) | +|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 @@ -12009,13 +11583,13 @@ Update(menu=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: ???| +|Type|Name|Meaning| +|--|--|--| +| ??? | menu | menu defintion | +| ??? | tooltip | string representing tooltip | +| ??? | filename | icon filename | +| ??? | data | icon raw image | +| ??? | data_base64 | icon base 64 image | ### close @@ -12050,17 +11624,16 @@ notify(title, 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) | +|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 @@ -12070,12 +11643,6 @@ 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 @@ -12092,16 +11659,15 @@ show_message(title, 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) | +|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 @@ -12125,15 +11691,15 @@ update(menu=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: ???| +|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 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 @@ -12157,22 +11723,22 @@ Tab(title, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -12184,26 +11750,18 @@ AddRow(args=*<1 or N object>) Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|The list of elements for this row :type *args: List[Element]| +|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) +Layout(rows) -> (Tab) used for chaining ``` -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! @@ -12222,9 +11780,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -12236,9 +11794,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -12250,10 +11808,10 @@ Update(disabled=None, visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|disabled|disable or enable state of the element :type disabled: (bool)| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| bool | disabled | disable or enable state of the element | +| bool | visible | control visibility of element | ### add_row @@ -12265,9 +11823,9 @@ add_row(args=*<1 or N object>) Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|The list of elements for this row :type *args: List[Element]| +|Type|Name|Meaning| +|--|--|--| +| List[Element] | *args | The list of elements for this row | ### bind @@ -12278,13 +11836,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -12295,23 +11846,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -12327,17 +11870,9 @@ hide_row() Not user callable. Use layout parameter instead. Creates the layout using the supplied rows of Elements ``` -layout(rows) +layout(rows) -> (Tab) used for chaining ``` -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! @@ -12354,12 +11889,6 @@ 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 @@ -12370,9 +11899,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -12385,9 +11914,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -12399,9 +11928,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -12411,12 +11940,6 @@ 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. @@ -12436,12 +11959,12 @@ update(disabled=None, visible=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|disabled|disable or enable state of the element :type disabled: (bool)| -|visible|control visibility of element :type visible: (bool)| +|Type|Name|Meaning| +|--|--|--| +| bool | disabled | disable or enable state of the element | +| bool | visible | control visibility of element | -## TabGroup Element +## TabGroup Element TabGroup Element groups together your tabs into the group of tabs you see displayed in your window @@ -12467,25 +11990,25 @@ TabGroup(layout, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -12497,11 +12020,10 @@ FindKeyFromTabName(tab_name) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tab_name|name of a tab :type tab_name: str| -||| -| **return** | Returns the key or None if no key found
:rtype: Union[key, None] | +|Type|Name|Meaning| +|--|--|--| +| str | tab_name | name of a tab | +| Union[key, None] | **RETURN** | Returns the key or None if no key found ### Get @@ -12512,9 +12034,9 @@ are using this method correctly? `Get()` -|Name|Meaning| -|---|---| -| **return** | The key of the currently selected tab or the tab's text if it has no key
:rtype: Union[Any, None] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | The key of the currently selected tab or the tab's text if it has no key | ### SetFocus @@ -12526,9 +12048,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -12540,9 +12062,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### bind @@ -12553,13 +12075,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -12570,14 +12085,6 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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 @@ -12588,11 +12095,10 @@ find_key_from_tab_name(tab_name) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tab_name|name of a tab :type tab_name: str| -||| -| **return** | Returns the key or None if no key found
:rtype: Union[key, None] | +|Type|Name|Meaning| +|--|--|--| +| str | tab_name | name of a tab | +| Union[key, None] | **RETURN** | Returns the key or None if no key found ### get @@ -12603,9 +12109,9 @@ are using this method correctly? `get()` -|Name|Meaning| -|---|---| -| **return** | The key of the currently selected tab or the tab's text if it has no key
:rtype: Union[Any, None] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | The key of the currently selected tab or the tab's text if it has no key | ### get_size @@ -12613,9 +12119,9 @@ Return the size of an element in Pixels. Care must be taken as some elements us `get_size()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -12634,12 +12140,6 @@ 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 @@ -12650,9 +12150,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -12665,9 +12165,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -12679,9 +12179,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -12691,12 +12191,6 @@ 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. @@ -12706,7 +12200,7 @@ Unhides (makes visible again) the row container that the Element is located on. unhide_row() ``` -## Table Element +## Table Element ``` Table(values, @@ -12745,40 +12239,40 @@ Table(values, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -12788,9 +12282,9 @@ user when Table was created or Updated. `Get()` -|Name|Meaning| -|---|---| -| **return** | the current table values (for now what was originally provided up updated)
:rtype: List[List[Any]] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | the current table values (for now what was originally provided up updated) | ### SetFocus @@ -12802,9 +12296,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -12816,9 +12310,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -12835,14 +12329,14 @@ Update(values=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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]]| +|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 @@ -12853,13 +12347,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -12870,14 +12357,6 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### get Dummy function for tkinter port. In the Qt port you can read back the values in the table in case they were @@ -12886,9 +12365,9 @@ user when Table was created or Updated. `get()` -|Name|Meaning| -|---|---| -| **return** | the current table values (for now what was originally provided up updated)
:rtype: List[List[Any]] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | the current table values (for now what was originally provided up updated) | ### get_size @@ -12896,9 +12375,9 @@ Return the size of an element in Pixels. Care must be taken as some elements us `get_size()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -12917,12 +12396,6 @@ 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 @@ -12933,9 +12406,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -12948,9 +12421,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -12962,9 +12435,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -12974,12 +12447,6 @@ 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. @@ -13004,16 +12471,16 @@ update(values=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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]]| +|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 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. @@ -13039,25 +12506,25 @@ Text(text="", Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -13069,9 +12536,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -13083,9 +12550,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -13101,13 +12568,13 @@ Update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 @@ -13118,13 +12585,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -13135,23 +12595,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -13170,12 +12622,6 @@ 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 @@ -13186,9 +12632,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -13201,9 +12647,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -13215,9 +12661,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -13227,12 +12673,6 @@ 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. @@ -13256,15 +12696,15 @@ update(value=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 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. @@ -13301,35 +12741,35 @@ Tree(data=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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)) or (int,(int,int)) or ((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 @@ -13341,9 +12781,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -13355,9 +12795,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### Update @@ -13374,14 +12814,14 @@ Update(values=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 @@ -13393,9 +12833,9 @@ add_treeview_data(node) Parameter Descriptions: -|Name|Meaning| -|---|---| -|node|The node to insert. Will insert all nodes from starting point downward, recursively :type node: (TreeData)| +|Type|Name|Meaning| +|--|--|--| +| TreeData | node | The node to insert. Will insert all nodes from starting point downward, recursively | ### bind @@ -13406,13 +12846,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -13423,23 +12856,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -13458,12 +12883,6 @@ 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 @@ -13474,9 +12893,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -13489,9 +12908,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -13503,9 +12922,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -13515,12 +12934,6 @@ 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. @@ -13545,16 +12958,16 @@ update(values=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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)| +|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 +## TreeData (for Tree 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 @@ -13581,13 +12994,13 @@ Insert(parent, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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]| +|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 @@ -13616,15 +13029,15 @@ insert(parent, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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]| +|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 +## 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 @@ -13635,9 +13048,9 @@ VerticalSeparator(pad=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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))| +|Type|Name|Meaning| +|--|--|--| +| (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) | pad | Amount of padding to put around element (left/right, top/bottom) or ((left, right), (top, bottom)) | ### SetFocus @@ -13649,9 +13062,9 @@ SetFocus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### SetTooltip @@ -13663,9 +13076,9 @@ SetTooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### bind @@ -13676,13 +13089,6 @@ The tkinter specific data is in the Element's member variable user_bind_event bind(bind_string, key_modifier) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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| - ### expand Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -13693,23 +13099,15 @@ expand(expand_x=False, expand_row=True) ``` -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_row|(Bool) If True the row containing the element will also expand. Without this your element is "trapped" within the row| - ### 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()` -|Name|Meaning| -|---|---| -| **return** | width and height of the element
:rtype: Tuple[int, int] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | width and height of the element | ### hide_row @@ -13728,12 +13126,6 @@ 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 @@ -13744,9 +13136,9 @@ set_focus(force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|force|if True will call focus_force otherwise calls focus_set :type force: bool| +|Type|Name|Meaning| +|--|--|--| +| bool | force | if True will call focus_force otherwise calls focus_set | ### set_size @@ -13759,9 +13151,9 @@ set_size(size=(None, None)) Parameter Descriptions: -|Name|Meaning| -|---|---| -|size|The size in characters, rows typically. In some cases they are pixels :type size: Tuple[int, int]| +|Type|Name|Meaning| +|--|--|--| +| Tuple[int, int] | size | The size in characters, rows typically. In some cases they are pixels | ### set_tooltip @@ -13773,9 +13165,9 @@ set_tooltip(tooltip_text) Parameter Descriptions: -|Name|Meaning| -|---|---| -|tooltip_text|the text to show in tooltip. :type tooltip_text: str| +|Type|Name|Meaning| +|--|--|--| +| str | tooltip_text | the text to show in tooltip. | ### unbind @@ -13785,12 +13177,6 @@ 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. @@ -13800,7 +13186,7 @@ Unhides (makes visible again) the row container that the Element is located on. unhide_row() ``` -## Window +## Window Represents a single Window @@ -13846,45 +13232,45 @@ Window(title, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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 @@ -13896,12 +13282,6 @@ Users, create a single layout (a list of lists) and pass as a parameter to Windo AddRow(args=*<1 or N object>) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|*args|List[Elements]| - ### AddRows Loops through a list of lists of elements and adds each row, list, to the layout. @@ -13912,21 +13292,15 @@ it as a parameter to the Window call is better. AddRows(rows) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|rows|List[List[Elements]] A list of a list of elements| - ### AlphaChannel #### property: AlphaChannel A property that changes the current alpha channel value (internal value) -|Name|Meaning| -|---|---| -| **return** | (float) the current alpha channel setting according to self, not read directly from tkinter | +|Type|Name|Meaning| +|---|---|---| +|| **return** | (float) the current alpha channel setting according to self, not read directly from tkinter | ### BringToFront @@ -13952,9 +13326,9 @@ Get the current location of the window's top left corner `CurrentLocation()` -|Name|Meaning| -|---|---| -| **return** | The x and y location in tuple form (x,y)
:rtype: Tuple[(int), (int)] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | The x and y location in tuple form (x,y) | ### Disable @@ -14009,12 +13383,11 @@ Elem(key, silent_on_error=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | 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] | +|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 @@ -14043,12 +13416,11 @@ Element(key, silent_on_error=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | 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] | +|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 @@ -14076,11 +13448,10 @@ Fill(values_dict) Parameter Descriptions: -|Name|Meaning| -|---|---| -|values_dict|{Element key : value} pairs :type values_dict: (Dict[Any:Any])| -||| -| **return** | returns self so can be chained with other methods
:rtype: (Window) | +|Type|Name|Meaning| +|--|--|--| +| (Dict[Any:Any]) | values_dict | {Element key : value} pairs | +| (Window) | **RETURN** | returns self so can be chained with other methods ### Finalize @@ -14090,9 +13461,9 @@ Lots of action! `Finalize()` -|Name|Meaning| -|---|---| -| **return** | Returns 'self' so that method "Chaining" can happen (read up about it as it's very cool!)
:rtype: (Window) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | Returns 'self' so that method "Chaining" can happen (read up about it as it's very cool!) | ### Find @@ -14121,12 +13492,11 @@ Find(key, silent_on_error=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | 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] | +|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 @@ -14155,12 +13525,11 @@ FindElement(key, silent_on_error=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | 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] | +|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 @@ -14168,9 +13537,9 @@ Returns the Element that currently has focus as reported by tkinter. If no eleme `FindElementWithFocus()` -|Name|Meaning| -|---|---| -| **return** | An Element if one has been found with focus or None if no element found
:rtype: Union[Element, None] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | An Element if one has been found with focus or None if no element found | ### GetScreenDimensions @@ -14178,9 +13547,9 @@ Get the screen dimensions. NOTE - you must have a window already open for this `GetScreenDimensions()` -|Name|Meaning| -|---|---| -| **return** | Tuple containing width and height of screen in pixels
:rtype: Union[Tuple[None, None], Tuple[width, height]] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | Tuple containing width and height of screen in pixels | ### GrabAnyWhereOff @@ -14221,11 +13590,10 @@ Layout(rows) Parameter Descriptions: -|Name|Meaning| -|---|---| -|rows|Your entire layout :type rows: List[List[Elements]]| -||| -| **return** | self so that you can chain method calls
:rtype: (Window) | +|Type|Name|Meaning| +|--|--|--| +| List[List[Elements]] | rows | Your entire layout | +| (Window) | **RETURN** | self so that you can chain method calls ### LoadFromDisk @@ -14237,9 +13605,9 @@ LoadFromDisk(filename) Parameter Descriptions: -|Name|Meaning| -|---|---| -|filename|Pickle Filename to load :type filename: (str)| +|Type|Name|Meaning| +|--|--|--| +| str | filename | Pickle Filename to load | ### Maximize @@ -14269,10 +13637,10 @@ Move(x, y) Parameter Descriptions: -|Name|Meaning| -|---|---| -|x|x coordinate in pixels :type x: (int)| -|y|y coordinate in pixels :type y: (int)| +|Type|Name|Meaning| +|--|--|--| +| int | x | x coordinate in pixels | +| int | y | y coordinate in pixels | ### Normal @@ -14296,13 +13664,12 @@ Read(timeout=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | (event, values)
:rtype: Tuple[(Any), Union[Dict[Any:Any]], List[Any], None] | +|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 @@ -14320,9 +13687,9 @@ Without this call your changes to a Window will not be visible to the user until `Refresh()` -|Name|Meaning| -|---|---| -| **return** | `self` so that method calls can be easily "chained"
:rtype: (Window) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | `self` so that method calls can be easily "chained" | ### SaveToDisk @@ -14335,9 +13702,9 @@ SaveToDisk(filename) Parameter Descriptions: -|Name|Meaning| -|---|---| -|filename|Filename to save the values to in pickled form :type filename: (str)| +|Type|Name|Meaning| +|--|--|--| +| str | filename | Filename to save the values to in pickled form | ### SendToBack @@ -14357,9 +13724,9 @@ SetAlpha(alpha) Parameter Descriptions: -|Name|Meaning| -|---|---| -|alpha|0 to 1. 0 is completely transparent. 1 is completely visible and solid (can't see through) :type alpha: (float)| +|Type|Name|Meaning| +|--|--|--| +| float | alpha | 0 to 1. 0 is completely transparent. 1 is completely visible and solid (can't see through) | ### SetIcon @@ -14376,10 +13743,10 @@ SetIcon(icon=None, pngbase64=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|icon|Filename or bytes object :type icon: (str)| -|pngbase64|Base64 encoded image :type pngbase64: (str)| +|Type|Name|Meaning| +|--|--|--| +| str | icon | Filename or bytes object | +| str | pngbase64 | Base64 encoded image | ### SetTransparentColor @@ -14391,9 +13758,9 @@ SetTransparentColor(color) Parameter Descriptions: -|Name|Meaning| -|---|---| -|color|Color string that defines the transparent color :type color: (str)| +|Type|Name|Meaning| +|--|--|--| +| str | color | Color string that defines the transparent color | ### Size @@ -14401,9 +13768,9 @@ Parameter Descriptions: Return the current size of the window in pixels -|Name|Meaning| -|---|---| -| **return** | (width, height) of the window
:rtype: Tuple[(int), (int)] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | (width, height) of the window | ### UnHide @@ -14420,9 +13787,9 @@ call and then have that same source run on plain PySimpleGUI. `VisibilityChanged()` -|Name|Meaning| -|---|---| -| **return** | | +|Type|Name|Meaning| +|---|---|---| +|| **return** | | ### add_row @@ -14434,12 +13801,6 @@ Users, create a single layout (a list of lists) and pass as a parameter to Windo add_row(args=*<1 or N object>) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|*args|List[Elements]| - ### add_rows Loops through a list of lists of elements and adds each row, list, to the layout. @@ -14450,21 +13811,15 @@ it as a parameter to the Window call is better. add_rows(rows) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|rows|List[List[Elements]] A list of a list of elements| - ### alpha_channel #### property: alpha_channel A property that changes the current alpha channel value (internal value) -|Name|Meaning| -|---|---| -| **return** | (float) the current alpha channel setting according to self, not read directly from tkinter | +|Type|Name|Meaning| +|---|---|---| +|| **return** | (float) the current alpha channel setting according to self, not read directly from tkinter | ### bind @@ -14477,10 +13832,10 @@ bind(bind_string, key) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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| +|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 @@ -14506,9 +13861,9 @@ Get the current location of the window's top left corner `current_location()` -|Name|Meaning| -|---|---| -| **return** | The x and y location in tuple form (x,y)
:rtype: Tuple[(int), (int)] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | The x and y location in tuple form (x,y) | ### disable @@ -14563,12 +13918,11 @@ elem(key, silent_on_error=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | 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] | +|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 @@ -14597,12 +13951,11 @@ element(key, silent_on_error=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | 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] | +|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 @@ -14610,9 +13963,9 @@ 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] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | List of all elements in the window and container elements in the window | ### enable @@ -14640,12 +13993,11 @@ 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) | +|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 @@ -14657,11 +14009,10 @@ fill(values_dict) Parameter Descriptions: -|Name|Meaning| -|---|---| -|values_dict|{Element key : value} pairs :type values_dict: (Dict[Any:Any])| -||| -| **return** | returns self so can be chained with other methods
:rtype: (Window) | +|Type|Name|Meaning| +|--|--|--| +| (Dict[Any:Any]) | values_dict | {Element key : value} pairs | +| (Window) | **RETURN** | returns self so can be chained with other methods ### finalize @@ -14671,9 +14022,9 @@ Lots of action! `finalize()` -|Name|Meaning| -|---|---| -| **return** | Returns 'self' so that method "Chaining" can happen (read up about it as it's very cool!)
:rtype: (Window) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | Returns 'self' so that method "Chaining" can happen (read up about it as it's very cool!) | ### find @@ -14702,12 +14053,11 @@ find(key, silent_on_error=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | 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] | +|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 @@ -14736,12 +14086,11 @@ find_element(key, silent_on_error=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | 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] | +|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 @@ -14749,9 +14098,9 @@ Returns the Element that currently has focus as reported by tkinter. If no eleme `find_element_with_focus()` -|Name|Meaning| -|---|---| -| **return** | An Element if one has been found with focus or None if no element found
:rtype: Union[Element, None] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | An Element if one has been found with focus or None if no element found | ### get_screen_dimensions @@ -14759,9 +14108,9 @@ Get the screen dimensions. NOTE - you must have a window already open for this `get_screen_dimensions()` -|Name|Meaning| -|---|---| -| **return** | Tuple containing width and height of screen in pixels
:rtype: Union[Tuple[None, None], Tuple[width, height]] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | Tuple containing width and height of screen in pixels | ### get_screen_size @@ -14810,11 +14159,10 @@ layout(rows) Parameter Descriptions: -|Name|Meaning| -|---|---| -|rows|Your entire layout :type rows: List[List[Elements]]| -||| -| **return** | self so that you can chain method calls
:rtype: (Window) | +|Type|Name|Meaning| +|--|--|--| +| List[List[Elements]] | rows | Your entire layout | +| (Window) | **RETURN** | self so that you can chain method calls ### load_from_disk @@ -14826,9 +14174,9 @@ load_from_disk(filename) Parameter Descriptions: -|Name|Meaning| -|---|---| -|filename|Pickle Filename to load :type filename: (str)| +|Type|Name|Meaning| +|--|--|--| +| str | filename | Pickle Filename to load | ### maximize @@ -14858,10 +14206,10 @@ move(x, y) Parameter Descriptions: -|Name|Meaning| -|---|---| -|x|x coordinate in pixels :type x: (int)| -|y|y coordinate in pixels :type y: (int)| +|Type|Name|Meaning| +|--|--|--| +| int | x | x coordinate in pixels | +| int | y | y coordinate in pixels | ### normal @@ -14885,13 +14233,12 @@ read(timeout=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | (event, values)
:rtype: Tuple[(Any), Union[Dict[Any:Any]], List[Any], None] | +|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 @@ -14909,9 +14256,9 @@ Without this call your changes to a Window will not be visible to the user until `refresh()` -|Name|Meaning| -|---|---| -| **return** | `self` so that method calls can be easily "chained"
:rtype: (Window) | +|Type|Name|Meaning| +|---|---|---| +|| **return** | `self` so that method calls can be easily "chained" | ### save_to_disk @@ -14924,9 +14271,9 @@ save_to_disk(filename) Parameter Descriptions: -|Name|Meaning| -|---|---| -|filename|Filename to save the values to in pickled form :type filename: (str)| +|Type|Name|Meaning| +|--|--|--| +| str | filename | Filename to save the values to in pickled form | ### send_to_back @@ -14946,9 +14293,9 @@ set_alpha(alpha) Parameter Descriptions: -|Name|Meaning| -|---|---| -|alpha|0 to 1. 0 is completely transparent. 1 is completely visible and solid (can't see through) :type alpha: (float)| +|Type|Name|Meaning| +|--|--|--| +| float | alpha | 0 to 1. 0 is completely transparent. 1 is completely visible and solid (can't see through) | ### set_icon @@ -14965,10 +14312,10 @@ set_icon(icon=None, pngbase64=None) Parameter Descriptions: -|Name|Meaning| -|---|---| -|icon|Filename or bytes object :type icon: (str)| -|pngbase64|Base64 encoded image :type pngbase64: (str)| +|Type|Name|Meaning| +|--|--|--| +| str | icon | Filename or bytes object | +| str | pngbase64 | Base64 encoded image | ### set_transparent_color @@ -14980,9 +14327,9 @@ set_transparent_color(color) Parameter Descriptions: -|Name|Meaning| -|---|---| -|color|Color string that defines the transparent color :type color: (str)| +|Type|Name|Meaning| +|--|--|--| +| str | color | Color string that defines the transparent color | ### size @@ -14990,9 +14337,9 @@ Parameter Descriptions: Return the current size of the window in pixels -|Name|Meaning| -|---|---| -| **return** | (width, height) of the window
:rtype: Tuple[(int), (int)] | +|Type|Name|Meaning| +|---|---|---| +|| **return** | (width, height) of the window | ### un_hide @@ -15009,9 +14356,9 @@ call and then have that same source run on plain PySimpleGUI. `visibility_changed()` -|Name|Meaning| -|---|---| -| **return** | | +|Type|Name|Meaning| +|---|---|---| +|| **return** | | ## Function Reference @@ -15037,26 +14384,18 @@ CButton(button_text, Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button| -|image_filename|image filename if there is a button image| -|image_data|in-RAM image to be displayed on button| -|image_size|size of button image in pixels| -|image_subsample|amount to reduce the size of the image| -|border_width|width of border around element| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|size|(w,h) w=characters-wide, h=rows-high (Default = (None))| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|font|specifies the font family, size, etc| -|bind_return_key|(Default = False)| -|disabled|set disable state for element (Default = False)| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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, @@ -15085,32 +14424,18 @@ CalendarButton(button_text, Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button| -|target|| -|close_when_date_chosen|(Default = True)| -|default_date_m_d_y|(Default = (None))| -|None|| -|image_filename|image filename if there is a button image| -|image_data|in-RAM image to be displayed on button| -|image_size|(Default = (None))| -|image_subsample|amount to reduce the size of the image| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|border_width|width of border around element| -|size|(w,h) w=characters-wide, h=rows-high (Default = (None))| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|disabled|set disable state for element (Default = False)| -|font|specifies the font family, size, etc| -|bind_return_key|(Default = False)| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -|locale|| -|format|| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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", @@ -15129,19 +14454,16 @@ Cancel(button_text="Cancel", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = 'Cancel')| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|disabled|set disable state for element (Default = False)| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|font|specifies the font family, size, etc| -|bind_return_key|(Default = False)| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| +|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)) or (int,(int,int)) or ((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, @@ -15165,26 +14487,18 @@ CloseButton(button_text, Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button| -|image_filename|image filename if there is a button image| -|image_data|in-RAM image to be displayed on button| -|image_size|size of button image in pixels| -|image_subsample|amount to reduce the size of the image| -|border_width|width of border around element| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|size|(w,h) w=characters-wide, h=rows-high (Default = (None))| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|font|specifies the font family, size, etc| -|bind_return_key|(Default = False)| -|disabled|set disable state for element (Default = False)| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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, @@ -15209,27 +14523,18 @@ ColorChooserButton(button_text, Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button| -|target|| -|image_filename|image filename if there is a button image| -|image_data|in-RAM image to be displayed on button| -|image_size|(Default = (None))| -|image_subsample|amount to reduce the size of the image| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|border_width|width of border around element| -|size|(w,h) w=characters-wide, h=rows-high (Default = (None))| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|disabled|set disable state for element (Default = False)| -|font|specifies the font family, size, etc| -|bind_return_key|(Default = False)| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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="", @@ -15248,21 +14553,17 @@ Debug(button_text="", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = '')| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|disabled|set disable state for element (Default = False)| -|font|specifies the font family, size, etc| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|bind_return_key|(Default = False)| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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, @@ -15286,26 +14587,18 @@ DummyButton(button_text, Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button| -|image_filename|image filename if there is a button image| -|image_data|in-RAM image to be displayed on button| -|image_size|size of button image in pixels| -|image_subsample|amount to reduce the size of the image| -|border_width|width of border around element| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|size|(w,h) w=characters-wide, h=rows-high (Default = (None))| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|font|specifies the font family, size, etc| -|disabled|set disable state for element (Default = False)| -|bind_return_key|(Default = False)| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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", @@ -15324,19 +14617,16 @@ Exit(button_text="Exit", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = 'Exit')| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|disabled|set disable state for element (Default = False)| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|font|specifies the font family, size, etc| -|bind_return_key|(Default = False)| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| +|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)) or (int,(int,int)) or ((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", @@ -15358,24 +14648,17 @@ FileBrowse(button_text="Browse", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = 'Browse')| -|target|key or (row,col) target for the button (Default value = (ThisRow, -1))| -|file_types|(Default value = (("ALL Files", "*.*")))| -|initial_folder|starting path for folders and files| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|change_submits|If True, pressing Enter key submits window (Default = False)| -|enable_events|Turns on the element specific events.(Default = False)| -|font|Union[str, Tuple[str, int]] specifies the font family, size, etc| -|disabled|set disable state for element (Default = False)| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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...", @@ -15397,24 +14680,17 @@ FileSaveAs(button_text="Save As...", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = 'Save As...')| -|target|key or (row,col) target for the button (Default value = (ThisRow, -1))| -|file_types|(Default value = (("ALL Files", "*.*")))| -|initial_folder|starting path for folders and files| -|disabled|set disable state for element (Default = False)| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|change_submits|If True, pressing Enter key submits window (Default = False)| -|enable_events|Turns on the element specific events.(Default = False)| -|font|Union[str, Tuple[str, int]] specifies the font family, size, etc| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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 @@ -15439,24 +14715,17 @@ FilesBrowse(button_text="Browse", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = 'Browse')| -|target|key or (row,col) target for the button (Default value = (ThisRow, -1))| -|file_types|(Default value = (("ALL Files", "*.*")))| -|disabled|set disable state for element (Default = False)| -|initial_folder|starting path for folders and files| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|change_submits|If True, pressing Enter key submits window (Default = False)| -|enable_events|Turns on the element specific events.(Default = False)| -|font|Union[str, Tuple[str, int]] specifies the font family, size, etc| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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 } @@ -15466,10 +14735,10 @@ FillFormWithValues(window, values_dict) Parameter Descriptions: -|Name|Meaning| -|---|---| -|window|(Window) The window object to fill| -|values_dict|(Dict[Any:Any]) A dictionary with element keys as key and value is values parm for Update call| +|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", @@ -15490,23 +14759,13 @@ FolderBrowse(button_text="Browse", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = 'Browse')| -|target|key or (row,col) target for the button (Default value = (ThisRow, -1))| -|initial_folder|starting path for folders and files| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|disabled|set disable state for element (Default = False)| -|change_submits|If True, pressing Enter key submits window (Default = False)| -|enable_events|Turns on the element specific events.(Default = False)| -|font|Union[str, Tuple[str, int]] specifies the font family, size, etc| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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", @@ -15525,21 +14784,17 @@ Help(button_text="Help", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = 'Help')| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|disabled|set disable state for element (Default = False)| -|font|specifies the font family, size, etc| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|bind_return_key|(Default = False)| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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", @@ -15558,19 +14813,16 @@ No(button_text="No", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = 'No')| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|disabled|set disable state for element (Default = False)| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|font|specifies the font family, size, etc| -|bind_return_key|(Default = False)| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| +|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)) or (int,(int,int)) or ((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", @@ -15589,21 +14841,17 @@ OK(button_text="OK", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = 'OK')| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|disabled|set disable state for element (Default = False)| -|bind_return_key|(Default = True)| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|font|specifies the font family, size, etc| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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 @@ -15613,10 +14861,11 @@ ObjToString(obj, extra=" ") Parameter Descriptions: -|Name|Meaning| -|---|---| -|obj|(Any) The object to display| -|extra|(Default value = ' ') returns (str) Formatted output of the object's values| +|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 @@ -15625,12 +14874,6 @@ Returns only the top-most object's variables instead of drilling down to dispola ObjToStringSingleObj(obj) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|obj|(Any) The object to display returns (str) Formatted output of the object's values| - ``` Ok(button_text="Ok", size=(None, None), @@ -15648,21 +14891,17 @@ Ok(button_text="Ok", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = 'Ok')| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|disabled|set disable state for element (Default = False)| -|bind_return_key|(Default = True)| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|font|specifies the font family, size, etc| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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", @@ -15681,19 +14920,16 @@ Open(button_text="Open", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = 'Open')| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|disabled|set disable state for element (Default = False)| -|bind_return_key|(Default = True)| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|font|specifies the font family, size, etc| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| +|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)) or (int,(int,int)) or ((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", @@ -15712,21 +14948,17 @@ Quit(button_text="Quit", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = 'Quit')| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|disabled|set disable state for element (Default = False)| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|font|specifies the font family, size, etc| -|bind_return_key|(Default = False)| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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, @@ -15750,24 +14982,17 @@ RButton(button_text, Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button| -|image_filename|image filename if there is a button image| -|image_data|in-RAM image to be displayed on button| -|image_size|size of button image in pixels| -|image_subsample|amount to reduce the size of the image| -|border_width|width of border around element| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|size|(w,h) w=characters-wide, h=rows-high (Default = (None))| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|font|specifies the font family, size, etc| -|bind_return_key|(Default = False)| -|disabled|set disable state for element (Default = False)| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| +|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)) or (int,(int,int)) or ((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, @@ -15791,24 +15016,17 @@ ReadButton(button_text, Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button| -|image_filename|image filename if there is a button image| -|image_data|in-RAM image to be displayed on button| -|image_size|size of button image in pixels| -|image_subsample|amount to reduce the size of the image| -|border_width|width of border around element| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|size|(w,h) w=characters-wide, h=rows-high (Default = (None))| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|font|specifies the font family, size, etc| -|bind_return_key|(Default = False)| -|disabled|set disable state for element (Default = False)| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| +|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)) or (int,(int,int)) or ((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, @@ -15832,24 +15050,17 @@ RealtimeButton(button_text, Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button| -|image_filename|image filename if there is a button image| -|image_data|in-RAM image to be displayed on button| -|image_size|size of button image in pixels| -|image_subsample|amount to reduce the size of the image| -|border_width|width of border around element| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|size|(w,h) w=characters-wide, h=rows-high (Default = (None))| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|font|specifies the font family, size, etc| -|disabled|set disable state for element (Default = False)| -|bind_return_key|(Default = False)| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| +|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)) or (int,(int,int)) or ((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", @@ -15868,21 +15079,17 @@ Save(button_text="Save", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = 'Save')| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|bind_return_key|(Default = True)| -|disabled|set disable state for element (Default = False)| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|font|specifies the font family, size, etc| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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...", @@ -15904,24 +15111,17 @@ SaveAs(button_text="Save As...", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = 'Save As...')| -|target|key or (row,col) target for the button (Default value = (ThisRow, -1))| -|file_types|(Default value = (("ALL Files", "*.*")))| -|initial_folder|starting path for folders and files| -|disabled|set disable state for element (Default = False)| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|change_submits|If True, pressing Enter key submits window (Default = False)| -|enable_events|Turns on the element specific events.(Default = False)| -|font|Union[str, Tuple[str, int]] specifies the font family, size, etc| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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. @@ -15946,19 +15146,18 @@ ScrolledTextBox(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|(Any) Variable number of items to display| -|title|(str) Title to display in the window.| -|button_color|Tuple[str, str] button color (foreground, background)| -|yes_no|(bool) If True, displays Yes and No buttons instead of Ok| -|auto_close|(bool) if True window will close itself| -|auto_close_duration|Union[int, float] Older versions only accept int. Time in seconds until window will close| -|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high| -|location|Tuple[int, int] Location on the screen to place the upper left corner of the window| -|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 | +|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. @@ -15967,12 +15166,6 @@ window is created. SetGlobalIcon(icon) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|icon|Union[bytes, str] Either a Base64 byte string or a filename| - ``` SetOptions(icon=None, button_color=None, @@ -16013,43 +15206,37 @@ SetOptions(icon=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|icon|filename of icon used for taskbar and title bar| -|button_color|button color (foreground, background)| -|element_size|Tuple[int, int] element size (width, height) in characters| -|button_element_size|Tuple[int, int]| -|margins|tkinter margins around outsize (Default = (None))| -|element_padding|(Default = (None))| -|auto_size_text|True if size should fit the text length| -|auto_size_buttons|| -|font|specifies the font family, size, etc| -|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|| -|progress_meter_relief|| -|progress_meter_color|| -|progress_meter_size|Tuple[int, int]| -|text_justification|| -|background_color|color of background| -|element_background_color|| -|text_element_background_color|| -|input_elements_background_color|| -|input_text_color|| -|scrollbar_color|| -|text_color|color of the text| -|element_text_color|| -|debug_win_size|Tuple[int, int] (Default = (None))| -|window_location|(Default = (None))| -|error_button_color|(Default = (None))| -|tooltip_time|time in milliseconds to wait before showing a tooltip. Default is 400ms| -|use_ttk_buttons|(bool) if True will cause all buttons to be ttk buttons| -|ttk_theme|(str) Theme to use with ttk widgets. Choices (on Windows) include - 'default', 'winnative', 'clam', 'alt', 'classic', 'vista', 'xpnative'| +|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", @@ -16068,21 +15255,17 @@ Submit(button_text="Submit", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = 'Submit')| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|disabled|set disable state for element (Default = False)| -|bind_return_key|(Default = True)| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|font|specifies the font family, size, etc| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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", @@ -16101,24 +15284,22 @@ Yes(button_text="Yes", Parameter Descriptions: -|Name|Meaning| -|---|---| -|button_text|text in the button (Default value = 'Yes')| -|size|(w,h) w=characters-wide, h=rows-high| -|auto_size_button|True if button size is determined by button text| -|button_color|button color (foreground, background)| -|disabled|set disable state for element (Default = False)| -|tooltip|(str) text, that will appear when mouse hovers over the element| -|font|specifies the font family, size, etc| -|bind_return_key|(Default = True)| -|focus|if focus should be set to this| -|pad|Amount of padding to put around element| -|key|Used with window.FindElement and with return values to uniquely identify this element| -||| -| **return** | (Button) | +|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)) or (int,(int,int)) or ((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 +Works like a "print" statement but with windowing options. Routes output to the "Debug Window" + ``` easy_print(args=*<1 or N object>, size=(None, None), @@ -16137,23 +15318,31 @@ easy_print(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high| -|end|| -|sep|| -|location|Location on screen to display| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|no_button|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|do_not_reroute_stdout|(Default = True)| +|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 | + +Close a previously opened EasyPrint window ``` easy_print_close() ``` +Works like a "print" statement but with windowing options. Routes output to the "Debug Window" + ``` eprint(args=*<1 or N object>, size=(None, None), @@ -16172,18 +15361,24 @@ eprint(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high| -|end|| -|sep|| -|location|Location on screen to display| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|no_button|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|do_not_reroute_stdout|(Default = True)| +|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 | + +Works like a "print" statement but with windowing options. Routes output to the "Debug Window" ``` sgprint(args=*<1 or N object>, @@ -16203,23 +15398,31 @@ sgprint(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high| -|end|| -|sep|| -|location|Location on screen to display| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|no_button|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|do_not_reroute_stdout|(Default = True)| +|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 | + +Close a previously opened EasyPrint window ``` sgprint_close() ``` +Works like a "print" statement but with windowing options. Routes output to the "Debug Window" + ``` EasyPrint(args=*<1 or N object>, size=(None, None), @@ -16238,23 +15441,31 @@ EasyPrint(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high| -|end|| -|sep|| -|location|Location on screen to display| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|no_button|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|do_not_reroute_stdout|(Default = True)| +|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 | + +Close a previously opened EasyPrint window ``` EasyPrintClose() ``` +Works like a "print" statement but with windowing options. Routes output to the "Debug Window" + ``` Print(args=*<1 or N object>, size=(None, None), @@ -16273,18 +15484,24 @@ Print(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high| -|end|| -|sep|| -|location|Location on screen to display| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|no_button|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|do_not_reroute_stdout|(Default = True)| +|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 | + +Close a previously opened EasyPrint window ``` PrintClose() @@ -16303,26 +15520,27 @@ OneLineProgressMeter(title, button_color=None, size=(20, 20), border_width=None, - grab_anywhere=False) + grab_anywhere=False, + no_titlebar=False) ``` Parameter Descriptions: -|Name|Meaning| -|---|---| -|title|text to display| -|current_value|current progressbar value| -|max_value|max value of progressbar| -|key|Used with window.FindElement and with return values to uniquely identify this element| -|*args|stuff to output.| -|orientation|'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical')(Default value = 'v')| -|bar_color|| -|button_color|button color (foreground, background)| -|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 | +|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') | +| Tuple(str, 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 | no_titlebar | If True: no titlebar will be shown on the window | +| (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 @@ -16332,9 +15550,9 @@ OneLineProgressMeterCancel(key) Parameter Descriptions: -|Name|Meaning| -|---|---| -|key|Key used when meter was created| +|Type|Name|Meaning| +|--|--|--| +| Any | key | Key used when meter was created | ``` one_line_progress_meter(title, @@ -16347,26 +15565,27 @@ one_line_progress_meter(title, button_color=None, size=(20, 20), border_width=None, - grab_anywhere=False) + grab_anywhere=False, + no_titlebar=False) ``` Parameter Descriptions: -|Name|Meaning| -|---|---| -|title|text to display| -|current_value|current progressbar value| -|max_value|max value of progressbar| -|key|Used with window.FindElement and with return values to uniquely identify this element| -|*args|stuff to output.| -|orientation|'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical')(Default value = 'v')| -|bar_color|| -|button_color|button color (foreground, background)| -|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 | +|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') | +| Tuple(str, 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 | no_titlebar | If True: no titlebar will be shown on the window | +| (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 @@ -16376,9 +15595,9 @@ one_line_progress_meter_cancel(key) Parameter Descriptions: -|Name|Meaning| -|---|---| -|key|Key used when meter was created| +|Type|Name|Meaning| +|--|--|--| +| Any | key | Key used when meter was created | ## Popup Functions @@ -16407,26 +15626,25 @@ Popup(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*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** | Returns text of the button that was pressed. None will be returned if user closed window with X
:rtype: Union[str, None] | +|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 | +| int | 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 @@ -16445,25 +15663,27 @@ PopupAnimated(image_source, location=(None, None), alpha_channel=None, time_between_frames=0, - transparent_color=None) + transparent_color=None, + title="") ``` Parameter Descriptions: -|Name|Meaning| -|---|---| -|image_source|Union[str, bytes] Either a filename or a base64 string.| -|message|(str) An optional message to be shown with the animation| -|background_color|(str) color of background| -|text_color|(str) color of the text| -|font|Union[str, tuple) specifies the font family, size, etc| -|no_titlebar|(bool) If True then the titlebar and window frame will not be shown| -|grab_anywhere|(bool) If True then you can move the window just clicking anywhere on window, hold and drag| -|keep_on_top|(bool) If True then Window will remain on top of all other windows currently shownn| -|location|(int, int) (x,y) location on the screen to place the top left corner of your window. Default is to center on screen| -|alpha_channel|(float) Window transparency 0 = invisible 1 = completely visible. Values between are see through| -|time_between_frames|(int) Amount of time in milliseconds between each frame| -|transparent_color|(str) This color will be completely see-through in your window. Can even click through| +|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 | +| str | title | Title that will be shown on the window | Display a Popup without a titlebar. Enables grab anywhere so you can move it @@ -16487,22 +15707,23 @@ PopupAnnoying(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|grab_anywhere|(Default = True)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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 @@ -16527,23 +15748,24 @@ PopupAutoClose(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = True)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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 @@ -16567,22 +15789,23 @@ PopupCancel(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|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 @@ -16606,22 +15829,23 @@ PopupError(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|(Default = (None))| +|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. @@ -16649,29 +15873,28 @@ PopupGetFile(message, Parameter Descriptions: -|Name|Meaning| -|---|---| -|message|(str) message displayed to user| -|title|(str) Window title| -|default_path|(str) path to display to user as starting point (filled into the input field)| -|default_extension|(str) If no extension entered by user, add this to filename (only used in saveas dialogs)| -|save_as|(bool) if True, the "save as" dialog is shown which will verify before overwriting| -|multiple_files|(bool) if True, then allows multiple files to be selected that are returned with ';' between each filename| -|file_types|Tuple[Tuple[str,str]] List of extensions to show using wildcards. All files (the default) = (("ALL Files", "*.*"),)| -|no_window|(bool) if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown| -|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| -|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 | +|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. @@ -16695,25 +15918,24 @@ PopupGetFolder(message, Parameter Descriptions: -|Name|Meaning| -|---|---| -|message|(str) message displayed to user| -|title|(str) Window title| -|default_path|(str) path to display to user as starting point (filled into the input field)| -|no_window|(bool) if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown| -|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| -|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 | +|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 @@ -16736,24 +15958,23 @@ PopupGetText(message, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | Text entered or None if window was closed or cancel button clicked
:rtype: Union[str, None] | +|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 @@ -16777,29 +15998,29 @@ PopupNoBorder(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|grab_anywhere|(Default = True)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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, - button_color=None, background_color=None, text_color=None, auto_close=False, @@ -16816,22 +16037,21 @@ PopupNoButtons(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|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 @@ -16855,22 +16075,23 @@ PopupNoFrame(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|grab_anywhere|(Default = True)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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 @@ -16894,22 +16115,23 @@ PopupNoTitlebar(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|grab_anywhere|(Default = True)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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) @@ -16934,23 +16156,23 @@ PopupNoWait(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = True)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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) @@ -16975,23 +16197,23 @@ PopupNonBlocking(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = True)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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 @@ -17015,22 +16237,23 @@ PopupOK(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|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 @@ -17054,24 +16277,24 @@ PopupOKCancel(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|Location on screen to display| -||| -| **return** | Union["OK", "Cancel", None] | +|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 @@ -17096,23 +16319,23 @@ PopupQuick(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = True)| -|auto_close_duration|(Default value = 2)| -|non_blocking|(Default = True)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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. @@ -17137,23 +16360,23 @@ PopupQuickMessage(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_NO_BUTTONS)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = True)| -|auto_close_duration|(Default value = 2)| -|non_blocking|(Default = True)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = True)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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. @@ -17178,19 +16401,18 @@ PopupScrolled(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|(Any) Variable number of items to display| -|title|(str) Title to display in the window.| -|button_color|Tuple[str, str] button color (foreground, background)| -|yes_no|(bool) If True, displays Yes and No buttons instead of Ok| -|auto_close|(bool) if True window will close itself| -|auto_close_duration|Union[int, float] Older versions only accept int. Time in seconds until window will close| -|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high| -|location|Tuple[int, int] Location on the screen to place the upper left corner of the window| -|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 | +|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 @@ -17215,23 +16437,24 @@ PopupTimed(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = True)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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 @@ -17255,24 +16478,24 @@ PopupYesNo(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|Location on screen to display| -||| -| **return** | Union["Yes", "No", None] | +|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 @@ -17301,26 +16524,25 @@ popup(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*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** | Returns text of the button that was pressed. None will be returned if user closed window with X
:rtype: Union[str, None] | +|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 | +| int | 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 @@ -17339,25 +16561,27 @@ popup_animated(image_source, location=(None, None), alpha_channel=None, time_between_frames=0, - transparent_color=None) + transparent_color=None, + title="") ``` Parameter Descriptions: -|Name|Meaning| -|---|---| -|image_source|Union[str, bytes] Either a filename or a base64 string.| -|message|(str) An optional message to be shown with the animation| -|background_color|(str) color of background| -|text_color|(str) color of the text| -|font|Union[str, tuple) specifies the font family, size, etc| -|no_titlebar|(bool) If True then the titlebar and window frame will not be shown| -|grab_anywhere|(bool) If True then you can move the window just clicking anywhere on window, hold and drag| -|keep_on_top|(bool) If True then Window will remain on top of all other windows currently shownn| -|location|(int, int) (x,y) location on the screen to place the top left corner of your window. Default is to center on screen| -|alpha_channel|(float) Window transparency 0 = invisible 1 = completely visible. Values between are see through| -|time_between_frames|(int) Amount of time in milliseconds between each frame| -|transparent_color|(str) This color will be completely see-through in your window. Can even click through| +|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 | +| str | title | Title that will be shown on the window | Display a Popup without a titlebar. Enables grab anywhere so you can move it @@ -17381,22 +16605,23 @@ popup_annoying(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|grab_anywhere|(Default = True)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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 @@ -17421,23 +16646,24 @@ popup_auto_close(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = True)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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 @@ -17461,22 +16687,23 @@ popup_cancel(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|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 @@ -17500,22 +16727,23 @@ popup_error(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|(Default = (None))| +|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. @@ -17543,29 +16771,28 @@ popup_get_file(message, Parameter Descriptions: -|Name|Meaning| -|---|---| -|message|(str) message displayed to user| -|title|(str) Window title| -|default_path|(str) path to display to user as starting point (filled into the input field)| -|default_extension|(str) If no extension entered by user, add this to filename (only used in saveas dialogs)| -|save_as|(bool) if True, the "save as" dialog is shown which will verify before overwriting| -|multiple_files|(bool) if True, then allows multiple files to be selected that are returned with ';' between each filename| -|file_types|Tuple[Tuple[str,str]] List of extensions to show using wildcards. All files (the default) = (("ALL Files", "*.*"),)| -|no_window|(bool) if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown| -|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| -|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 | +|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. @@ -17589,25 +16816,24 @@ popup_get_folder(message, Parameter Descriptions: -|Name|Meaning| -|---|---| -|message|(str) message displayed to user| -|title|(str) Window title| -|default_path|(str) path to display to user as starting point (filled into the input field)| -|no_window|(bool) if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown| -|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| -|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 | +|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 @@ -17630,24 +16856,23 @@ popup_get_text(message, Parameter Descriptions: -|Name|Meaning| -|---|---| -|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** | Text entered or None if window was closed or cancel button clicked
:rtype: Union[str, None] | +|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 @@ -17671,29 +16896,29 @@ popup_no_border(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|grab_anywhere|(Default = True)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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, - button_color=None, background_color=None, text_color=None, auto_close=False, @@ -17710,22 +16935,21 @@ popup_no_buttons(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|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 @@ -17749,22 +16973,23 @@ popup_no_frame(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|grab_anywhere|(Default = True)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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 @@ -17788,22 +17013,23 @@ popup_no_titlebar(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|grab_anywhere|(Default = True)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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) @@ -17828,23 +17054,23 @@ popup_no_wait(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = True)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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) @@ -17869,23 +17095,23 @@ popup_non_blocking(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = True)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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 @@ -17909,22 +17135,23 @@ popup_ok(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|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 @@ -17948,24 +17175,24 @@ popup_ok_cancel(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|Location on screen to display| -||| -| **return** | Union["OK", "Cancel", None] | +|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 @@ -17990,23 +17217,23 @@ popup_quick(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = True)| -|auto_close_duration|(Default value = 2)| -|non_blocking|(Default = True)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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. @@ -18031,23 +17258,23 @@ popup_quick_message(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_NO_BUTTONS)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = True)| -|auto_close_duration|(Default value = 2)| -|non_blocking|(Default = True)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = True)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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. @@ -18072,19 +17299,18 @@ popup_scrolled(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|(Any) Variable number of items to display| -|title|(str) Title to display in the window.| -|button_color|Tuple[str, str] button color (foreground, background)| -|yes_no|(bool) If True, displays Yes and No buttons instead of Ok| -|auto_close|(bool) if True window will close itself| -|auto_close_duration|Union[int, float] Older versions only accept int. Time in seconds until window will close| -|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high| -|location|Tuple[int, int] Location on the screen to place the upper left corner of the window| -|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 | +|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 @@ -18109,23 +17335,24 @@ popup_timed(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_type|(Default value = POPUP_BUTTONS_OK)| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = True)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|| +|Type|Name|Meaning| +|--|--|--| +| Any | *args | Variable number of items to display | +| str | title | Title to display in the window. | +| int | 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 @@ -18149,24 +17376,24 @@ popup_yes_no(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|| -|title|| -|button_color|button color (foreground, background)| -|background_color|color of background| -|text_color|color of the text| -|auto_close|(Default = False)| -|auto_close_duration|| -|non_blocking|(Default = False)| -|icon|Icon to display| -|line_width|Width of lines in characters| -|font|specifies the font family, size, etc| -|no_titlebar|(Default = False)| -|grab_anywhere|If True can grab anywhere to move the window (Default = False)| -|location|Location on screen to display| -||| -| **return** | Union["Yes", "No", None] | +|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 @@ -18178,10 +17405,10 @@ fill_form_with_values(window, values_dict) Parameter Descriptions: -|Name|Meaning| -|---|---| -|window|(Window) The window object to fill| -|values_dict|(Dict[Any:Any]) A dictionary with element keys as key and value is values parm for Update call| +|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. @@ -18197,10 +17424,11 @@ obj_to_string(obj, extra=" ") Parameter Descriptions: -|Name|Meaning| -|---|---| -|obj|(Any) The object to display| -|extra|(Default value = ' ') returns (str) Formatted output of the object's values| +|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 @@ -18209,12 +17437,6 @@ Returns only the top-most object's variables instead of drilling down to dispola obj_to_string_single_obj(obj) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|obj|(Any) The object to display returns (str) Formatted output of the object's values| - Sets the icon which will be used any time a window is created if an icon is not provided when the window is created. @@ -18222,12 +17444,6 @@ window is created. set_global_icon(icon) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|icon|Union[bytes, str] Either a Base64 byte string or a filename| - ``` set_options(icon=None, button_color=None, @@ -18268,43 +17484,37 @@ set_options(icon=None, Parameter Descriptions: -|Name|Meaning| -|---|---| -|icon|filename of icon used for taskbar and title bar| -|button_color|button color (foreground, background)| -|element_size|Tuple[int, int] element size (width, height) in characters| -|button_element_size|Tuple[int, int]| -|margins|tkinter margins around outsize (Default = (None))| -|element_padding|(Default = (None))| -|auto_size_text|True if size should fit the text length| -|auto_size_buttons|| -|font|specifies the font family, size, etc| -|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|| -|progress_meter_relief|| -|progress_meter_color|| -|progress_meter_size|Tuple[int, int]| -|text_justification|| -|background_color|color of background| -|element_background_color|| -|text_element_background_color|| -|input_elements_background_color|| -|input_text_color|| -|scrollbar_color|| -|text_color|color of the text| -|element_text_color|| -|debug_win_size|Tuple[int, int] (Default = (None))| -|window_location|(Default = (None))| -|error_button_color|(Default = (None))| -|tooltip_time|time in milliseconds to wait before showing a tooltip. Default is 400ms| -|use_ttk_buttons|(bool) if True will cause all buttons to be ttk buttons| -|ttk_theme|(str) Theme to use with ttk widgets. Choices (on Windows) include - 'default', 'winnative', 'clam', 'alt', 'classic', 'vista', 'xpnative'| +|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 @@ -18314,9 +17524,9 @@ show_debugger_popout_window(location=(None, None), args=*<1 or N object>) Parameter Descriptions: -|Name|Meaning| -|---|---| -|location|Locations (x,y) on the screen to place upper left corner of the window :type location: Tuple[int, int]| +|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 @@ -18324,12 +17534,6 @@ Shows the large main debugger window show_debugger_window(location=(None, None), args=*<1 or N object>) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|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. @@ -18353,19 +17557,18 @@ sprint(args=*<1 or N object>, Parameter Descriptions: -|Name|Meaning| -|---|---| -|*args|(Any) Variable number of items to display| -|title|(str) Title to display in the window.| -|button_color|Tuple[str, str] button color (foreground, background)| -|yes_no|(bool) If True, displays Yes and No buttons instead of Ok| -|auto_close|(bool) if True window will close itself| -|auto_close_duration|Union[int, float] Older versions only accept int. Time in seconds until window will close| -|size|Tuple[int, int] (w,h) w=characters-wide, h=rows-high| -|location|Tuple[int, int] Location on the screen to place the upper left corner of the window| -|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 | +|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. @@ -18379,65 +17582,57 @@ Sets / Gets the current Theme. If none is specified then returns the current th This call replaces the ChangeLookAndFeel / change_look_and_feel call which only sets the theme. ``` -theme(new_theme=None) +theme(new_theme=None) -> (str) the currently selected theme ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|new_theme|(str) the new theme name to use| -||| -| **return** | (str) the currently selected theme | - 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 +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 +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) +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 +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 +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 +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 +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 +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 @@ -18446,46 +17641,40 @@ Show a window with all of the color themes - takes a while so be patient theme_previewer(columns=12) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|columns|(int) number of themes in a single row| - Sets/Returns the progress meter border width currently in use ``` -theme_progress_bar_border_width(border_width=None) -> (int) - 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) +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 +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 +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 +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 +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() @@ -18509,10 +17698,10 @@ ChangeLookAndFeel(index, force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|index|(str) the name of the index into the Look and Feel table (does not have to be exact, can be "fuzzy")| -|force|(bool) no longer used| +|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 @@ -18527,12 +17716,6 @@ They are sorted alphabetically. The legacy color names are mixed in, but otherw preview_all_look_and_feel_themes(columns=12) ``` -Parameter Descriptions: - -|Name|Meaning| -|---|---| -|columns|(int) The number of themes to display per row| - Get a list of the valid values to pass into your call to change_look_and_feel ``` @@ -18558,10 +17741,10 @@ change_look_and_feel(index, force=False) Parameter Descriptions: -|Name|Meaning| -|---|---| -|index|(str) the name of the index into the Look and Feel table (does not have to be exact, can be "fuzzy")| -|force|(bool) no longer used| +|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 | --- @@ -19900,7 +19083,7 @@ Quick patch to remove change to popup Quick patch to remove f-string for 3.5 compat. -## 4.16.0 PySimpleGUI 08-Jan-2020 +## 4.16.0 PySimpleGUI 20-Feb-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 @@ -19930,6 +19113,45 @@ Note - there is a known problem with the built-in debugger created when the new * 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 +## 4.17.0 PySimpleGUI 24-Mar-2020 + +The "it's been a minute" release +Improved DocStrings and documentation! +Upgrade utility +"Printing" directly to Multiline + +* New upgrade utility to upgrade your installed package using GitHub version + * Can invoke from command line. Run `python -m PySimpleGUI.PySimpleGUI upgrade` + * The test harness GUI has an upgrade button +* Multiline.print - Add multiline element to the front of any print statement. Also supports color output +* Debug informmation like path and version displayed in test harness GUI +* Added back the TRANSPARENT_BUTTON variable until can find a better way to deprecate +* All elements were losing padding when made invisible. Fixed +* Image.update - fixed crash due to not checking for type before getting size +* Image.update_animation_no_buffering - playback GIF animations of any length +* Graph element - Fixed divide by zero error in convert function +* TabGroup will now autonumber keys if none specified +* Measuring strings more accurately during layout + * Using specific font for measurement + * Used to compute TTK button height + * Used to compute Slider length + * Used to compute header widths in Tables, Trees + * Used to compute column widths in Tables, Trees + * Used to compute row heights in Tables +* Removed padx from row frames. Was using window's margins. Now padx & pady = 0. Was causing too every Column element to have extra padding +* Added no_titlebar to one line progress meter +* popup_notify - Creates a "notification window" that is like the System Tray Message window +* shell_with_animation - launch a shell command that runs while an animated GIF is shown +* Fixed problem with debugger not working after the recent close parameter addition to Window.read + +## 4.18.0 PySimpleGUI 26-Mar-2020 + +An "Oh F**k" Release - Table column sizes were bad + +* Fixed bug in Table Element's column size computation +* popup_animated has new title parameter +* Checkbox - update can change the text + ### 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/usage.py b/readme_creator/usage.py new file mode 100644 index 00000000..8012b9c9 --- /dev/null +++ b/readme_creator/usage.py @@ -0,0 +1,100 @@ +from make_real_readme import main + +######################################################################## +# __ _ _ # +# / _(_) | | # +# __ __ ___ ___ _ __ | |_ _ __ _ | |__ ___ _ __ ___ # +# \ \ / / / __/ _ \| '_ \| _| |/ _` | | '_ \ / _ \ '__/ _ \ # +# \ V / | (_| (_) | | | | | | | (_| | | | | | __/ | | __/ # +# \_/ \___\___/|_| |_|_| |_|\__, | |_| |_|\___|_| \___| # +# __/ | # +# |___/ # +######################################################################## +OUTPUT_FILENAME = 'readme.md' + +##-#-#-# ##-#-#-# +# Pre-process logic +##-#-#-# ##-#-#-# + +line_break = '
' +# line_break can be: +# - '
' +# - ' \n ' + +method = 'with logs' +# method can be: +# - 'simple, no log' +# - 'with logs' + + +##-#-#-# ##-#-#-# +# Post-process logic +##-#-#-# ##-#-#-# +enable_popup = True +insert_md_section_for__class_methods = False +remove_repeated_sections_classmethods = False + + + +############## +# __ # +# /_ | # +# | | # +# | | # +# | | # +# |_| # +############## +if method == 'simple, no log': + main(logger=None, + insert_md_section_for__class_methods=insert_md_section_for__class_methods, + remove_repeated_sections_classmethods=remove_repeated_sections_classmethods, + files_to_include=[0, 1, 2, 3], + output_name=OUTPUT_FILENAME, + delete_html_comments=True) + +################ +# ___ # +# |__ \ # +# ) | # +# / / # +# / /_ # +# |____| # +################ +if method == 'with logs': + + import logging + logger = logging.getLogger(__name__) + logger.setLevel(logging.DEBUG) + + my_file = logging.FileHandler('usage.log.txt', mode='w') + my_file.setLevel(logging.DEBUG) + formatter = logging.Formatter('%(asctime)s>%(levelname)s: %(message)s') + my_file.setFormatter(formatter) + logger.addHandler(my_file) + logger.info('STARTING') + + main(logger=logger, + insert_md_section_for__class_methods=insert_md_section_for__class_methods, + remove_repeated_sections_classmethods=remove_repeated_sections_classmethods, + files_to_include=[0, 1, 2, 3], + output_name=OUTPUT_FILENAME, + delete_html_comments=True) + +######################################## +# _____ # +# | __ \ # +# | |__) |__ _ __ _ _ _ __ # +# | ___/ _ \| '_ \| | | | '_ \ # +# | | | (_) | |_) | |_| | |_) | # +# |_| \___/| .__/ \__,_| .__/ # +# | | | | # +# |_| |_| # +######################################## +if enable_popup: + import PySimpleGUI as sg + + with open('usage.log.txt', 'r') as ff: + lines = ff.read() + sg.PopupScrolled('Completed making ' + OUTPUT_FILENAME, lines, size=(80,50)) + +