Release 4.22.0

This commit is contained in:
PySimpleGUI 2020-06-28 10:33:02 -04:00
parent 0ae9f88396
commit 6ed8a4d429
4 changed files with 269 additions and 53 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 #!/usr/bin/python3
version = __version__ = "4.21.0.1 Unreleased\n cprint expanded using optional key and optional window" version = __version__ = "4.22.0 Released 28-Jun-2020"
port = 'PySimpleGUI' port = 'PySimpleGUI'
@ -11609,7 +11609,7 @@ class QuickMeter(object):
:param orientation: 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical' / 'v') :param orientation: 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical' / 'v')
:type orientation: (str) :type orientation: (str)
:param bar_color: color of a bar line :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) :param button_color: button color (foreground, background)
:type button_color: Tuple[str, str] :type button_color: Tuple[str, str]
:param size: (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE) :param size: (w,h) w=characters-wide, h=rows-high (Default value = DEFAULT_PROGRESS_BAR_SIZE)
@ -11964,22 +11964,32 @@ def cprint_set_output_destination(window, multiline_key):
def cprint(*args, **kwargs): def cprint(*args, **kwargs):
""" """
Color print to a multiline element in a window of your choice. Color print to a multiline element in a window of your choice.
Must have called cprint_set_output_destination prior ot making this call so that the Must have EITHER called cprint_set_output_destination prior to making this call so that the
window and element key can be saved and used here to route the output window and element key can be saved and used here to route the output, OR used the window
and key parameters to the cprint function to specicy these items.
args is a variable number of things you want to print.
kwargs can be any of these keywords: kwargs can be any of these keywords:
end - The end char to use just like print uses end - The end char to use just like print uses
sep - The separation character like print uses sep - The separation character like print uses
text_color - The color of the text text_color - The color of the text
t - An alias for color of the text (makes for shorter calls) key - overrides the previously defined Multiline key
window - overrides the previously defined window to output to
background_color - The color of the background background_color - The color of the background
colors -(str, str) or str. A combined text/background color definition in a single parameter
There are also "aliases" for text_color, background_color and colors (t, b, c)
t - An alias for color of the text (makes for shorter calls)
b - An alias for the background_color parameter b - An alias for the background_color parameter
c - Tuple[str, str] - "shorthand" way of specifying color. (foreground, backgrouned) c - Tuple[str, str] - "shorthand" way of specifying color. (foreground, backgrouned)
str - can also be a string of the format "foreground on background" ("white on red") str - can also be a string of the format "foreground on background" ("white on red")
With these aliases it's possible to write the same print but in more compact ways:
With the aliases it's possible to write the same print but in more compact ways:
cprint('This will print white text on red background', c=('white', 'red')) cprint('This will print white text on red background', c=('white', 'red'))
cprint('This will print white text on red background', c='white on red') cprint('This will print white text on red background', c='white on red')
cprint('This will print white text on red background', text_color='red', background_color='white') cprint('This will print white text on red background', text_color='white', background_color='red')
cprint('This will print white text on red background', t='red', b='white') cprint('This will print white text on red background', t='white', b='red')
:param *args: stuff to output :param *args: stuff to output
:type *args: (Any) :type *args: (Any)
@ -12001,19 +12011,17 @@ def cprint(*args, **kwargs):
:type sep: (str) :type sep: (str)
:param key: key of multiline to output to (if you want to override the one previously set) :param key: key of multiline to output to (if you want to override the one previously set)
:type key: (Any) :type key: (Any)
:param window: key of multiline to output to (if you want to override the one previously set) :param window: Window containing the multiline to output to (if you want to override the one previously set)
:type window: (Window) :type window: (Window)
""" """
destination_key = CPRINT_DESTINATION_MULTILINE_ELMENT_KEY destination_key = CPRINT_DESTINATION_MULTILINE_ELMENT_KEY
window = CPRINT_DESTINATION_WINDOW window = CPRINT_DESTINATION_WINDOW
if window is None or destination_key is None: if (window is None and 'window' not in kwargs) or (destination_key is None and 'key' not in kwargs):
if 'key' not in kwargs and 'window' not in kwargs: print('** Warning ** Attempting to perform a cprint without a valid window & key',
print('** Warning ** Attempting to perform a cprint without first setting up the output window and element',
'Will instead print on Console', 'Will instead print on Console',
'You can also use the window, key arguments to route the output') 'You can specify window and key in this cprint call, or set ahead of time using cprint_set_output_destination')
print(*args) print(*args)
return return

View File

@ -170,7 +170,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### click ### click
@ -307,6 +307,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -459,7 +465,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -563,6 +569,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### set_vscroll_position ### set_vscroll_position
Attempts to set the vertical scroll postition for an element's Widget Attempts to set the vertical scroll postition for an element's Widget
@ -680,7 +692,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -794,6 +806,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -921,7 +939,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -1035,6 +1053,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -1203,7 +1227,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -1322,6 +1346,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### set_vscroll_position ### set_vscroll_position
Attempts to set the vertical scroll postition for an element's Widget Attempts to set the vertical scroll postition for an element's Widget
@ -1481,7 +1511,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -1596,6 +1626,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -1774,7 +1810,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -1893,6 +1929,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -2369,7 +2411,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### bring_figure_to_front ### bring_figure_to_front
@ -2837,6 +2879,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -2918,7 +2966,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -3022,6 +3070,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -3142,7 +3196,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -3246,6 +3300,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -3442,7 +3502,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -3556,6 +3616,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -3741,7 +3807,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -3904,6 +3970,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -4035,7 +4107,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -4139,6 +4211,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -4298,7 +4376,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -4449,6 +4527,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -4588,7 +4672,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -4706,6 +4790,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -4843,7 +4933,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -4970,6 +5060,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -5085,7 +5181,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -5189,6 +5285,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -5318,7 +5420,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -5422,6 +5524,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -5582,7 +5690,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -5704,6 +5812,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -5844,7 +5958,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -5948,6 +6062,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -6092,7 +6212,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -6208,6 +6328,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -6342,7 +6468,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -6446,6 +6572,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -6843,7 +6975,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -6969,6 +7101,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -7111,7 +7249,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -7257,6 +7395,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -7417,7 +7561,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -7533,6 +7677,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -7685,7 +7835,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -7799,6 +7949,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -7976,7 +8132,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -8094,6 +8250,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -8255,7 +8417,7 @@ Parameter Descriptions:
|Type|Name|Meaning| |Type|Name|Meaning|
|--|--|--| |--|--|--|
| Mike_please_insert_type_here | bind_string | The string tkinter expected in its bind function | | str | bind_string | The string tkinter expected in its bind function |
### expand ### expand
@ -8359,6 +8521,12 @@ Removes a previously bound tkinter event from an Element.
unbind(bind_string) unbind(bind_string)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
### unhide_row ### unhide_row
Unhides (makes visible again) the row container that the Element is located on. Unhides (makes visible again) the row container that the Element is located on.
@ -11754,6 +11922,7 @@ Parameter Descriptions:
| bool | keep_on_top | If True the window will remain above all current windows | | 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 | | Tuple[int, int] | location | Location of upper left corner of the window |
| bool | do_not_reroute_stdout | do not reroute stdout | | bool | do_not_reroute_stdout | do not reroute stdout |
| | **RETURN** |
Close a previously opened EasyPrint window Close a previously opened EasyPrint window
@ -11797,6 +11966,7 @@ Parameter Descriptions:
| bool | keep_on_top | If True the window will remain above all current windows | | 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 | | Tuple[int, int] | location | Location of upper left corner of the window |
| bool | do_not_reroute_stdout | do not reroute stdout | | bool | do_not_reroute_stdout | do not reroute stdout |
| | **RETURN** |
Works like a "print" statement but with windowing options. Routes output to the "Debug Window" Works like a "print" statement but with windowing options. Routes output to the "Debug Window"
@ -11834,6 +12004,7 @@ Parameter Descriptions:
| bool | keep_on_top | If True the window will remain above all current windows | | 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 | | Tuple[int, int] | location | Location of upper left corner of the window |
| bool | do_not_reroute_stdout | do not reroute stdout | | bool | do_not_reroute_stdout | do not reroute stdout |
| | **RETURN** |
Close a previously opened EasyPrint window Close a previously opened EasyPrint window
@ -11877,6 +12048,7 @@ Parameter Descriptions:
| bool | keep_on_top | If True the window will remain above all current windows | | 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 | | Tuple[int, int] | location | Location of upper left corner of the window |
| bool | do_not_reroute_stdout | do not reroute stdout | | bool | do_not_reroute_stdout | do not reroute stdout |
| | **RETURN** |
Close a previously opened EasyPrint window Close a previously opened EasyPrint window
@ -11920,6 +12092,7 @@ Parameter Descriptions:
| bool | keep_on_top | If True the window will remain above all current windows | | 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 | | Tuple[int, int] | location | Location of upper left corner of the window |
| bool | do_not_reroute_stdout | do not reroute stdout | | bool | do_not_reroute_stdout | do not reroute stdout |
| | **RETURN** |
Close a previously opened EasyPrint window Close a previously opened EasyPrint window
@ -11930,22 +12103,32 @@ PrintClose()
## Color Printing to Multiline Element of a Window ## Color Printing to Multiline Element of a Window
Color print to a multiline element in a window of your choice. Color print to a multiline element in a window of your choice.
Must have called cprint_set_output_destination prior ot making this call so that the Must have EITHER called cprint_set_output_destination prior to making this call so that the
window and element key can be saved and used here to route the output window and element key can be saved and used here to route the output, OR used the window
and key parameters to the cprint function to specicy these items.
args is a variable number of things you want to print.
kwargs can be any of these keywords: kwargs can be any of these keywords:
end - The end char to use just like print uses end - The end char to use just like print uses
sep - The separation character like print uses sep - The separation character like print uses
text_color - The color of the text text_color - The color of the text
t - An alias for color of the text (makes for shorter calls) key - overrides the previously defined Multiline key
window - overrides the previously defined window to output to
background_color - The color of the background background_color - The color of the background
colors -(str, str) or str. A combined text/background color definition in a single parameter
There are also "aliases" for text_color, background_color and colors (t, b, c)
t - An alias for color of the text (makes for shorter calls)
b - An alias for the background_color parameter b - An alias for the background_color parameter
c - Tuple[str, str] - "shorthand" way of specifying color. (foreground, backgrouned) c - Tuple[str, str] - "shorthand" way of specifying color. (foreground, backgrouned)
str - can also be a string of the format "foreground on background" ("white on red") str - can also be a string of the format "foreground on background" ("white on red")
With these aliases it's possible to write the same print but in more compact ways:
With the aliases it's possible to write the same print but in more compact ways:
cprint('This will print white text on red background', c=('white', 'red')) cprint('This will print white text on red background', c=('white', 'red'))
cprint('This will print white text on red background', c='white on red') cprint('This will print white text on red background', c='white on red')
cprint('This will print white text on red background', text_color='red', background_color='white') cprint('This will print white text on red background', text_color='white', background_color='red')
cprint('This will print white text on red background', t='red', b='white') cprint('This will print white text on red background', t='white', b='red')
``` ```
cprint(args=*<1 or N object>, kwargs) cprint(args=*<1 or N object>, kwargs)
@ -11958,13 +12141,14 @@ Parameter Descriptions:
| Any | *args | stuff to output | | Any | *args | stuff to output |
| str | text_color | Color of the text | | str | text_color | Color of the text |
| str | background_color | The background color of the line | | str | background_color | The background color of the line |
| str) or Tuple[str, str] | colors | Either a tuple or a string that has both the text and background colors |
| str | t | Color of the text | | str | t | Color of the text |
| str | b | The background color of the line | | str | b | The background color of the line |
| str | b | The background color of the line |
| str) or Tuple[str, str] | c | Either a tuple or a string that has both the text and background colors | | str) or Tuple[str, str] | c | Either a tuple or a string that has both the text and background colors |
| str | end | end character | | str | end | end character |
| str | sep | separator character | | str | sep | separator character |
| | **RETURN** | | Any | key | key of multiline to output to (if you want to override the one previously set) |
| Window | window | Window containing the multiline to output to (if you want to override the one previously set) |
Sets up the color print (cprint) output destination Sets up the color print (cprint) output destination
@ -14327,6 +14511,12 @@ Shows the large main debugger window
show_debugger_window(location=(None, None), args=*<1 or N object>) show_debugger_window(location=(None, None), args=*<1 or N object>)
``` ```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| Tuple[int, int] | location | Locations (x,y) on the screen to place upper left corner of the window |
## Themes ## Themes
Sets / Gets the current Theme. If none is specified then returns the current theme. Sets / Gets the current Theme. If none is specified then returns the current theme.

View File

@ -7264,6 +7264,15 @@ Horizontal Separator, cprint, docstrings
* Added default_path to popup_get_file when there is no window * Added default_path to popup_get_file when there is no window
* Fix for removing too many PySimpleGUI installs when using the GitHub upgrade tooltip * Fix for removing too many PySimpleGUI installs when using the GitHub upgrade tooltip
## 4.22.0 PySimpleGUI 28-Jun-2020
More cprint stuff
* Additional window and key parameter to cprint
* May seem like a small change, but the results are powerful
* Can now easily "print" to anywhere, in color!
### Upcoming ### 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 current ports that are underway. 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 current ports that are underway.

View File

@ -7264,6 +7264,15 @@ Horizontal Separator, cprint, docstrings
* Added default_path to popup_get_file when there is no window * Added default_path to popup_get_file when there is no window
* Fix for removing too many PySimpleGUI installs when using the GitHub upgrade tooltip * Fix for removing too many PySimpleGUI installs when using the GitHub upgrade tooltip
## 4.22.0 PySimpleGUI 28-Jun-2020
More cprint stuff
* Additional window and key parameter to cprint
* May seem like a small change, but the results are powerful
* Can now easily "print" to anywhere, in color!
### Upcoming ### 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 current ports that are underway. 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 current ports that are underway.