Compare commits
251 commits
revert-614
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
a0d3e7ce1f | ||
|
aae672824c | ||
|
117f40917d | ||
|
bf4630ec65 | ||
|
2bda3e1950 | ||
|
a2cd9fb702 | ||
|
634eb9c652 | ||
|
05939b2725 | ||
|
3f96ecf9ae | ||
|
148f548565 | ||
|
e949083fda | ||
|
93358382b4 | ||
|
e59310d5fc | ||
|
2b8941fad9 | ||
|
cb39c58f98 | ||
|
51f43ce318 | ||
|
85f3f472f7 | ||
|
e1f2d7f2d8 | ||
|
bed18263e6 | ||
|
104cd14f35 | ||
|
1ee5a7f9d2 | ||
|
6699f514a0 | ||
|
0f16031512 | ||
|
cb324f35fc | ||
|
f78e4913a2 | ||
|
9b63e2e661 | ||
|
29127a73ee | ||
|
746b79d61a | ||
|
5131c537f5 | ||
|
79e9b6198e | ||
|
fe31a0a7ed | ||
|
57b72ba938 | ||
|
7f485c5f78 | ||
|
03ed1948e2 | ||
|
3776730709 | ||
|
77ba1eb26f | ||
|
ddebd7a5c6 | ||
|
5f8735d1f3 | ||
|
41e137e797 | ||
|
2470d10afc | ||
|
dee0c81b58 | ||
|
4504ea77c3 | ||
|
ce32fe3814 | ||
|
48c7b673c1 | ||
|
ed128a36f5 | ||
|
ee972660c0 | ||
|
3907e7636e | ||
|
9cf9258835 | ||
|
0459adac69 | ||
|
cf3345303d | ||
|
5761be84d8 | ||
|
0b6eb6d5b3 | ||
|
4a5e2316e0 | ||
|
77ea65b8de | ||
|
0f32107272 | ||
|
393050c1ae | ||
|
31e8c51fba | ||
|
2ece7d4ad5 | ||
|
c34d28bcd4 | ||
|
1d3126f884 | ||
|
81638809c8 | ||
|
c51d670956 | ||
|
db4fe52ec8 | ||
|
f292d757de | ||
|
a39e180d13 | ||
|
854bdccdd3 | ||
|
73a1b085ee | ||
|
5035d24f2c | ||
|
3c3312f5a2 | ||
|
aaf391508c | ||
|
76e4071239 | ||
|
2ce3c7f75e | ||
|
415f55c3a7 | ||
|
3de64e7d99 | ||
|
e41be1c157 | ||
|
d97777b262 | ||
|
884d49a14f | ||
|
05d22968ae | ||
|
891b0a5b36 | ||
|
0fd1e011a1 | ||
|
130d5492f0 | ||
|
c11e950415 | ||
|
549330d0aa | ||
|
654c2d2930 | ||
|
8004b258a9 | ||
|
7f22061c3f | ||
|
4a883851e6 | ||
|
d3372dda27 | ||
|
0ff0efa3c6 | ||
|
8b16f3183c | ||
|
eeb95398e0 | ||
|
b62648aa23 | ||
|
79a3b85e73 | ||
|
e5d0c3d471 | ||
|
935285f715 | ||
|
955a7cba07 | ||
|
e7b380ee7e | ||
|
ca66e38c99 | ||
|
d368af0547 | ||
|
3952e1a438 | ||
|
440a34888f | ||
|
003a03dfeb | ||
|
f3a7e10ce0 | ||
|
db1f02af2f | ||
|
fe41f3cd1f | ||
|
d7c24da2bf | ||
|
2e6b74f0f1 | ||
|
74098a440b | ||
|
43c49380a2 | ||
|
def60b9ba8 | ||
|
7cf4c102fe | ||
|
ee794099bf | ||
|
cb0da5887d | ||
|
fe7fbcbc44 | ||
|
fb5fdbdd5c | ||
|
041c5ba4e6 | ||
|
71c50d40b4 | ||
|
5efbff1cb8 | ||
|
a78498fcca | ||
|
f06fcdc0a6 | ||
|
982cb755ba | ||
|
8b4e19a0cd | ||
|
8729971855 | ||
|
cdba184ed8 | ||
|
ad3465d9ba | ||
|
0bcd49a1b7 | ||
|
f1cd369302 | ||
|
ad76b5deeb | ||
|
635baca3cd | ||
|
74c1f7b337 | ||
|
5052aece6a | ||
|
4fe61e42d2 | ||
|
5b784253f5 | ||
|
15e56bd47d | ||
|
f97de3468b | ||
|
e902230468 | ||
|
d8d5227240 | ||
|
2eed0afaeb | ||
|
a10d9d3430 | ||
|
07f772c680 | ||
|
fcd03f4b6f | ||
|
a22884e2e3 | ||
|
d72a7672c1 | ||
|
3507b2708b | ||
|
cd7967fe4a | ||
|
4d02f3a515 | ||
|
3e0ade9797 | ||
|
3b7a17f6b6 | ||
|
27e073b03c | ||
|
d447633ec3 | ||
|
15af7b7d06 | ||
|
c24d8b6b87 | ||
|
f0eab8c1bd | ||
|
8bd030f1a1 | ||
|
34b935a196 | ||
|
efa236369f | ||
|
af9794b2c2 | ||
|
8e6fa8100a | ||
|
4a5f2d2907 | ||
|
8f74aa5c8d | ||
|
ba0e5fed78 | ||
|
3275279f9c | ||
|
0cf29cc20f | ||
|
fdbdd18120 | ||
|
73c692ebcc | ||
|
5ae9d3c88a | ||
|
ad67fe233e | ||
|
83bdad20f8 | ||
|
1ae844e7fc | ||
|
2de8770897 | ||
|
2cc5b70aed | ||
|
2a4831ac63 | ||
|
86afe5ae57 | ||
|
6b9cb23b6d | ||
|
c4e37eff04 | ||
|
62eb1f5781 | ||
|
98f383bffb | ||
|
25ed11c581 | ||
|
57528fdb5c | ||
|
6aabac7637 | ||
|
c8da36c9e3 | ||
|
3a7d72354a | ||
|
f07d658e87 | ||
|
c88bd1f2ec | ||
|
a3936a60a9 | ||
|
83745112a6 | ||
|
c963e86d3e | ||
|
8f76e053f0 | ||
|
282559db46 | ||
|
185d0997bb | ||
|
a138621f9a | ||
|
e34564fb38 | ||
|
a059d92c8e | ||
|
e3211b18ab | ||
|
dc84814eb2 | ||
|
199901cc4c | ||
|
800decc53f | ||
|
e047ffe684 | ||
|
83bb20ff3d | ||
|
517262690f | ||
|
d84cd10c04 | ||
|
f3270e00ec | ||
|
336d3baeb9 | ||
|
7da029ebf8 | ||
|
85e11e88b7 | ||
|
078fc3b1d4 | ||
|
71d1c850f8 | ||
|
e764cc07b8 | ||
|
2af2d59c4d | ||
|
16aea9c37f | ||
|
5b0f6950a3 | ||
|
81abea7164 | ||
|
de383504e0 | ||
|
2d9a91911b | ||
|
cef6e8e0cd | ||
|
58e2e936a3 | ||
|
de3beca51a | ||
|
84024bc302 | ||
|
2492b2353d | ||
|
6762f9c395 | ||
|
7e88e04cee | ||
|
0e9442353c | ||
|
59cbf63116 | ||
|
ed8d867e76 | ||
|
4ca5cf084a | ||
|
edbc55262b | ||
|
805727fed9 | ||
|
8effae33f4 | ||
|
6a64f8cfd2 | ||
|
6b20da8c59 | ||
|
529c285489 | ||
|
ad78b3b1ac | ||
|
81c16c6b5f | ||
|
d03347d39c | ||
|
b216a25480 | ||
|
81127fae93 | ||
|
d0c558f5c8 | ||
|
73fa593c25 | ||
|
d9e42ed2e7 | ||
|
ca0e825e88 | ||
|
2821880b3c | ||
|
3ca7703fcd | ||
|
c8d01725f1 | ||
|
7fdee8f91b | ||
|
268686635f | ||
|
0c77b57659 | ||
|
a309549dbb | ||
|
54d6d68a03 | ||
|
54d8f698d7 | ||
|
02f3ae25be | ||
|
c3a6db921f |
44 changed files with 3566 additions and 1035 deletions
|
@ -61,6 +61,7 @@ These items may solve your problem. Please check those you've done by changing -
|
|||
|
||||
- [ ] Searched main docs for your problem www.PySimpleGUI.org
|
||||
- [ ] Looked for Demo Programs that are similar to your goal. It is recommend you use the Demo Browser! Demos.PySimpleGUI.org
|
||||
- [ ] None of your GUI code was generated by an AI algorithm like GPT
|
||||
- [ ] If not tkinter - looked for Demo Programs for specific port
|
||||
- [ ] For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
|
||||
- [ ] Run your program outside of your debugger (from a command line)
|
||||
|
|
|
@ -5,7 +5,7 @@ import warnings
|
|||
|
||||
import PySimpleGUI as sg
|
||||
|
||||
__version__ = '1.12.0'
|
||||
__version__ = '1.12.2'
|
||||
|
||||
"""
|
||||
PySimpleGUI Demo Program Browser
|
||||
|
@ -36,7 +36,7 @@ __version__ = '1.12.0'
|
|||
Versions:
|
||||
1.8.0 - Addition of option to show ALL file types, not just Python files
|
||||
1.12.0 - Fix for problem with spaces in filename and using an editor specified in the demo program settings
|
||||
|
||||
1.12.2 - Better error handling for no editor configured
|
||||
Copyright 2021, 2022 PySimpleGUI.org
|
||||
"""
|
||||
|
||||
|
@ -577,7 +577,9 @@ def main():
|
|||
sg.cprint(f'Editing using {editor_program}', c='white on red', end='')
|
||||
sg.cprint('')
|
||||
sg.cprint(f'{full_filename}', c='white on purple')
|
||||
# if line != 1:
|
||||
if not get_editor():
|
||||
sg.popup_error_with_traceback('No editor has been configured', 'You need to configure an editor in order to use this feature', 'You can configure the editor in the Demo Brower Settings or the PySimpleGUI Global Settings')
|
||||
else:
|
||||
if using_local_editor():
|
||||
sg.execute_command_subprocess(editor_program, f'"{full_filename}"')
|
||||
else:
|
||||
|
@ -585,8 +587,6 @@ def main():
|
|||
sg.execute_editor(full_filename, line_number=int(line))
|
||||
except:
|
||||
sg.execute_command_subprocess(editor_program, f'"{full_filename}"')
|
||||
# else:
|
||||
# sg.execute_editor(full_filename)
|
||||
else:
|
||||
sg.cprint('Editing canceled')
|
||||
elif event == 'Run':
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
Displays the values dictionary entry for each element
|
||||
And more!
|
||||
|
||||
Copyright 2021, 2022 PySimpleGUI
|
||||
Copyright 2021, 2022, 2023 PySimpleGUI
|
||||
"""
|
||||
|
||||
import PySimpleGUI as sg
|
||||
|
@ -99,7 +99,6 @@ def main():
|
|||
while True:
|
||||
event, values = window.read(timeout=100)
|
||||
# keep an animation running so show things are happening
|
||||
window['-GIF-IMAGE-'].update_animation(sg.DEFAULT_BASE64_LOADING_GIF, time_between_frames=100)
|
||||
if event not in (sg.TIMEOUT_EVENT, sg.WIN_CLOSED):
|
||||
print('============ Event = ', event, ' ==============')
|
||||
print('-------- Values Dictionary (key=value) --------')
|
||||
|
@ -108,7 +107,9 @@ def main():
|
|||
if event in (None, 'Exit'):
|
||||
print("[LOG] Clicked Exit!")
|
||||
break
|
||||
elif event == 'About':
|
||||
|
||||
window['-GIF-IMAGE-'].update_animation(sg.DEFAULT_BASE64_LOADING_GIF, time_between_frames=100)
|
||||
if event == 'About':
|
||||
print("[LOG] Clicked About!")
|
||||
sg.popup('PySimpleGUI Demo All Elements',
|
||||
'Right click anywhere to see right click menu',
|
||||
|
|
|
@ -26,7 +26,7 @@ def resize_base64_image(image64, size):
|
|||
'''
|
||||
image_file = io.BytesIO(base64.b64decode(image64))
|
||||
img = Image.open(image_file)
|
||||
img.thumbnail(size, Image.ANTIALIAS)
|
||||
img.thumbnail(size, Image.LANCZOS)
|
||||
bio = io.BytesIO()
|
||||
img.save(bio, format='PNG')
|
||||
imgbytes = bio.getvalue()
|
||||
|
|
|
@ -4,24 +4,27 @@ import PySimpleGUI as sg
|
|||
'''
|
||||
A simple send/response chat window. Add call to your send-routine and print the response
|
||||
If async responses can come in, then will need to use a different design that uses PySimpleGUI async design pattern
|
||||
|
||||
Copyright 2023 PySimpleGUI
|
||||
|
||||
'''
|
||||
|
||||
sg.theme('GreenTan') # give our window a spiffy set of colors
|
||||
|
||||
layout = [[sg.Text('Your output will go here', size=(40, 1))],
|
||||
[sg.Output(size=(110, 20), font=('Helvetica 10'))],
|
||||
[sg.Multiline(size=(70, 5), enter_submits=False, key='-QUERY-', do_not_clear=False),
|
||||
[sg.Multiline(size=(70, 5), enter_submits=True, key='-QUERY-', do_not_clear=False),
|
||||
sg.Button('SEND', button_color=(sg.YELLOWS[0], sg.BLUES[0]), bind_return_key=True),
|
||||
sg.Button('EXIT', button_color=(sg.YELLOWS[0], sg.GREENS[0]))]]
|
||||
|
||||
window = sg.Window('Chat window', layout, font=('Helvetica', ' 13'), default_button_element_size=(8,2), use_default_focus=False)
|
||||
|
||||
while True: # The Event Loop
|
||||
event, value = window.read()
|
||||
event, values = window.read()
|
||||
if event in (sg.WIN_CLOSED, 'EXIT'): # quit if exit button or X
|
||||
break
|
||||
if event == 'SEND':
|
||||
query = value['-QUERY-'].rstrip()
|
||||
query = values['-QUERY-'].rstrip()
|
||||
# EXECUTE YOUR COMMAND HERE
|
||||
print('The command you entered was {}'.format(query), flush=True)
|
||||
|
||||
|
|
|
@ -5,9 +5,37 @@ import PySimpleGUI as sg
|
|||
|
||||
Using a class to encapsulate PySimpleGUI Window creation & event loop
|
||||
|
||||
Copyright 2022 PySimpleGUI
|
||||
This is NOT a recommended design pattern. It mimics the object oriented design that many OO-based
|
||||
GUI frameworks use, but there is no advantage to structuring you code in his manner. It adds
|
||||
confusion, not clarity.
|
||||
|
||||
The class version is 18 lines of code. The plain version is 13 lines of code.
|
||||
|
||||
Two things about the class wrapper jump out as adding confusion:
|
||||
1. Unneccessary fragmentation of the event loop - the button click code is pulled out of the loop entirely
|
||||
2. "self" clutters the code without adding value
|
||||
|
||||
|
||||
Copyright 2022, 2023 PySimpleGUI
|
||||
"""
|
||||
|
||||
'''
|
||||
MM'""""'YMM dP
|
||||
M' .mmm. `M 88
|
||||
M MMMMMooM 88 .d8888b. .d8888b. .d8888b.
|
||||
M MMMMMMMM 88 88' `88 Y8ooooo. Y8ooooo.
|
||||
M. `MMM' .M 88 88. .88 88 88
|
||||
MM. .dM dP `88888P8 `88888P' `88888P'
|
||||
MMMMMMMMMMM
|
||||
|
||||
M""MMMMM""M oo
|
||||
M MMMMM M
|
||||
M MMMMP M .d8888b. 88d888b. .d8888b. dP .d8888b. 88d888b.
|
||||
M MMMM' .M 88ooood8 88' `88 Y8ooooo. 88 88' `88 88' `88
|
||||
M MMP' .MM 88. ... 88 88 88 88. .88 88 88
|
||||
M .dMMM `88888P' dP `88888P' dP `88888P' dP dP
|
||||
MMMMMMMMMMM
|
||||
'''
|
||||
class SampleGUI():
|
||||
|
||||
def __init__(self):
|
||||
|
@ -35,3 +63,41 @@ class SampleGUI():
|
|||
my_gui = SampleGUI()
|
||||
# run the event loop
|
||||
my_gui.run()
|
||||
|
||||
|
||||
'''
|
||||
M"""""""`YM dP
|
||||
M mmmm. M 88
|
||||
M MMMMM M .d8888b. 88d888b. 88d8b.d8b. .d8888b. 88
|
||||
M MMMMM M 88' `88 88' `88 88'`88'`88 88' `88 88
|
||||
M MMMMM M 88. .88 88 88 88 88 88. .88 88
|
||||
M MMMMM M `88888P' dP dP dP dP `88888P8 dP
|
||||
MMMMMMMMMMM
|
||||
|
||||
M""MMMMM""M oo
|
||||
M MMMMM M
|
||||
M MMMMP M .d8888b. 88d888b. .d8888b. dP .d8888b. 88d888b.
|
||||
M MMMM' .M 88ooood8 88' `88 Y8ooooo. 88 88' `88 88' `88
|
||||
M MMP' .MM 88. ... 88 88 88 88. .88 88 88
|
||||
M .dMMM `88888P' dP `88888P' dP `88888P' dP dP
|
||||
MMMMMMMMMMM
|
||||
'''
|
||||
|
||||
def gui_function():
|
||||
layout = [ [sg.Text('My layout')],
|
||||
[sg.Input(key='-IN-')],
|
||||
[sg.Button('Go'), sg.Button('Exit')] ]
|
||||
|
||||
window = sg.Window('My new window', layout)
|
||||
|
||||
while True: # Event Loop
|
||||
event, values = window.read()
|
||||
if event in (sg.WIN_CLOSED, 'Exit'):
|
||||
break
|
||||
|
||||
if event == 'Go':
|
||||
sg.popup('Go button clicked', 'Input value:', values['-IN-'])
|
||||
|
||||
window.close()
|
||||
|
||||
gui_function()
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
import PySimpleGUI as sg
|
||||
import datetime
|
||||
import PIL.Image, PIL.ImageTk
|
||||
import PIL
|
||||
from PIL import Image
|
||||
import random
|
||||
import os
|
||||
import io
|
||||
import base64
|
||||
|
||||
|
||||
"""
|
||||
Another simple Desktop Widget using PySimpleGUI
|
||||
|
@ -16,17 +20,76 @@ import os
|
|||
* How long to show the image and if you wnt this time to vary semi-randomly
|
||||
* Folder containing your images
|
||||
|
||||
Copyright 2021 PySimpleGUI
|
||||
Copyright 2021, 2023 PySimpleGUI
|
||||
"""
|
||||
|
||||
ALPHA = 0.9 # Initial alpha until user changes
|
||||
refresh_font = sg.user_settings_get_entry('-refresh font-', 'Courier 8')
|
||||
|
||||
def convert_to_bytes(file_or_bytes, resize=None):
|
||||
image = PIL.Image.open(file_or_bytes)
|
||||
image.thumbnail(resize)
|
||||
photo_img = PIL.ImageTk.PhotoImage(image)
|
||||
return photo_img
|
||||
|
||||
def make_square(im, fill_color=(0, 0, 0, 0)):
|
||||
x, y = im.size
|
||||
size = max(x, y)
|
||||
new_im = Image.new('RGBA', (size, size), fill_color)
|
||||
new_im.paste(im, (int((size - x) / 2), int((size - y) / 2)))
|
||||
return new_im
|
||||
|
||||
def get_image_size(source):
|
||||
if isinstance(source, str):
|
||||
image = PIL.Image.open(source)
|
||||
elif isinstance(source, bytes):
|
||||
image = PIL.Image.open(io.BytesIO(base64.b64decode(source)))
|
||||
else:
|
||||
image = PIL.Image.open(io.BytesIO(source))
|
||||
|
||||
width, height = image.size
|
||||
return (width, height)
|
||||
|
||||
def convert_to_bytes(source, size=(None, None), subsample=None, zoom=None, fill=False):
|
||||
"""
|
||||
Will convert into bytes and optionally resize an image that is a file or a base64 bytes object.
|
||||
Turns into PNG format in the process so that can be displayed by tkinter
|
||||
:param source: either a string filename or a bytes base64 image object
|
||||
:type source: (Union[str, bytes])
|
||||
:param size: optional new size (width, height)
|
||||
:type size: (Tuple[int, int] or None)
|
||||
:param subsample: change the size by multiplying width and height by 1/subsample
|
||||
:type subsample: (int)
|
||||
:param zoom: change the size by multiplying width and height by zoom
|
||||
:type zoom: (int)
|
||||
:param fill: If True then the image is filled/padded so that the image is square
|
||||
:type fill: (bool)
|
||||
:return: (bytes) a byte-string object
|
||||
:rtype: (bytes)
|
||||
"""
|
||||
# print(f'converting {source} {size}')
|
||||
if isinstance(source, str):
|
||||
image = PIL.Image.open(source)
|
||||
elif isinstance(source, bytes):
|
||||
image = PIL.Image.open(io.BytesIO(base64.b64decode(source)))
|
||||
else:
|
||||
image = PIL.Image.open(io.BytesIO(source))
|
||||
|
||||
width, height = image.size
|
||||
|
||||
scale = None
|
||||
if size != (None, None):
|
||||
new_width, new_height = size
|
||||
scale = min(new_height/height, new_width/width)
|
||||
elif subsample is not None:
|
||||
scale = 1/subsample
|
||||
elif zoom is not None:
|
||||
scale = zoom
|
||||
|
||||
resized_image = image.resize((int(width * scale), int(height * scale)), Image.LANCZOS) if scale is not None else image
|
||||
if fill and scale is not None:
|
||||
resized_image = make_square(resized_image)
|
||||
# encode a PNG formatted version of image into BASE64
|
||||
with io.BytesIO() as bio:
|
||||
resized_image.save(bio, format="PNG")
|
||||
contents = bio.getvalue()
|
||||
encoded = base64.b64encode(contents)
|
||||
return encoded
|
||||
|
||||
|
||||
def choose_theme(location):
|
||||
|
@ -43,6 +106,15 @@ def choose_theme(location):
|
|||
else:
|
||||
return None
|
||||
|
||||
def reset_settings():
|
||||
sg.user_settings_set_entry('-time per image-', 60)
|
||||
sg.user_settings_set_entry('-random time-', False)
|
||||
sg.user_settings_set_entry('-image size-', (None, None))
|
||||
sg.user_settings_set_entry('-image_folder-', None)
|
||||
sg.user_settings_set_entry('-location-', (None, None))
|
||||
sg.user_settings_set_entry('-single image-', None)
|
||||
sg.user_settings_set_entry('-alpha-', ALPHA)
|
||||
|
||||
|
||||
def make_window(location):
|
||||
alpha = sg.user_settings_get_entry('-alpha-', ALPHA)
|
||||
|
@ -61,7 +133,7 @@ def make_window(location):
|
|||
layout = [[sg.Image(k='-IMAGE-', enable_events=True)],
|
||||
[sg.pin(sg.Column(refresh_info, key='-REFRESH INFO-', element_justification='c', visible=sg.user_settings_get_entry('-show refresh-', True)))]]
|
||||
|
||||
window = sg.Window('Photo Frame', layout, location=location, no_titlebar=True, grab_anywhere=True, margins=(0, 0), element_justification='c', element_padding=(0, 0), alpha_channel=alpha, finalize=True, right_click_menu=right_click_menu, keep_on_top=True, enable_close_attempted_event=True)
|
||||
window = sg.Window('Photo Frame', layout, location=location, no_titlebar=True, grab_anywhere=True, margins=(0, 0), element_justification='c', element_padding=(0, 0), alpha_channel=alpha, finalize=True, right_click_menu=right_click_menu, keep_on_top=True, enable_close_attempted_event=True, enable_window_config_events=True)
|
||||
|
||||
return window
|
||||
|
||||
|
@ -69,11 +141,10 @@ def make_window(location):
|
|||
def main():
|
||||
loc = sg.user_settings_get_entry('-location-', (None, None))
|
||||
sg.theme(sg.user_settings_get_entry('-theme-', None))
|
||||
window = make_window(loc)
|
||||
|
||||
time_per_image = sg.user_settings_get_entry('-time per image-', 60)
|
||||
vary_randomly = sg.user_settings_get_entry('-random time-', False)
|
||||
width, height = sg.user_settings_get_entry('-image size-', (400,300))
|
||||
width, height = sg.user_settings_get_entry('-image size-', (None, None))
|
||||
image_folder = sg.user_settings_get_entry('-image_folder-', None)
|
||||
|
||||
try:
|
||||
|
@ -82,36 +153,26 @@ def main():
|
|||
image_folder = None
|
||||
sg.user_settings_set_entry('-image_folder-', None)
|
||||
|
||||
single_image = sg.user_settings_get_entry('-single image-', None)
|
||||
image_name = single_image = sg.user_settings_get_entry('-single image-', None)
|
||||
|
||||
if image_folder is None and single_image is None:
|
||||
while True:
|
||||
images = None
|
||||
image_folder = sg.popup_get_folder('Choose location of your images', location=window.current_location(), keep_on_top=True)
|
||||
if image_folder is not None:
|
||||
sg.user_settings_set_entry('-image_folder-', image_folder)
|
||||
break
|
||||
else:
|
||||
image_name = single_image = sg.popup_get_file('Choose a starting image', keep_on_top=True)
|
||||
if not single_image:
|
||||
if sg.popup_yes_no('No folder entered','Go you want to exit the program entirely?', keep_on_top=True) == 'Yes':
|
||||
exit()
|
||||
elif single_image is None:
|
||||
if image_folder is not None and single_image is None:
|
||||
images = os.listdir(image_folder)
|
||||
images = [i for i in images if i.lower().endswith(('.png', '.jpg', '.gif'))]
|
||||
image_name = os.path.join(image_folder, random.choice(images))
|
||||
else: # means single image is not none
|
||||
images = None
|
||||
while True: # Event Loop
|
||||
# First update the status information
|
||||
# for debugging show the last update date time
|
||||
if single_image is None:
|
||||
image_name =random.choice(images)
|
||||
image_data = convert_to_bytes(os.path.join(image_folder, image_name), (width, height))
|
||||
window['-FOLDER-'].update(image_folder)
|
||||
else:
|
||||
image_name = single_image
|
||||
image_data = convert_to_bytes(single_image, (width, height))
|
||||
window['-FILENAME-'].update(image_name)
|
||||
window['-IMAGE-'].update(data=image_data)
|
||||
window['-REFRESHED-'].update(datetime.datetime.now().strftime("%m/%d/%Y %I:%M:%S %p"))
|
||||
window = make_window(loc)
|
||||
|
||||
window_size = window.size
|
||||
image_data = convert_to_bytes(image_name, (width, height))
|
||||
|
||||
while True: # Event Loop
|
||||
# -------------- Start of normal event loop --------------
|
||||
timeout = time_per_image * 1000 + (random.randint(int(-time_per_image * 500), int(time_per_image * 500)) if vary_randomly else 0) if single_image is None else None
|
||||
event, values = window.read(timeout=timeout)
|
||||
|
@ -120,6 +181,28 @@ def main():
|
|||
elif event in (sg.WIN_CLOSE_ATTEMPTED_EVENT, 'Exit'):
|
||||
sg.user_settings_set_entry('-location-', window.current_location()) # The line of code to save the position before exiting
|
||||
break
|
||||
# First update the status information
|
||||
# for debugging show the last update date time
|
||||
if event == sg.TIMEOUT_EVENT:
|
||||
if single_image is None:
|
||||
image_name =random.choice(images)
|
||||
image_data = convert_to_bytes(os.path.join(image_folder, image_name))
|
||||
window['-FOLDER-'].update(image_folder)
|
||||
else:
|
||||
image_name = single_image
|
||||
image_data = convert_to_bytes(single_image, (width, height))
|
||||
window['-FILENAME-'].update(image_name)
|
||||
window['-IMAGE-'].update(data=image_data)
|
||||
window['-REFRESHED-'].update(datetime.datetime.now().strftime("%m/%d/%Y %I:%M:%S %p"))
|
||||
if event == sg.WINDOW_CONFIG_EVENT:
|
||||
new_size = window.size
|
||||
if new_size != window_size:
|
||||
print(f'resizing {new_size}')
|
||||
(width, height) = new_size
|
||||
image_data = convert_to_bytes(image_data, (width, height))
|
||||
window['-IMAGE-'].update(data=image_data)
|
||||
window.size = get_image_size(image_data)
|
||||
window_size = window.size
|
||||
if event == 'Edit Me':
|
||||
sg.execute_editor(__file__)
|
||||
elif event == 'Choose Image Folder':
|
||||
|
@ -175,12 +258,15 @@ def main():
|
|||
window.close()
|
||||
window = make_window(loc)
|
||||
elif event == 'Choose Single Image':
|
||||
single_image = sg.popup_get_file('Choose single image to show', history=True)
|
||||
image_name = single_image = sg.popup_get_file('Choose single image to show', history=True)
|
||||
sg.user_settings_set_entry('-single image-', single_image)
|
||||
|
||||
|
||||
|
||||
(width, height) = get_image_size(single_image)
|
||||
sg.user_settings_set_entry('-image size-', (width, height))
|
||||
image_data = convert_to_bytes(image_name, (width, height))
|
||||
window['-IMAGE-'].update(data=image_data)
|
||||
window.size = window_size = (width, height)
|
||||
window.close()
|
||||
|
||||
if __name__ == '__main__':
|
||||
# reset_settings() # if get corrupted problems, uncomment this
|
||||
main()
|
|
@ -12,6 +12,7 @@
|
|||
* If-Else
|
||||
* Dictionaries
|
||||
* Functions as keys
|
||||
* Lambda as key (callable like functions are)
|
||||
|
||||
The handlers in this demo are all functions that are called once the event is detected
|
||||
|
||||
|
@ -22,7 +23,7 @@
|
|||
event loop rather than functions, then do it in the event loop.
|
||||
|
||||
http://www.PySimpleGUI.org
|
||||
Copyright 2021 PySimpleGUI
|
||||
Copyright 2021, 2022, 2023 PySimpleGUI
|
||||
"""
|
||||
|
||||
import PySimpleGUI as sg
|
||||
|
@ -76,7 +77,7 @@ def main():
|
|||
[sg.Text('Status:'), sg.Text(size=(3, 1), key='-STATUS-')],
|
||||
[sg.Text(size=(50, 1), key='-OUT-')],
|
||||
[sg.Button('Simple'), sg.Button('Go'), sg.Button('Stop'), sg.Button('Other', key=do_other),
|
||||
sg.Button('Tuple', key=(1,2)), sg.Button('Bad')]]
|
||||
sg.Button('Tuple', key=(1,2)), sg.Button('Lambda', key= lambda window: do_other(window)), sg.Button('Bad')]]
|
||||
|
||||
window = sg.Window('Dispatchers', layout, font='Default 16', keep_on_top=True)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import PySimpleGUI as sg
|
||||
|
||||
"""
|
||||
Demo "Edit Me"
|
||||
Demo "Edit Me" (and Version)
|
||||
|
||||
More and more of these Demos are getting an "Edit me" option added.
|
||||
|
||||
|
@ -12,20 +12,18 @@ import PySimpleGUI as sg
|
|||
You can add this capability to your program by adding a right click menu to your window and calling the
|
||||
editor that you set up in the global PySimpleGUI options.
|
||||
|
||||
You need to do 2 things to make this work:
|
||||
1. Add a right click menu - requires you to add 1 parameter to your Window creation
|
||||
2. Add 1 if statement to your event loop.
|
||||
A constant MENU_RIGHT_CLICK_EDITME_VER_EXIT, when set at the right click menu shows a "Version" and "Edit Me" meny item.
|
||||
|
||||
You will need to have first set up your editor by using the menu in sg.main()
|
||||
|
||||
Copyright 2021 PySimpleGUI.org
|
||||
Copyright 2021, 2022, 2023 PySimpleGUI.org
|
||||
"""
|
||||
|
||||
|
||||
layout = [[sg.Text('Edit this program by right clicking and choosing "Edit me"')],
|
||||
[sg.Button('Exit')]]
|
||||
|
||||
window = sg.Window('Edit Me Right Click Menu Demo', layout, right_click_menu=[[''], ['Edit Me', 'Exit',]])
|
||||
window = sg.Window('Edit Me Right Click Menu Demo', layout, right_click_menu=sg.MENU_RIGHT_CLICK_EDITME_VER_EXIT)
|
||||
|
||||
while True: # Event Loop
|
||||
event, values = window.read()
|
||||
|
@ -33,5 +31,7 @@ while True: # Event Loop
|
|||
break
|
||||
if event == 'Edit Me':
|
||||
sg.execute_editor(__file__)
|
||||
elif event == 'Version':
|
||||
sg.popup_scrolled(__file__, sg.get_versions(), location=window.current_location(), keep_on_top=True, non_blocking=True)
|
||||
|
||||
window.close()
|
||||
|
|
|
@ -92,7 +92,7 @@ def convert_to_bytes(file_or_bytes, resize=None, fill=False):
|
|||
if resize:
|
||||
new_width, new_height = resize
|
||||
scale = min(new_height / cur_height, new_width / cur_width)
|
||||
img = img.resize((int(cur_width * scale), int(cur_height * scale)), PIL.Image.ANTIALIAS)
|
||||
img = img.resize((int(cur_width * scale), int(cur_height * scale)), PIL.Image.LANCZOS)
|
||||
if fill:
|
||||
if resize is not None:
|
||||
img = make_square(img, resize[0])
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import PySimpleGUI as sg
|
||||
from PIL import ImageGrab
|
||||
|
||||
"""
|
||||
Demo - Drawing and moving demo
|
||||
|
@ -7,22 +6,9 @@ from PIL import ImageGrab
|
|||
This demo shows how to use a Graph Element to (optionally) display an image and then use the
|
||||
mouse to "drag" and draw rectangles and circles.
|
||||
|
||||
Copyright 2020 PySimpleGUI.org
|
||||
Copyright 2020, 2021, 2022, 2023 PySimpleGUI.org
|
||||
"""
|
||||
|
||||
def save_element_as_file(element, filename):
|
||||
"""
|
||||
Saves any element as an image file. Element needs to have an underlyiong Widget available (almost if not all of them do)
|
||||
:param element: The element to save
|
||||
:param filename: The filename to save to. The extension of the filename determines the format (jpg, png, gif, ?)
|
||||
"""
|
||||
widget = element.Widget
|
||||
box = (widget.winfo_rootx(), widget.winfo_rooty(), widget.winfo_rootx() + widget.winfo_width(), widget.winfo_rooty() + widget.winfo_height())
|
||||
grab = ImageGrab.grab(bbox=box)
|
||||
grab.save(filename)
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
sg.theme('Dark Blue 3')
|
||||
|
@ -38,7 +24,6 @@ def main():
|
|||
[sg.R('Bring to front', 1, key='-FRONT-', enable_events=True)],
|
||||
[sg.R('Move Everything', 1, key='-MOVEALL-', enable_events=True)],
|
||||
[sg.R('Move Stuff', 1, key='-MOVE-', enable_events=True)],
|
||||
[sg.B('Save Image', key='-SAVE-')],
|
||||
]
|
||||
|
||||
layout = [[sg.Graph(
|
||||
|
@ -49,7 +34,8 @@ def main():
|
|||
enable_events=True,
|
||||
background_color='lightblue',
|
||||
drag_submits=True,
|
||||
right_click_menu=[[],['Erase item',]]
|
||||
motion_events=True,
|
||||
right_click_menu=[[''],['Erase item','Send to back']]
|
||||
), sg.Col(col, key='-COL-') ],
|
||||
[sg.Text(key='-INFO-', size=(60, 1))]]
|
||||
|
||||
|
@ -58,11 +44,9 @@ def main():
|
|||
# get the graph element for ease of use later
|
||||
graph = window["-GRAPH-"] # type: sg.Graph
|
||||
graph.draw_image(data=logo200, location=(0,400))
|
||||
|
||||
dragging = False
|
||||
start_point = end_point = prior_rect = None
|
||||
# graph.bind('<Button-3>', '+RIGHT+')
|
||||
|
||||
crosshair_lines = []
|
||||
while True:
|
||||
event, values = window.read()
|
||||
print(event, values)
|
||||
|
@ -73,7 +57,14 @@ def main():
|
|||
graph.set_cursor(cursor='fleur') # not yet released method... coming soon!
|
||||
elif not event.startswith('-GRAPH-'):
|
||||
graph.set_cursor(cursor='left_ptr') # not yet released method... coming soon!
|
||||
|
||||
if event.endswith('+MOVE'):
|
||||
window["-INFO-"].update(value=f"mouse {values['-GRAPH-']}")
|
||||
# Delete crosshairs if any exists
|
||||
if len(crosshair_lines):
|
||||
for fig in crosshair_lines:
|
||||
graph.delete_figure(fig)
|
||||
crosshair_lines = []
|
||||
window.refresh()
|
||||
if event == "-GRAPH-": # if there's a "Graph" event, then it's a mouse
|
||||
x, y = values["-GRAPH-"]
|
||||
if not dragging:
|
||||
|
@ -119,20 +110,23 @@ def main():
|
|||
start_point, end_point = None, None # enable grabbing a new rect
|
||||
dragging = False
|
||||
prior_rect = None
|
||||
elif event.endswith('+RIGHT+'): # Righ click
|
||||
window["-INFO-"].update(value=f"Right clicked location {values['-GRAPH-']}")
|
||||
elif event.endswith('+MOTION+'): # Righ click
|
||||
window["-INFO-"].update(value=f"mouse freely moving {values['-GRAPH-']}")
|
||||
elif event == '-SAVE-':
|
||||
# filename = sg.popup_get_file('Choose file (PNG, JPG, GIF) to save to', save_as=True)
|
||||
filename=r'test.jpg'
|
||||
save_element_as_file(window['-GRAPH-'], filename)
|
||||
# elif event.endswith('+RIGHT+'): # Right click
|
||||
# window["-INFO-"].update(value=f"Right clicked location {values['-GRAPH-']}")
|
||||
# elif event.endswith('+MOTION+'): # Right click
|
||||
# window["-INFO-"].update(value=f"mouse freely moving {values['-GRAPH-']}")
|
||||
elif event == 'Send to back': # Right clicked menu item
|
||||
figures = graph.get_figures_at_location(values["-GRAPH-"]) # get items in front-to-back order
|
||||
if figures: # make sure at least 1 item found
|
||||
graph.send_figure_to_back(figures[-1]) # get the last item which will be the top-most
|
||||
elif event == 'Erase item':
|
||||
window["-INFO-"].update(value=f"Right click erase at {values['-GRAPH-']}")
|
||||
if values['-GRAPH-'] != (None, None):
|
||||
drag_figures = graph.get_figures_at_location(values['-GRAPH-'])
|
||||
for figure in drag_figures:
|
||||
graph.delete_figure(figure)
|
||||
figures = graph.get_figures_at_location(values['-GRAPH-'])
|
||||
if figures:
|
||||
graph.delete_figure(figures[-1]) # delete the one on top
|
||||
location = values['-GRAPH-']
|
||||
crosshair_lines = [graph.draw_line((location[0], 0), (location[0], 800), color='red'),
|
||||
graph.draw_line((0, location[1]), (800, location[1]), color='red')]
|
||||
|
||||
window.close()
|
||||
|
||||
|
|
156
DemoPrograms/Demo_Graph_Elem_CPU_Meter.py
Normal file
156
DemoPrograms/Demo_Graph_Elem_CPU_Meter.py
Normal file
File diff suppressed because one or more lines are too long
|
@ -44,7 +44,7 @@ def convert_to_bytes(file_or_bytes, resize=None):
|
|||
if resize:
|
||||
new_width, new_height = resize
|
||||
scale = min(new_height/cur_height, new_width/cur_width)
|
||||
img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL.Image.ANTIALIAS)
|
||||
img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL.Image.LANCZOS)
|
||||
bio = io.BytesIO()
|
||||
img.save(bio, format="PNG")
|
||||
del img
|
||||
|
|
|
@ -45,7 +45,7 @@ def convert_to_bytes(file_or_bytes, resize=None):
|
|||
if resize:
|
||||
new_width, new_height = resize
|
||||
scale = min(new_height/cur_height, new_width/cur_width)
|
||||
img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL.Image.ANTIALIAS)
|
||||
img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL.Image.LANCZOS)
|
||||
with io.BytesIO() as bio:
|
||||
img.save(bio, format="PNG")
|
||||
del img
|
||||
|
|
|
@ -55,7 +55,7 @@ def resize(input_file, size, output_file=None, encode_format='PNG'):
|
|||
new_width, new_height = size
|
||||
if new_width != width or new_height != height: # if the requested size is different than original size
|
||||
scale = min(new_height / height, new_width / width)
|
||||
resized_image = image.resize((int(width * scale), int(height * scale)), Image.ANTIALIAS)
|
||||
resized_image = image.resize((int(width * scale), int(height * scale)), Image.LANCZOS)
|
||||
else:
|
||||
resized_image = image
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ def convert_to_bytes(file_or_bytes, resize=None, fill=False):
|
|||
if resize:
|
||||
new_width, new_height = resize
|
||||
scale = min(new_height / cur_height, new_width / cur_width)
|
||||
img = img.resize((int(cur_width * scale), int(cur_height * scale)), PIL.Image.ANTIALIAS)
|
||||
img = img.resize((int(cur_width * scale), int(cur_height * scale)), PIL.Image.LANCZOS)
|
||||
if fill:
|
||||
img = make_square(img, THUMBNAIL_SIZE[0])
|
||||
with io.BytesIO() as bio:
|
||||
|
|
|
@ -22,9 +22,9 @@ import PySimpleGUI as sg
|
|||
Copyright 2020, 2022 PySimpleGUI.org
|
||||
"""
|
||||
|
||||
layout = [ [sg.Text('Hide Button or Input. Button3 hides Input. Buttons 1 & 2 hide Button 2')],
|
||||
layout = [ [sg.Text('Hide Button or Multiline. Buttons 1 & 2 hide Button 2')],
|
||||
[sg.pin(sg.Multiline(size=(60, 10), key='-MLINE-'))],
|
||||
[sg.pin(sg.Button('Button1')), sg.pin(sg.Button('Button2'), shrink=False), sg.B('Button3'), sg.B('Toggle Multiline')],
|
||||
[sg.pin(sg.Button('Button1')), sg.pin(sg.Button('Button2'), shrink=False), sg.B('Toggle Multiline')],
|
||||
]
|
||||
|
||||
window = sg.Window('Visible / Invisible Element Demo', layout)
|
||||
|
@ -39,9 +39,6 @@ while True: # Event Loop
|
|||
if event in ('Button1', 'Button2'):
|
||||
window['Button2'].update(visible=toggle)
|
||||
toggle = not toggle
|
||||
if event == 'Button3':
|
||||
window['-IN-'].update(visible=toggle_in)
|
||||
toggle_in = not toggle_in
|
||||
elif event == 'Toggle Multiline':
|
||||
window['-MLINE-'].update(visible=not window['-MLINE-'].visible)
|
||||
window.close()
|
||||
|
|
|
@ -890,7 +890,7 @@ def convert_to_bytes(file_or_bytes, resize=None):
|
|||
if resize:
|
||||
new_width, new_height = resize
|
||||
scale = min(new_height/cur_height, new_width/cur_width)
|
||||
img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL.Image.ANTIALIAS)
|
||||
img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL.Image.LANCZOS)
|
||||
with io.BytesIO() as bio:
|
||||
img.save(bio, format="PNG")
|
||||
del img
|
||||
|
|
|
@ -15,7 +15,7 @@ button64 = 'iVBORw0KGgoAAAANSUhEUgAAAoAAAAFACAMAAAAbEz04AAAABGdBTUEAALGPC/xhBQAA
|
|||
def image_file_to_bytes(image64, size):
|
||||
image_file = io.BytesIO(base64.b64decode(image64))
|
||||
img = Image.open(image_file)
|
||||
img.thumbnail(size, Image.ANTIALIAS)
|
||||
img.thumbnail(size, Image.LANCZOS)
|
||||
bio = io.BytesIO()
|
||||
img.save(bio, format='PNG')
|
||||
imgbytes = bio.getvalue()
|
||||
|
|
|
@ -60,7 +60,7 @@ def convert_to_bytes(source, size=(None, None), subsample=None, zoom=None, fill=
|
|||
elif zoom is not None:
|
||||
scale = zoom
|
||||
|
||||
resized_image = image.resize((int(width * scale), int(height * scale)), Image.ANTIALIAS) if scale is not None else image
|
||||
resized_image = image.resize((int(width * scale), int(height * scale)), Image.LANCZOS) if scale is not None else image
|
||||
if fill and scale is not None:
|
||||
resized_image = make_square(resized_image)
|
||||
# encode a PNG formatted version of image into BASE64
|
||||
|
|
|
@ -59,7 +59,7 @@ def convert_to_bytes(file_or_bytes, resize=None):
|
|||
if resize:
|
||||
new_width, new_height = resize
|
||||
scale = min(new_height / cur_height, new_width / cur_width)
|
||||
img = img.resize((int(cur_width * scale), int(cur_height * scale)), PIL.Image.ANTIALIAS)
|
||||
img = img.resize((int(cur_width * scale), int(cur_height * scale)), PIL.Image.LANCZOS)
|
||||
with io.BytesIO() as bio:
|
||||
img.save(bio, format="PNG")
|
||||
del img
|
||||
|
@ -69,7 +69,7 @@ def convert_to_bytes(file_or_bytes, resize=None):
|
|||
# def image_file_to_bytes(filename, size):
|
||||
# try:
|
||||
# image = Image.open(filename)
|
||||
# image.thumbnail(size, Image.ANTIALIAS)
|
||||
# image.thumbnail(size, Image.LANCZOS)
|
||||
# bio = io.BytesIO() # a binary memory resident stream
|
||||
# image.save(bio, format='PNG') # save image as png to it
|
||||
# imgbytes = bio.getvalue()
|
||||
|
@ -80,7 +80,7 @@ def convert_to_bytes(file_or_bytes, resize=None):
|
|||
|
||||
def set_image_to_blank(key):
|
||||
img = PIL.Image.new('RGB', (100, 100), (255, 255, 255))
|
||||
img.thumbnail((1, 1), PIL.Image.ANTIALIAS)
|
||||
img.thumbnail((1, 1), PIL.Image.LANCZOS)
|
||||
bio = io.BytesIO()
|
||||
img.save(bio, format='PNG')
|
||||
imgbytes = bio.getvalue()
|
||||
|
|
|
@ -2,7 +2,6 @@ import PySimpleGUI as sg, random
|
|||
import numpy as np
|
||||
from typing import List, Any, Union, Tuple, Dict
|
||||
|
||||
|
||||
"""
|
||||
Sudoku Puzzle Demo
|
||||
|
||||
|
@ -27,7 +26,7 @@ def generate_sudoku(mask_rate):
|
|||
"""
|
||||
while True:
|
||||
n = 9
|
||||
solution = np.zeros((n, n), np.int)
|
||||
solution = np.zeros((n, n), np.int_)
|
||||
rg = np.arange(1, n + 1)
|
||||
solution[0, :] = np.random.choice(rg, n, replace=False)
|
||||
try:
|
||||
|
@ -39,7 +38,8 @@ def generate_sudoku(mask_rate):
|
|||
sub_r, sub_c = r // 3, c // 3
|
||||
avb2 = np.setdiff1d(np.arange(0, n + 1), solution[sub_r * 3:(sub_r + 1) * 3, sub_c * 3:(sub_c + 1) * 3].ravel())
|
||||
avb = np.intersect1d(avb1, avb2)
|
||||
solution[r, c] = np.random.choice(avb, size=1)
|
||||
# solution[r, c] = np.random.choice(avb, size=1)
|
||||
solution[r, c] = np.random.choice(avb, size=1)[0]
|
||||
break
|
||||
except ValueError:
|
||||
pass
|
||||
|
@ -48,7 +48,6 @@ def generate_sudoku(mask_rate):
|
|||
return puzzle, solution
|
||||
|
||||
|
||||
|
||||
def check_progress(window, solution):
|
||||
"""
|
||||
Gives you a visual hint on your progress.
|
||||
|
@ -82,9 +81,17 @@ def check_progress(window, solution):
|
|||
return solved
|
||||
|
||||
|
||||
def create_and_show_puzzle(window):
|
||||
def main(mask_rate=0.7):
|
||||
""""
|
||||
The Main GUI - It does it all.
|
||||
|
||||
The "Board" is a grid that's 9 x 9. Even though the layout is a grid of 9 Frames, the
|
||||
addressing of the individual squares is via a key that's a tuple (0,0) to (8,8)
|
||||
"""
|
||||
|
||||
def create_and_show_puzzle():
|
||||
# create and display a puzzle by updating the Input elements
|
||||
rate = DEFAULT_MASK_RATE
|
||||
rate = mask_rate
|
||||
if window['-RATE-'].get():
|
||||
try:
|
||||
rate = float(window['-RATE-'].get())
|
||||
|
@ -96,34 +103,24 @@ def create_and_show_puzzle(window):
|
|||
window[r, c].update(puzzle[r][c] if puzzle[r][c] else '', background_color=sg.theme_input_background_color())
|
||||
return puzzle, solution
|
||||
|
||||
|
||||
def main(mask_rate=0.7):
|
||||
""""
|
||||
The Main GUI - It does it all.
|
||||
|
||||
The "Board" is a grid that's 9 x 9. Even though the layout is a grid of 9 Frames, the
|
||||
addressing of the individual squares is via a key that's a tuple (0,0) to (8,8)
|
||||
"""
|
||||
|
||||
|
||||
|
||||
|
||||
# It's 1 line of code to make a Sudoku board. If you don't like it, then replace it.
|
||||
# Dude (Dudette), it's 1-line of code. If you don't like the board, write a line of code.
|
||||
# The keys for the inputs are tuples (0-8, 0-8) that reference each Input Element.
|
||||
# Get an input element for a position using: window[row, col]
|
||||
# To get a better understanding, take it apart. Spread it out. You'll learn in the process.
|
||||
window = sg.Window('Sudoku',
|
||||
[[sg.Frame('', [[sg.I(random.randint(1,9), justification='r', size=(3,1),enable_events=True, key=(fr*3+r,fc*3+c)) for c in range(3)] for r in range(3)]) for fc in range(3)] for fr in range(3)] +
|
||||
[[sg.B('Solve'), sg.B('Check'), sg.B('Hint'), sg.B('New Game'), sg.T('Mask rate (0-1)'), sg.In(str(mask_rate), size=(3,1),key='-RATE-')],], finalize=True)
|
||||
[[sg.Frame('', [[sg.I(random.randint(1, 9), justification='r', size=(3, 1), key=(fr * 3 + r, fc * 3 + c)) for c in range(3)] for r in range(3)]) for fc in
|
||||
range(3)] for fr in range(3)] +
|
||||
[[sg.B('Solve'), sg.B('Check'), sg.B('Hint'), sg.B('New Game')], [sg.T('Mask rate (0-1)'), sg.In(str(mask_rate), size=(3, 1), key='-RATE-')], ],
|
||||
finalize=True)
|
||||
|
||||
# create and display a puzzle by updating the Input elements
|
||||
|
||||
puzzle, solution = create_and_show_puzzle(window)
|
||||
check_showing = False
|
||||
puzzle, solution = create_and_show_puzzle()
|
||||
|
||||
while True: # The Event Loop
|
||||
event, values = window.read()
|
||||
if event == sg.WIN_CLOSED:
|
||||
if event is None:
|
||||
break
|
||||
|
||||
if event == 'Solve':
|
||||
|
@ -131,7 +128,6 @@ def main(mask_rate=0.7):
|
|||
for c, col in enumerate(row):
|
||||
window[r, c].update(solution[r][c], background_color=sg.theme_input_background_color())
|
||||
elif event == 'Check':
|
||||
check_showing = True
|
||||
solved = check_progress(window, solution)
|
||||
if solved:
|
||||
sg.popup('Solved! You have solved the puzzle correctly.')
|
||||
|
@ -142,15 +138,12 @@ def main(mask_rate=0.7):
|
|||
except:
|
||||
pass # Likely because an input element didn't have focus
|
||||
elif event == 'New Game':
|
||||
puzzle, solution = create_and_show_puzzle(window)
|
||||
elif check_showing: # an input was changed, so clear any background colors from prior hints
|
||||
check_showing = False
|
||||
for r, row in enumerate(solution):
|
||||
for c, col in enumerate(row):
|
||||
window[r, c].update(background_color=sg.theme_input_background_color())
|
||||
puzzle, solution = create_and_show_puzzle()
|
||||
|
||||
window.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
DEFAULT_MASK_RATE = 0.7 # % Of cells to hide
|
||||
main(DEFAULT_MASK_RATE)
|
||||
|
||||
if __name__ == "__main__":
|
||||
mask_rate = 0.7 # % Of cells to hide
|
||||
main(mask_rate)
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ def resize_base64_image(image64, size):
|
|||
"""
|
||||
image_file = io.BytesIO(base64.b64decode(image64))
|
||||
img = Image.open(image_file)
|
||||
img.thumbnail(size, Image.ANTIALIAS)
|
||||
img.thumbnail(size, Image.LANCZOS)
|
||||
bio = io.BytesIO()
|
||||
img.save(bio, format='PNG')
|
||||
imgbytes = bio.getvalue()
|
||||
|
|
85
DemoPrograms/Demo_Table_Checkmark.py
Normal file
85
DemoPrograms/Demo_Table_Checkmark.py
Normal file
|
@ -0,0 +1,85 @@
|
|||
#!/usr/bin/env python
|
||||
import PySimpleGUI as sg
|
||||
import random
|
||||
import string
|
||||
|
||||
"""
|
||||
Demo Program - Table with checkboxes
|
||||
|
||||
This clever solution was sugged by GitHub user robochopbg.
|
||||
The beauty of the simplicity is that the checkbox is simply another column in the table. When the checkbox changes
|
||||
state, then the data in the table is changed and the table is updated in the Table element.
|
||||
A big thank you again to user robochopbg!
|
||||
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⣿⠆⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⡿⠁⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⠟⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⡿⠃⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣾⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀
|
||||
⠀⢀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⠏⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠺⣿⣷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠈⠻⣿⣿⣦⣄⠀⠀⠀⠀⠀⠀⣠⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠈⠻⣿⣿⣷⣤⡀⠀⠀⣰⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣦⣼⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
|
||||
Copyright 2023 PySimpleGUI
|
||||
"""
|
||||
|
||||
# Characters used for the checked and unchecked checkboxes. Feel free to change
|
||||
BLANK_BOX = '☐'
|
||||
CHECKED_BOX = '☑'
|
||||
|
||||
# ------ Some functions to help generate data for the table ------
|
||||
def word():
|
||||
return ''.join(random.choice(string.ascii_lowercase) for i in range(10))
|
||||
def number(max_val=1000):
|
||||
return random.randint(0, max_val)
|
||||
|
||||
def make_table(num_rows, num_cols):
|
||||
data = [[j for j in range(num_cols)] for i in range(num_rows)]
|
||||
data[0] = [word() for __ in range(num_cols)]
|
||||
for i in range(1, num_rows):
|
||||
data[i] = [BLANK_BOX if random.randint(0,2) % 2 else CHECKED_BOX] + [word(), *[number() for i in range(num_cols - 1)]]
|
||||
return data
|
||||
|
||||
# ------ Make the Table Data ------
|
||||
data = make_table(num_rows=15, num_cols=6)
|
||||
headings = [str(data[0][x])+' ..' for x in range(len(data[0]))]
|
||||
headings[0] = 'Checkbox'
|
||||
# The selected rows is stored in a set
|
||||
selected = {i for i, row in enumerate(data[1:][:]) if row[0] == CHECKED_BOX}
|
||||
|
||||
# ------ Window Layout ------
|
||||
layout = [[sg.Table(values=data[1:][:], headings=headings, max_col_width=25, auto_size_columns=False, col_widths=[10, 10, 20, 20 ,30, 5],
|
||||
display_row_numbers=True, justification='center', num_rows=20, key='-TABLE-', selected_row_colors='red on yellow',
|
||||
expand_x=False, expand_y=True, vertical_scroll_only=False, enable_click_events=True, font='_ 14'),
|
||||
sg.Sizegrip()]]
|
||||
|
||||
# ------ Create Window ------
|
||||
window = sg.Window('Table with Checkbox', layout, resizable=True, finalize=True)
|
||||
|
||||
# Highlight the rows (select) that have checkboxes checked
|
||||
window['-TABLE-'].update(values=data[1:][:], select_rows=list(selected))
|
||||
|
||||
# ------ Event Loop ------
|
||||
while True:
|
||||
event, values = window.read()
|
||||
if event == sg.WIN_CLOSED:
|
||||
break
|
||||
elif event[0] == '-TABLE-' and event[2][0] not in (None, -1): # if clicked a data row rather than header or outside table
|
||||
row = event[2][0]+1
|
||||
if data[row][0] == CHECKED_BOX: # Going from Checked to Unchecked
|
||||
selected.remove(row-1)
|
||||
data[row][0] = BLANK_BOX
|
||||
else: # Going from Unchecked to Checked
|
||||
selected.add(row-1)
|
||||
data[row ][0] = CHECKED_BOX
|
||||
window['-TABLE-'].update(values=data[1:][:], select_rows=list(selected)) # Update the table and the selected rows
|
||||
|
||||
window.close()
|
||||
|
File diff suppressed because one or more lines are too long
|
@ -16,7 +16,7 @@ import PySimpleGUI as sg
|
|||
|
||||
|
||||
|
||||
def popup_get_time(title='Time Entry', starting_hour=1, starting_minute=0, font=None):
|
||||
def popup_get_time(title='Time Entry', starting_hour=1, starting_minute=0, allow_manual_input=True, font=None):
|
||||
"""
|
||||
Shows a window that will gather a time of day.
|
||||
|
||||
|
@ -26,6 +26,8 @@ def popup_get_time(title='Time Entry', starting_hour=1, starting_minute=0, font=
|
|||
:type starting_hour: int
|
||||
:param starting_minute: Value to initially show in the minute field
|
||||
:type starting_minute: int
|
||||
:param allow_manual_input: If True, then the Spin elements can be manually edited
|
||||
:type allow_manual_input: bool
|
||||
:param font: Font to use for the window
|
||||
:type font: str | tuple
|
||||
:return: Tuple with format: (hour, minute, am-pm string)
|
||||
|
@ -36,9 +38,9 @@ def popup_get_time(title='Time Entry', starting_hour=1, starting_minute=0, font=
|
|||
hour_list = [i for i in range(0, 15)]
|
||||
minute_list = [i for i in range(-1, 62)]
|
||||
|
||||
layout = [[sg.Spin(hour_list, initial_value=starting_hour, key='-HOUR-', s=3, enable_events=True, readonly=False),
|
||||
layout = [[sg.Spin(hour_list, initial_value=starting_hour, key='-HOUR-', s=3, enable_events=True, readonly=not allow_manual_input),
|
||||
sg.Text(':'),
|
||||
sg.Spin(minute_list, initial_value=starting_minute, key='-MIN-', s=3, enable_events=True, readonly=False),
|
||||
sg.Spin(minute_list, initial_value=starting_minute, key='-MIN-', s=3, enable_events=True, readonly=not allow_manual_input),
|
||||
sg.Combo(['AM', 'PM'], 'AM', readonly=True, key='-AMPM-')],
|
||||
[sg.Button('Ok'), sg.Button('Cancel')]]
|
||||
|
||||
|
|
55
DemoPrograms/Demo_User_Settings_Auto_Load_and_Save.py
Normal file
55
DemoPrograms/Demo_User_Settings_Auto_Load_and_Save.py
Normal file
|
@ -0,0 +1,55 @@
|
|||
import PySimpleGUI as sg
|
||||
|
||||
"""
|
||||
Demo - User Setting API to automatically save and load Input Elements
|
||||
|
||||
This Demo Program shows an easy way to add saving and loading of Input elements.
|
||||
|
||||
The variable keys_to_save is used to determine which elements will be saved to the user settings file.
|
||||
|
||||
The function make_key returns a dictionary that's used as keyword parameters that are passed to the Input elements. Using this technique allows the Input elements in the layout to benefit from the docstrings provided by PySimpleGUI. Another approach could be to use a function that returns an Input element, but that limits the flexibility for configuring Input elements.
|
||||
|
||||
Copyright 2023 PySimpleGUI
|
||||
"""
|
||||
|
||||
keys_to_save = ('-IN1-', '-IN2-', '-IN3-', '-IN4-')
|
||||
|
||||
def make_key(key):
|
||||
"""
|
||||
Returns a dictionary that is used to pass parameters to an Input element.
|
||||
Another approach could be to return an Input element. The downside to that approach is
|
||||
the lack of parameters and associated docstrings when creating the layout.
|
||||
|
||||
:param key:
|
||||
:return: Dict
|
||||
"""
|
||||
return {'default_text':sg.user_settings_get_entry(key, ''), 'key':key}
|
||||
|
||||
|
||||
def main():
|
||||
layout = [ [sg.Text('Automatically Load and Save Of Inputs', font='_ 15')],
|
||||
[sg.Text('Input 1'), sg.Input(**make_key('-IN1-'))],
|
||||
[sg.Text('Input 2'), sg.Input(**make_key('-IN2-'), background_color='green')],
|
||||
[sg.Text('Input 3'), sg.Input(**make_key('-IN3-'), text_color='blue')],
|
||||
[sg.Text('Input 4'), sg.Input(**make_key('-IN4-'), size=5)],
|
||||
[sg.Button('Exit (and save)', key='-EXIT SAVE-'), sg.Button('Exit without save')] ]
|
||||
|
||||
window = sg.Window('Save / Load Inputs Using User Settings API', layout)
|
||||
|
||||
while True: # Event Loop
|
||||
event, values = window.read()
|
||||
print(event, values)
|
||||
if event == sg.WIN_CLOSED or event == 'Exit without save':
|
||||
sg.popup_quick_message('Exiting without save', text_color='white', background_color='red', font='_ 20')
|
||||
|
||||
break
|
||||
elif event == '-EXIT SAVE-':
|
||||
sg.popup_quick_message('Saving settings & Exiting', text_color='white', background_color='red', font='_ 20')
|
||||
for key in keys_to_save:
|
||||
sg.user_settings_set_entry(key, values[key])
|
||||
break
|
||||
|
||||
window.close()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
109
DemoPrograms/Demo_Watermark_Window.py
Normal file
109
DemoPrograms/Demo_Watermark_Window.py
Normal file
|
@ -0,0 +1,109 @@
|
|||
import PySimpleGUI as sg
|
||||
|
||||
"""
|
||||
Demo - Watermarking all windows
|
||||
|
||||
Watermarking windows can be done in 4.60.0.160 and greater. It's a very simple mechanism for now.
|
||||
|
||||
The option is normally set in the Global Settings control panel. However, you can "Force" the watermark
|
||||
on all windows by setting the Window paramter watermark=True on any window you create and from then on
|
||||
all windows will have the watermark.
|
||||
|
||||
Copyright 2023 PySimpleGUI
|
||||
"""
|
||||
|
||||
"""
|
||||
M"""""""`YM
|
||||
M mmmm. M
|
||||
M MMMMM M .d8888b.
|
||||
M MMMMM M 88' `88
|
||||
M MMMMM M 88. .88
|
||||
M MMMMM M `88888P'
|
||||
MMMMMMMMMMM
|
||||
|
||||
M""MMM""MMM""M dP dP
|
||||
M MMM MMM M 88 88
|
||||
M MMP MMP M .d8888b. d8888P .d8888b. 88d888b. 88d8b.d8b. .d8888b. 88d888b. 88 .dP
|
||||
M MM' MM' .M 88' `88 88 88ooood8 88' `88 88'`88'`88 88' `88 88' `88 88888"
|
||||
M `' . '' .MM 88. .88 88 88. ... 88 88 88 88 88. .88 88 88 `8b.
|
||||
M .d .dMMM `88888P8 dP `88888P' dP dP dP dP `88888P8 dP dP `YP
|
||||
MMMMMMMMMMMMMM
|
||||
"""
|
||||
|
||||
layout = [ [sg.Text('No Watermark')],
|
||||
[sg.Button('Exit')] ]
|
||||
|
||||
window = sg.Window('No Watermark', layout)
|
||||
|
||||
while True:
|
||||
event, values = window.read()
|
||||
if event == sg.WIN_CLOSED or event == 'Exit':
|
||||
break
|
||||
|
||||
window.close()
|
||||
|
||||
|
||||
"""
|
||||
MP""""""`MM dP
|
||||
M mmmmm..M 88
|
||||
M. `YM dP dP .d8888b. d8888P .d8888b. 88d8b.d8b.
|
||||
MMMMMMM. M 88 88 Y8ooooo. 88 88ooood8 88'`88'`88
|
||||
M. .MMM' M 88. .88 88 88 88. ... 88 88 88
|
||||
Mb. .dM `8888P88 `88888P' dP `88888P' dP dP dP
|
||||
MMMMMMMMMMM .88
|
||||
d8888P
|
||||
M""MMM""MMM""M dP dP
|
||||
M MMM MMM M 88 88
|
||||
M MMP MMP M .d8888b. d8888P .d8888b. 88d888b. 88d8b.d8b. .d8888b. 88d888b. 88 .dP
|
||||
M MM' MM' .M 88' `88 88 88ooood8 88' `88 88'`88'`88 88' `88 88' `88 88888"
|
||||
M `' . '' .MM 88. .88 88 88. ... 88 88 88 88 88. .88 88 88 `8b.
|
||||
M .d .dMMM `88888P8 dP `88888P' dP dP dP dP `88888P8 dP dP `YP
|
||||
MMMMMMMMMMMMMM
|
||||
"""
|
||||
|
||||
sg.set_options(watermark_text='') # noramlly not requird unless previously set by user
|
||||
|
||||
layout = [ [sg.Text('System Provided Watermark')],
|
||||
[sg.Button('Exit')] ]
|
||||
|
||||
window = sg.Window('System Watermark', layout, watermark=True)
|
||||
|
||||
while True:
|
||||
event, values = window.read()
|
||||
if event == sg.WIN_CLOSED or event == 'Exit':
|
||||
break
|
||||
|
||||
window.close()
|
||||
|
||||
|
||||
"""
|
||||
M""MMMMM""M
|
||||
M MMMMM M
|
||||
M MMMMM M .d8888b. .d8888b. 88d888b.
|
||||
M MMMMM M Y8ooooo. 88ooood8 88' `88
|
||||
M `MMM' M 88 88. ... 88
|
||||
Mb dM `88888P' `88888P' dP
|
||||
MMMMMMMMMMM
|
||||
|
||||
M""MMM""MMM""M dP dP
|
||||
M MMM MMM M 88 88
|
||||
M MMP MMP M .d8888b. d8888P .d8888b. 88d888b. 88d8b.d8b. .d8888b. 88d888b. 88 .dP
|
||||
M MM' MM' .M 88' `88 88 88ooood8 88' `88 88'`88'`88 88' `88 88' `88 88888"
|
||||
M `' . '' .MM 88. .88 88 88. ... 88 88 88 88 88. .88 88 88 `8b.
|
||||
M .d .dMMM `88888P8 dP `88888P' dP dP dP dP `88888P8 dP dP `YP
|
||||
MMMMMMMMMMMMMM
|
||||
"""
|
||||
|
||||
sg.set_options(watermark_text='User Supplied Version 1.0')
|
||||
|
||||
layout = [ [sg.Text('User Supplied Watermark')],
|
||||
[sg.Button('Exit')] ]
|
||||
|
||||
window = sg.Window('User Supplied Watermark', layout, watermark=True)
|
||||
|
||||
while True:
|
||||
event, values = window.read()
|
||||
if event == sg.WIN_CLOSED or event == 'Exit':
|
||||
break
|
||||
|
||||
window.close()
|
|
@ -10,10 +10,10 @@ import PySimpleGUI as sg
|
|||
|
||||
The purpose of this demo is to show you the simple "make window" design pattern. It simply makes a
|
||||
window using a layout that's defined in that function and returns the Window object. It's not a bad
|
||||
way to encapsulate windows if your applcation is gettinga little larger than the typical small data
|
||||
way to encapsulate windows if your application is getting a little larger than the typical small data
|
||||
entry window.
|
||||
|
||||
Copyright 2020 PySimpleGUI.org
|
||||
Copyright 2020, 2023 PySimpleGUI.org
|
||||
"""
|
||||
|
||||
|
||||
|
@ -25,11 +25,12 @@ def make_window():
|
|||
:return: Window that is created using the layout defined in the function
|
||||
:rtype: Window
|
||||
"""
|
||||
layout = [[sg.Text('My Window')],
|
||||
[sg.Input(key='-IN-'), sg.Text(size=(12, 1), key='-OUT-')],
|
||||
[sg.Button('Go'), sg.Button('Exit')]]
|
||||
layout = [[sg.Text('The program will only exit using the "Quit Program" button.')],
|
||||
[sg.Text('Closing the window or using Exit button will cause a new window to be created.')],
|
||||
[sg.Input(key='-IN-')],
|
||||
[sg.Button('Does Nothing'), sg.Button('Exit'), sg.Button('Quit Program')]]
|
||||
|
||||
return sg.Window('Window Title', layout)
|
||||
return sg.Window('Window that restarts on exit', layout)
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -41,8 +42,10 @@ def main():
|
|||
if event == sg.WIN_CLOSED or event == 'Exit':
|
||||
window.close()
|
||||
window = make_window()
|
||||
elif event == 'Go':
|
||||
window['-OUT-'].update(values['-IN-'])
|
||||
elif event == 'Quit Program': # The Quit Program button break out of event loop and exits program
|
||||
break
|
||||
|
||||
window.close()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
1483
PySimpleGUI.py
1483
PySimpleGUI.py
File diff suppressed because it is too large
Load diff
173
docs/Screens.md
173
docs/Screens.md
|
@ -1,3 +1,156 @@
|
|||
[splatert](https://github.com/splatert) 2023-11-19T04:48:55Z
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[PySimpleGUI](https://github.com/PySimpleGUI) 2023-11-07T14:22:15Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[SaSp73](https://github.com/SaSp73) 2023-11-07T09:35:57Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[PySimpleGUI](https://github.com/PySimpleGUI) 2023-10-26T09:38:54Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[ikeman32](https://github.com/ikeman32) 2023-10-25T21:58:09Z
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[PySimpleGUI](https://github.com/PySimpleGUI) 2023-10-21T16:11:14Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[onyx-and-iris](https://github.com/onyx-and-iris) 2023-09-06T00:00:13Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[definite-d](https://github.com/definite-d) 2023-08-26T16:34:23Z
|
||||
|
||||

|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[luisegarduno](https://github.com/luisegarduno) 2023-06-25T05:18:40Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[mrtnbm](https://github.com/mrtnbm) 2023-05-25T16:24:22Z
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[eagleEggs](https://github.com/eagleEggs) 2023-05-24T04:03:28Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[gnuchanos](https://github.com/gnuchanos) 2023-05-24T02:35:07Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[PySimpleGUI](https://github.com/PySimpleGUI) 2023-05-12T09:55:03Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[zaricj](https://github.com/zaricj) 2023-04-19T09:55:26Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[PySimpleGUI](https://github.com/PySimpleGUI) 2023-03-16T18:56:49Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[lucasmartins19](https://github.com/lucasmartins19) 2023-03-14T21:50:57Z
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[J-Josu](https://github.com/J-Josu) 2023-02-14T12:29:42Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[chanon-kr](https://github.com/chanon-kr) 2023-02-14T06:27:10Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[PySimpleGUI](https://github.com/PySimpleGUI) 2023-02-08T22:16:35Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[J-Josu](https://github.com/J-Josu) 2023-01-30T13:20:08Z
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[PySimpleGUI](https://github.com/PySimpleGUI) 2023-01-29T15:31:26Z
|
||||
|
||||

|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[eagleEggs](https://github.com/eagleEggs) 2023-01-28T02:30:37Z
|
||||
|
||||

|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[hseera](https://github.com/hseera) 2023-01-04T23:30:35Z
|
||||
|
||||

|
||||
|
@ -5,13 +158,13 @@
|
|||
|
||||
-----------
|
||||
|
||||
[kubilayyalcinyt](https://github.com/kubilayyalcinyt) 2022-12-18T21:41:57Z
|
||||
[gnuchanos](https://github.com/gnuchanos) 2022-12-18T21:41:57Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[kubilayyalcinyt](https://github.com/kubilayyalcinyt) 2022-12-18T19:36:12Z
|
||||
[gnuchanos](https://github.com/gnuchanos) 2022-12-18T19:36:12Z
|
||||
|
||||

|
||||

|
||||
|
@ -585,7 +738,7 @@
|
|||
|
||||
-----------
|
||||
|
||||
[vohe](https://github.com/vohe) 2022-01-23T13:53:09Z
|
||||
[ghost](https://github.com/ghost) 2022-01-23T13:53:09Z
|
||||
|
||||

|
||||
|
||||
|
@ -735,7 +888,7 @@
|
|||
|
||||
-----------
|
||||
|
||||
[Scania-Creations-16](https://github.com/Scania-Creations-16) 2021-11-04T02:55:59Z
|
||||
[Pranav-P-16](https://github.com/Pranav-P-16) 2021-11-04T02:55:59Z
|
||||
|
||||

|
||||

|
||||
|
@ -744,7 +897,7 @@
|
|||
|
||||
-----------
|
||||
|
||||
[Scania-Creations-16](https://github.com/Scania-Creations-16) 2021-10-31T04:14:25Z
|
||||
[Pranav-P-16](https://github.com/Pranav-P-16) 2021-10-31T04:14:25Z
|
||||
|
||||

|
||||

|
||||
|
@ -1081,13 +1234,13 @@
|
|||
|
||||
-----------
|
||||
|
||||
[vohe](https://github.com/vohe) 2020-08-08T11:11:29Z
|
||||
[ghost](https://github.com/ghost) 2020-08-08T11:11:29Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[vohe](https://github.com/vohe) 2020-08-05T13:31:05Z
|
||||
[ghost](https://github.com/ghost) 2020-08-05T13:31:05Z
|
||||
|
||||

|
||||

|
||||
|
@ -1100,13 +1253,13 @@
|
|||
|
||||
-----------
|
||||
|
||||
[vohe](https://github.com/vohe) 2020-08-02T17:28:23Z
|
||||
[ghost](https://github.com/ghost) 2020-08-02T17:28:23Z
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[vohe](https://github.com/vohe) 2020-07-05T16:45:42Z
|
||||
[ghost](https://github.com/ghost) 2020-07-05T16:45:42Z
|
||||
|
||||

|
||||

|
||||
|
@ -1114,7 +1267,7 @@
|
|||
|
||||
-----------
|
||||
|
||||
[vohe](https://github.com/vohe) 2020-07-04T15:43:31Z
|
||||
[ghost](https://github.com/ghost) 2020-07-04T15:43:31Z
|
||||
|
||||

|
||||
|
||||
|
|
403
docs/Screens2.md
403
docs/Screens2.md
|
@ -1,3 +1,380 @@
|
|||
[splatert](https://github.com/splatert) 2023-11-19T04:48:55Z
|
||||
Hello. I would like to thank you for the awesome UI framework you built as it really does help create interfaces in a really simple manner. I've given credit to you on my project's readme file and provided a link that leads to your github page.
|
||||
|
||||
With the power of your library, I've created an alternative UI frontend for SpotDL. A tool for downloading Spotify tracks using URLs that you provide. Now SpotDL does have their own interface which is loaded onto the web browser but It felt like it was slow as it took a couple of seconds to start up, which is why I wanted to create my own.
|
||||
|
||||

|
||||
|
||||
The way this frontend is used is that you provide each link into the interface's textbox then hit the plus button to pass them to a list of URLs (which then the listbox shown above displays the urls list).
|
||||
|
||||
Upon providing URLs, you then press the download button to initiate the download process (given that you provide the SpotDL executable).
|
||||
|
||||

|
||||
If the control shown above is checked, the program would ask you to provide a name for the folder you want to create and send downloaded songs to. Prompt dialog is shown below.
|
||||
|
||||

|
||||
Pressing **OK** will assign the folder name to a string variable then tell the program that you want to create a folder.
|
||||
Pressing **Cancel** or having the checkbox mentioned above unmarked would not tell the program to create any folders.
|
||||
|
||||
|
||||
After information is provided, the program executes SpotDL with the links you entered passed as arguments and will wait for it to complete the download job.
|
||||

|
||||
|
||||
|
||||
After the download job is finished, songs get transferred over to the frontend's music directory and you will get a message saying that the download process has been completed.
|
||||

|
||||

|
||||
|
||||
|
||||
Here's a link to the project repository.
|
||||
https://github.com/splatert/spotdl-ui
|
||||
|
||||
-----------
|
||||
|
||||
[SaSp73](https://github.com/SaSp73) 2023-11-07T15:52:58Z
|
||||
Thanks for your kind words. I will send you the code in a couple of days when I return back home.
|
||||
It need some extra hardware (PICAN-M board, Adafruit ADC and BME280 barometer), but you will manage to get around this with a little bit of tinkering.
|
||||
Basically the whole control is a graph with elements redrawing according to the calculated data...
|
||||
|
||||
BTW, a Rotate_Figure(figure_id, center_point, degrees_of_rotation) would be very helpful (I will open a suggestion later)
|
||||
|
||||
-----------
|
||||
|
||||
[PySimpleGUI](https://github.com/PySimpleGUI) 2023-11-07T14:22:15Z
|
||||
WOW @SaSp73 !!
|
||||
|
||||

|
||||
|
||||
Truly mind-blowing and very inspiring to see. I've never seen anything like this done with PySimpleGUI! One of the things I love about this project are the surprises by what people create.
|
||||
|
||||
I would love to see how you did some of the things you did if you ever care to share the code (even privately would be great.... I'll be confidential. I'm curious what features were helpful).
|
||||
|
||||
Thank you so so much for sharing.
|
||||
|
||||
|
||||
|
||||
-----------
|
||||
|
||||
[kcl1s](https://github.com/kcl1s) 2023-11-07T11:01:09Z
|
||||
Wow
|
||||
Those graphics are fantastic. Thanks for sharing.
|
||||
|
||||
|
||||
-----------
|
||||
|
||||
[SaSp73](https://github.com/SaSp73) 2023-11-07T09:35:57Z
|
||||
This is my use of PySimpleGUI, a program reading NMEA200 networks, running on raspberry pi 4, and presenting various data used for sail racing.
|
||||

|
||||
|
||||
|
||||
|
||||
-----------
|
||||
|
||||
[PySimpleGUI](https://github.com/PySimpleGUI) 2023-10-26T09:38:54Z
|
||||
We're on very similar wavelengths @ikeman32. It's great to see some add-on tools to help users.
|
||||
|
||||
As part of the PySimpleGUI 5 release of the PySimpleGUI applications and add-on modules, I've written a GUI tool that creates all of the necessary files to upload a PySimpleGUI application to PyPI, opening up distribution of Python applications to PySimpleGUI users. We've been releasing tools via PyPI for some time. "psgresizer" is a good example. Users can pip install it and then once installed it can be run by typing "psgresizer" from the command line. There's already a tool, psgshortcut, that takes it all a start further by making shortcuts (icons) that can be pinned to the taskbar or double-clicked.
|
||||
|
||||
The idea is to make distribution easy as well as the result be familiar feeling. The command line isn't a normal part of a normal Windows user's world, so getting it out of the way entirely makes a lot of sense. I've just about got the final tool finished that will make it all work end to end.
|
||||
|
||||

|
||||
|
||||
|
||||
-----------
|
||||
|
||||
[ikeman32](https://github.com/ikeman32) 2023-10-25T21:58:09Z
|
||||
I have created a simple bash script to initialize a PySimpleGUI project. It can be found here: https://github.com/ikeman32/ScriptHelpers/tree/main/devscripts
|
||||
|
||||
It's very basic at the moment, but functional. For Windows users, I do have an AI-generated port, but it remains untested as I gave up my Windows addiction in 2017. I may eventually create a platform-independent version of the script using Python.
|
||||
|
||||
I do accept code contributions, so if there are Windows users that want to develop a Windows batch equivalent or a Python version of this script, see the README. Or you can code your own.
|
||||
|
||||
PySimpleGUI is an absolute God-sent for me. I like simplicity, and I am also lazy, so if there is an easier way to do something, I'm all for it. I'm also in the planning stages for a visual editor/IDE for PySimpleGUI applications.
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
|
||||
|
||||
-----------
|
||||
|
||||
[maria-korosteleva](https://github.com/maria-korosteleva) 2023-10-23T09:26:11Z
|
||||
@PySimpleGUI Thank you very much for your kind words! 🥰
|
||||
|
||||
|
||||
-----------
|
||||
|
||||
[PySimpleGUI](https://github.com/PySimpleGUI) 2023-10-21T16:11:14Z
|
||||
Wow @maria-korosteleva what an incredible application! I love what you've created! 
|
||||
|
||||
I've never seen anything like what you've made. There's clearly a **lot** going on with your work than just a GUI. I had never thought about the intersection of CAD and making garments. It's a fascinating use of technology. I really appreciate you taking the time to post a screenshot and letting us know about your project.
|
||||
|
||||
-----------
|
||||
|
||||
[maria-korosteleva](https://github.com/maria-korosteleva) 2023-10-20T11:52:13Z
|
||||
I've used the framework to build a garment design configurator in my latest research paper on programmable garments =)
|
||||
https://github.com/maria-korosteleva/GarmentCode
|
||||
https://igl.ethz.ch/projects/garmentcode/
|
||||
|
||||
<img width="957" alt="Screenshot GUI_2_mosaic" src="https://github.com/PySimpleGUI/PySimpleGUI/assets/6837635/76c59bcf-5b43-4e33-9ac4-fb0afb490da2">
|
||||
|
||||
|
||||
-----------
|
||||
|
||||
[onyx-and-iris](https://github.com/onyx-and-iris) 2023-09-06T00:00:13Z
|
||||
A small remote utility for Voicemeeter, designed to work with the NVDA screen reader.
|
||||
|
||||

|
||||
https://github.com/onyx-and-iris/nvda-voicemeeter
|
||||
|
||||
Thanks for creating PYSimpleGUI, first time using but very impressed!
|
||||
|
||||
|
||||
|
||||
-----------
|
||||
|
||||
[definite-d](https://github.com/definite-d) 2023-08-26T16:34:23Z
|
||||
[Themera](https://github.com/definite-d/Themera) v2.1.0 has been released (available [here](https://github.com/definite-d/Themera/releases/tag/v2.1.0)). I'd like to share screenshots and point out that with Windows 11, the color of the "built-in" titlebar can be customized. I accomplished it within Themera with a bit of a non-standard solution, but it's proof of concept.
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
-----------
|
||||
|
||||
[luisegarduno](https://github.com/luisegarduno) 2023-06-25T05:18:40Z
|
||||
**Chess (updated!)**
|
||||
|
||||
Originally added/created by @MikeTheWatchGuy, the chess demos (player vs. player & player vs. Ai) were included in PySimpleGUI ([see here](https://github.com/PySimpleGUI/PySimpleGUI/tree/8b23740fca08b7f5bad3f0d32760f42a5202d3e1/Chess)), but were removed from the main branch towards the end of 2022.
|
||||
|
||||
In terms of the changes that I made to the original code (see #5052):
|
||||
|
||||
I updated **requirements.txt** to include the latest versions:
|
||||
```
|
||||
PySimpleGUI==4.60.5
|
||||
python-chess==1.999
|
||||
```
|
||||
I then made changes within both of the demo files to remove any outdated or deprecated code causing errors. I also added compatibility for Linux, allowing users to import files that do not end in ".exe".
|
||||
|
||||
Both chess demos have only been tested on Ubuntu 20.04 but should also work on Windows since not much was changed from the original code. Lastly, for the engine, I resulted in having to use Stockfish 13, since there was several issues when trying to use Stockfish 14 or Stockfish 15.
|
||||
|
||||
https://github.com/luisegarduno/ChessGUI
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[mrtnbm](https://github.com/mrtnbm) 2023-05-25T16:24:22Z
|
||||
Thanks to PSG, I've created the nicest GUI I've ever made that I'm now using for my own little naive prompt lib.
|
||||
|
||||
- Main window:
|
||||

|
||||
|
||||
- Edit Window:
|
||||

|
||||
|
||||
The heart can be clicked and will change to outline or fill mode.
|
||||
|
||||
- For reference, here is a screenshot without rescaling:
|
||||
|
||||

|
||||
|
||||
-----------
|
||||
|
||||
[eagleEggs](https://github.com/eagleEggs) 2023-05-24T04:03:28Z
|
||||
Started this a few days ago. Thanks to PSG it has already proven the hypothesis as valid - Streamlining novel development in a curated parameter driven manner with op3nAI API. Much more functionality to add in, but what an amazing GUI framework <3 <3 <3 And thanks to @jason990420 for all of the tkinter hacks he's posted which has always covered everything I've needed :)
|
||||
|
||||

|
||||
|
||||
|
||||
-----------
|
||||
|
||||
[gnuchanos](https://github.com/gnuchanos) 2023-05-24T02:35:07Z
|
||||

|
||||
not finish yet
|
||||
|
||||
-----------
|
||||
|
||||
[PySimpleGUI](https://github.com/PySimpleGUI) 2023-05-12T09:55:03Z
|
||||
I saw this awesome screenshot:
|
||||
|
||||

|
||||
|
||||
posted in the readme for this project:
|
||||
|
||||
https://github.com/bsanders2/FrosthavenApp
|
||||
|
||||
It's got a nice design and the custom buttons look great.
|
||||
|
||||
-----------
|
||||
|
||||
[zaricj](https://github.com/zaricj) 2023-04-19T09:55:26Z
|
||||
I've been using PySimpleGUI to make a GUI for the Chocolatey Package Manager, thought of sending a screenshot of it here.
|
||||
|
||||

|
||||
|
||||
Thanks for this amazing module, I'm really having fun learning it!
|
||||
|
||||
-----------
|
||||
|
||||
[PySimpleGUI](https://github.com/PySimpleGUI) 2023-03-16T18:56:49Z
|
||||
@ssweber the color scheme looks like the `GrayGrayGray` theme to me which means no colors will be added (all system defaults will be used). The important feature that's adding the images is either `Image` elements or `Button` elements. Using a Base64 version of images will enable you to drop them directly into your source code. The PySimpleGUI application `psgresizer` is very helpful in enabling you to quickly add button graphics to your application.
|
||||
|
||||
Here are some steps I followed:
|
||||
|
||||
- I made a video of a session where I took images that I clipped from @lucasmartins19 's application and saved them as PNG files
|
||||
- Used `psgresizer` to convert each PNG file into a Base64 string
|
||||
- Pasted the Base64 string into my test program
|
||||
- Created a layout that used these Base64 images using the `Image` element.
|
||||
|
||||
My layout looked liket his:
|
||||
```python
|
||||
layout = [ [sg.Text('Base64 Images Example')],
|
||||
[sg.Image(b1, key='-I1-')],
|
||||
[sg.Image(b2, key='-I2-')],
|
||||
[sg.Image(b3, key='-I3-')],
|
||||
[sg.Button('Go'), sg.Button('Exit')] ]
|
||||
```
|
||||
|
||||
When I ran the code, this is the window I saw:
|
||||
|
||||

|
||||
|
||||
If you enable events on the `Image` elements, then you'll get an event when the image is clicked.
|
||||
|
||||
```python
|
||||
layout = [ [sg.Text('Base64 Images Example')],
|
||||
[sg.Image(b1, key='-I1-', enable_events=True)],
|
||||
[sg.Image(b2, key='-I2-', enable_events=True)],
|
||||
[sg.Image(b3, key='-I3-', enable_events=True)],
|
||||
[sg.Button('Go'), sg.Button('Exit')] ]
|
||||
```
|
||||
|
||||
Here's how the process to do all this looked:
|
||||
|
||||
|
||||
https://user-images.githubusercontent.com/46163555/225724860-33b5b5ba-9e63-4159-9ccc-825b72aef11a.mp4
|
||||
|
||||
|
||||
|
||||
-----------
|
||||
|
||||
[lucasmartins19](https://github.com/lucasmartins19) 2023-03-16T14:04:53Z
|
||||
> @lucasmartins19 That looks amazing. Would you mind uploading that to a repository? I’m working on a general purpose pysimplegui toolkit and I really like your color-scheme /buttons. Would like to see how you put that all together.
|
||||
|
||||
Thank you!
|
||||
|
||||
Currently, I have a private one to manage everything and provide updates through GitHub. However, I will create a new private repository and invite you as a collaborator. Please feel free to ask me if you need any help understanding anything.
|
||||
|
||||
-----------
|
||||
|
||||
[ssweber](https://github.com/ssweber) 2023-03-16T13:22:48Z
|
||||
@lucasmartins19 That looks amazing. Would you mind uploading that to a repository? I’m working on a general purpose pysimplegui toolkit and I really like your color-scheme /buttons. Would like to see how you put that all together.
|
||||
|
||||
-----------
|
||||
|
||||
[lucasmartins19](https://github.com/lucasmartins19) 2023-03-14T21:50:57Z
|
||||
Hi!
|
||||
I developed this simple application using PySimpleGUI to help my cousin manage his optics lab.
|
||||
Don't mind the data, it was randomly generated for testing purposes.
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-----------
|
||||
|
||||
[J-Josu](https://github.com/J-Josu) 2023-02-14T12:29:42Z
|
||||
> Thank you @J-Josu  for sharing your program and your story. I love hearing when students use PySimpleGUI! I'm glad it went well. The screenshots look great!
|
||||
>
|
||||
> Code annotation too? Do you have a GitHub Repo with your code?
|
||||
>
|
||||
> I'm impressed by bi-lingual programmers. It's hard enough coding, reading, writing, and thinking just in English. Throwing another language on top of all that is next-level stuff. Really happy you posted what you've made!
|
||||
|
||||
Hi @PySimpleGUI, yes i have uploaded the project to the following [repository](https://github.com/J-Josu/FiguRace)
|
||||
|
||||
Thanks you for all!
|
||||
|
||||
-----------
|
||||
|
||||
[chanon-kr](https://github.com/chanon-kr) 2023-02-14T06:27:10Z
|
||||
Hi, I use PySimpleGUI to make a Simple Object Detection GUI with YOLOv8.
|
||||
|
||||
Check my GitHub repo from this link.
|
||||
|
||||
[Simple Object Detection GUI](https://github.com/chanon-kr/simple_imagui_app)
|
||||
|
||||
And here is a screenshot of the GUI.
|
||||
|
||||

|
||||
|
||||
Thanks to @PySimpleGUI for suggestions and improvement!!
|
||||
|
||||
-----------
|
||||
|
||||
[PySimpleGUI](https://github.com/PySimpleGUI) 2023-02-08T22:16:35Z
|
||||
Thank you @J-Josu  for sharing your program and your story. I love hearing when students use PySimpleGUI! I'm glad it went well. The screenshots look great!
|
||||
|
||||
Code annotation too? Do you have a GitHub Repo with your code?
|
||||
|
||||
I'm impressed by bi-lingual programmers. It's hard enough coding, reading, writing, and thinking just in English. Throwing another language on top of all that is next-level stuff. Really happy you posted what you've made!
|
||||
|
||||
-----------
|
||||
|
||||
[J-Josu](https://github.com/J-Josu) 2023-01-30T13:20:08Z
|
||||
Hi! I'm a stundent of Computer Science in Argentina and i`ve had to do a Final project for my Python Course. The project its about a card game where you can choose between availible themes to try to guess the correct option. The data is automtically loaded from cvs.
|
||||
|
||||
Here are some screenshoots of the final result:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
And other pages...
|
||||
|
||||
All the ui its in spanish, but the code all written in english.
|
||||
The project includes a mini-framework to build pages easly and some cli utilities.
|
||||
Also the code have all the corresponding typing annotations and more interesting stuff.
|
||||
|
||||
-----------
|
||||
|
||||
[PySimpleGUI](https://github.com/PySimpleGUI) 2023-01-29T15:31:26Z
|
||||
@eagleEggs I briefly saw a version of this GUI and then it disappeared. I'm THRILLED you've posted it. 
|
||||
|
||||
Thank you so very much for sharing your talent in using PySimpleGUI. You're such an expert now and I SO appreciate you being here since the early days.
|
||||
|
||||
That's a beautiful window.... just plain beautiful!
|
||||
|
||||
Your support and encouragement have been really appreciated.
|
||||
|
||||

|
||||
|
||||
|
||||
-----------
|
||||
|
||||
[eagleEggs](https://github.com/eagleEggs) 2023-01-28T02:30:37Z
|
||||
PSG WOOOHOOOO. Super fast implementation of this thanks to PSG. We were able to jump straight into core code, and add new things on the fly in minutes. This is a vulnerability management / parser, scanner... and moreeeee.
|
||||
|
||||

|
||||

|
||||
|
||||
Thanks again PSG <3
|
||||
|
||||
-----------
|
||||
|
||||
[hseera](https://github.com/hseera) 2023-01-04T23:30:35Z
|
||||
Using PySimpleGUI framework, I built an opernsource tool called "CloudWatch Dashboard Builder" for SRE, Performance Engineers and Operations teams, who work with AWS services. It gives them capability to build CloudWatch Dashboard from different Namespace templates. The tool lets you modify the template too.
|
||||
|
||||
|
@ -15,14 +392,14 @@ https://www.youtube.com/watch?v=tPCHCc-GiHM
|
|||
|
||||
-----------
|
||||
|
||||
[kubilayyalcinyt](https://github.com/kubilayyalcinyt) 2022-12-18T21:41:57Z
|
||||
[gnuchanos](https://github.com/gnuchanos) 2022-12-18T21:41:57Z
|
||||

|
||||
this is what ı say ı can't do like my tiling manager
|
||||
|
||||
|
||||
-----------
|
||||
|
||||
[kubilayyalcinyt](https://github.com/kubilayyalcinyt) 2022-12-18T21:05:02Z
|
||||
[gnuchanos](https://github.com/gnuchanos) 2022-12-18T21:05:02Z
|
||||
okay ı try example finish ı ask again
|
||||
|
||||
-----------
|
||||
|
@ -32,7 +409,7 @@ okay ı try example finish ı ask again
|
|||
|
||||
-----------
|
||||
|
||||
[kubilayyalcinyt](https://github.com/kubilayyalcinyt) 2022-12-18T19:36:12Z
|
||||
[gnuchanos](https://github.com/gnuchanos) 2022-12-18T19:36:12Z
|
||||

|
||||

|
||||
how ı create like this window first login screen second normal window ı try but ı can't do
|
||||
|
@ -2131,7 +2508,7 @@ Obviously the GUI was the easy part!
|
|||
|
||||
-----------
|
||||
|
||||
[vohe](https://github.com/vohe) 2022-01-23T13:53:09Z
|
||||
[ghost](https://github.com/ghost) 2022-01-23T13:53:09Z
|
||||
The Januar Version is ready to go.
|
||||
I manged it , finally, to work without lastfm. For everyone who can use this:
|
||||
Audiorecorder,, records (e.g.) spotify web player - with free account.
|
||||
|
@ -3028,7 +3405,7 @@ Love all the graphics you're including your GUIs. It adds a level up from the b
|
|||
|
||||
-----------
|
||||
|
||||
[Scania-Creations-16](https://github.com/Scania-Creations-16) 2021-11-04T02:55:59Z
|
||||
[Pranav-P-16](https://github.com/Pranav-P-16) 2021-11-04T02:55:59Z
|
||||
Created a Simple Youtube Downloader using PySimpleGUI :blush:
|
||||
|
||||

|
||||
|
@ -3043,7 +3420,7 @@ Created a Simple Youtube Downloader using PySimpleGUI :blush:
|
|||
|
||||
-----------
|
||||
|
||||
[Scania-Creations-16](https://github.com/Scania-Creations-16) 2021-11-01T04:11:56Z
|
||||
[Pranav-P-16](https://github.com/Pranav-P-16) 2021-11-01T04:11:56Z
|
||||
> You're quite welcome.
|
||||
>
|
||||
> **Thank you** @Scania-Creations-16 for posting your screenshot! Awesome awesome creation! I'm impressed!
|
||||
|
@ -3079,7 +3456,7 @@ I'm sure there are things that others can learn. If you're a beginner, then I'm
|
|||
|
||||
-----------
|
||||
|
||||
[Scania-Creations-16](https://github.com/Scania-Creations-16) 2021-10-31T04:14:25Z
|
||||
[Pranav-P-16](https://github.com/Pranav-P-16) 2021-10-31T04:14:25Z
|
||||
I made a Music Player using PySimpleGUI
|
||||
|
||||
|
||||
|
@ -4254,7 +4631,7 @@ GitHub.com/MOABdali/megaCheckers if anyone wants to try it. Please keep in mind
|
|||
|
||||
-----------
|
||||
|
||||
[vohe](https://github.com/vohe) 2020-08-08T11:11:29Z
|
||||
[ghost](https://github.com/ghost) 2020-08-08T11:11:29Z
|
||||
Ready to go,
|
||||
I found that putting move than 3000 elements in a sg.treedata() structure works, but as i close that there'll be a huge garbage collection of tkinter under the hood.
|
||||
So my directory popup window isn't usable for a 'normal' user directory, especially if the show hidden files option is active.
|
||||
|
@ -4268,7 +4645,7 @@ Have Fun, stay healthy.
|
|||
|
||||
-----------
|
||||
|
||||
[vohe](https://github.com/vohe) 2020-08-05T13:31:05Z
|
||||
[ghost](https://github.com/ghost) 2020-08-05T13:31:05Z
|
||||
In addition to get a Folder Browser running , which does not
|
||||
- show hidden files,
|
||||
- throws errors on Permissions
|
||||
|
@ -4291,7 +4668,7 @@ The bars for each color have the color of the original image and the other-color
|
|||
|
||||
-----------
|
||||
|
||||
[vohe](https://github.com/vohe) 2020-08-02T17:28:23Z
|
||||
[ghost](https://github.com/ghost) 2020-08-02T17:28:23Z
|
||||
Hi folks,
|
||||
here is another one i playing with....
|
||||
The TreeElement is not as flexible as i want it. But many things are possible.
|
||||
|
@ -4301,7 +4678,7 @@ I got the functionallity i want, but the interface isn't that what i like to get
|
|||
|
||||
-----------
|
||||
|
||||
[vohe](https://github.com/vohe) 2020-07-05T16:45:42Z
|
||||
[ghost](https://github.com/ghost) 2020-07-05T16:45:42Z
|
||||
Thank you,
|
||||
first of all i got it as i like (but not so elegant) First of all it works.
|
||||

|
||||
|
@ -4326,7 +4703,7 @@ https://github.com/PySimpleGUI/PySimpleGUI/issues/new?assignees=&labels=&templat
|
|||
|
||||
-----------
|
||||
|
||||
[vohe](https://github.com/vohe) 2020-07-04T21:28:44Z
|
||||
[ghost](https://github.com/ghost) 2020-07-04T21:28:44Z
|
||||
> Very nice @vohe ! Thanks for posting it!
|
||||
> I like they use of tabs. Great , simple layout. I might have to use that idea for settings sometime. It's never dawned on me before to put them into a tab like that.
|
||||
|
||||
|
@ -4343,7 +4720,7 @@ I like they use of tabs. Great , simple layout. I might have to use that idea
|
|||
|
||||
-----------
|
||||
|
||||
[vohe](https://github.com/vohe) 2020-07-04T15:43:31Z
|
||||
[ghost](https://github.com/ghost) 2020-07-04T15:43:31Z
|
||||

|
||||
|
||||
A little Programm, that records files form a webside (actually open.spotify) store them as mp3, tag them, sort them into directorys , notify the user when a new song is beginning.
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
<span style="font-weight: normal;">
|
||||
apply coupon for discount:
|
||||
</span>
|
||||
266B9C51C90B3728782E
|
||||
522B20BF5EF123C4AB30.
|
||||
</div>
|
||||
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=266B9C51C90B3728782E','_blank');">
|
||||
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=522B20BF5EF123C4AB30','_blank');">
|
||||
click here to visit course page
|
||||
</button>
|
||||
</div>
|
||||
|
@ -126,7 +126,7 @@ Parameter Descriptions:
|
|||
| (str, str) or str | mouseover_colors | Important difference between Linux & Windows! Linux - Colors when mouse moved over button. Windows - colors when button is pressed. The default is to switch the text and background colors (an inverse effect) |
|
||||
| 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 |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | If True the return key will cause this button to be pressed |
|
||||
| bool | bind_return_key | If True then pressing the return key in an Input or Multiline Element will cause this button to appear to be clicked (generates event with this button's key |
|
||||
| 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) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -1305,6 +1305,7 @@ Checkbox(text,
|
|||
background_color = None,
|
||||
text_color = None,
|
||||
checkbox_color = None,
|
||||
highlight_thickness = 1,
|
||||
change_submits = False,
|
||||
enable_events = False,
|
||||
disabled = False,
|
||||
|
@ -1333,6 +1334,7 @@ Parameter Descriptions:
|
|||
| str | background_color | color of background |
|
||||
| str | text_color | color of the text |
|
||||
| str | checkbox_color | color of background of the box that has the check mark in it. The checkmark is the same color as the text |
|
||||
| int | highlight_thickness | thickness of border around checkbox when gets focus |
|
||||
| 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 |
|
||||
|
@ -2214,7 +2216,7 @@ Parameter Descriptions:
|
|||
| str | text_color | color of the text |
|
||||
| str | button_background_color | The color of the background of the button on the combo box |
|
||||
| str | button_arrow_color | The color of the arrow on the button on the combo box |
|
||||
| bool | bind_return_key | If True, then the return key will cause a the Combo to generate an event |
|
||||
| bool | bind_return_key | If True, then the return key will cause a the Combo to generate an event when return key is pressed |
|
||||
| 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 | enable_per_char_events | Enables generation of events for every character that's input. This is like the Input element's events |
|
||||
|
@ -2481,7 +2483,9 @@ update(value = None,
|
|||
font = None,
|
||||
visible = None,
|
||||
size = (None, None),
|
||||
select = None)
|
||||
select = None,
|
||||
text_color = None,
|
||||
background_color = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -2497,6 +2501,8 @@ Parameter Descriptions:
|
|||
| bool | visible | control visibility of element |
|
||||
| (int, int) | size | width, height. Width = characters-wide, height = NOTE it's the number of entries to show in the list |
|
||||
| bool | select | if True, then the text will be selected, if False then selection will be cleared |
|
||||
| str | background_color | color of background |
|
||||
| str | text_color | color of the text |
|
||||
|
||||
### visible
|
||||
|
||||
|
@ -2586,7 +2592,9 @@ Update(value = None,
|
|||
font = None,
|
||||
visible = None,
|
||||
size = (None, None),
|
||||
select = None)
|
||||
select = None,
|
||||
text_color = None,
|
||||
background_color = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -2602,6 +2610,8 @@ Parameter Descriptions:
|
|||
| bool | visible | control visibility of element |
|
||||
| (int, int) | size | width, height. Width = characters-wide, height = NOTE it's the number of entries to show in the list |
|
||||
| bool | select | if True, then the text will be selected, if False then selection will be cleared |
|
||||
| str | background_color | color of background |
|
||||
| str | text_color | color of the text |
|
||||
|
||||
---------
|
||||
|
||||
|
@ -4881,6 +4891,8 @@ Input(default_text = "",
|
|||
readonly = False,
|
||||
disabled_readonly_background_color = None,
|
||||
disabled_readonly_text_color = None,
|
||||
selected_text_color = None,
|
||||
selected_background_color = None,
|
||||
expand_x = False,
|
||||
expand_y = False,
|
||||
right_click_menu = None,
|
||||
|
@ -4915,6 +4927,8 @@ Parameter Descriptions:
|
|||
| bool | readonly | If True tkinter state set to 'readonly'. Use this in place of use_readonly_for_disable as another way of achieving readonly. Note cannot set BOTH readonly and disabled as tkinter only supplies a single flag |
|
||||
| str | disabled_readonly_background_color | If state is set to readonly or disabled, the color to use for the background |
|
||||
| str | disabled_readonly_text_color | If state is set to readonly or disabled, the color to use for the text |
|
||||
| str | selected_text_color | Color of text when it is selected (using mouse or control+A, etc) |
|
||||
| str | selected_background_color | Color of background when it is selected (using mouse or control+A, etc) |
|
||||
| bool | expand_x | If True the element will automatically expand in the X direction to fill available space |
|
||||
| bool | expand_y | If True the element will automatically expand in the Y direction to fill available space |
|
||||
| List[List[ List[str] or 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. |
|
||||
|
@ -5096,6 +5110,22 @@ Parameter Descriptions:
|
|||
|--|--|--|
|
||||
| bool | force | if True will call focus_force otherwise calls focus_set |
|
||||
|
||||
### set_ibeam_color
|
||||
|
||||
Sets the color of the I-Beam that is used to "insert" characters. This is oftens called a "Cursor" by
|
||||
many users. To keep from being confused with tkinter's definition of cursor (the mouse pointer), the term
|
||||
ibeam is used in this case.
|
||||
|
||||
```
|
||||
set_ibeam_color(ibeam_color = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| str | ibeam_color | color to set the "I-Beam" used to indicate where characters will be inserted |
|
||||
|
||||
### set_size
|
||||
|
||||
Changes the size of an element to a specific size.
|
||||
|
@ -5359,7 +5389,7 @@ Parameter Descriptions:
|
|||
| [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 |
|
||||
| bool | bind_return_key | If True, then the return key will cause a the Listbox to generate an event when return key is pressed |
|
||||
| (int, int) or (int, None) or int | size | w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1 |
|
||||
| (int, int) or (None, None) or int | s | Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used |
|
||||
| bool | disabled | set disable state for element |
|
||||
|
@ -5553,6 +5583,24 @@ Metadata is an Element property that you can use at any time to hold any value
|
|||
|---|---|---|
|
||||
|(Any)| **return** | the current metadata value |
|
||||
|
||||
### select_index
|
||||
|
||||
Selects an index while providing capability to setting the selected color for the index to specific text/background color
|
||||
|
||||
```
|
||||
select_index(index,
|
||||
highlight_text_color = None,
|
||||
highlight_background_color = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| int | index | specifies which item to change. index starts at 0 and goes to length of values list minus one |
|
||||
| str | highlight_text_color | color of the text when this item is selected. |
|
||||
| str | highlight_background_color | color of the background when this item is selected |
|
||||
|
||||
### set_cursor
|
||||
|
||||
Sets the cursor for the current Element.
|
||||
|
@ -5586,6 +5634,28 @@ Parameter Descriptions:
|
|||
|--|--|--|
|
||||
| bool | force | if True will call focus_force otherwise calls focus_set |
|
||||
|
||||
### set_index_color
|
||||
|
||||
Sets the color of a specific item without selecting it
|
||||
|
||||
```
|
||||
set_index_color(index,
|
||||
text_color = None,
|
||||
background_color = None,
|
||||
highlight_text_color = None,
|
||||
highlight_background_color = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| int | index | specifies which item to change. index starts at 0 and goes to length of values list minus one |
|
||||
| str | text_color | color of the text for this item |
|
||||
| str | background_color | color of the background for this item |
|
||||
| str | highlight_text_color | color of the text when this item is selected. |
|
||||
| str | highlight_background_color | color of the background when this item is selected |
|
||||
|
||||
### set_size
|
||||
|
||||
Changes the size of an element to a specific size.
|
||||
|
@ -6244,12 +6314,15 @@ Multiline(default_text = "",
|
|||
enter_submits = False,
|
||||
disabled = False,
|
||||
autoscroll = False,
|
||||
autoscroll_only_at_bottom = False,
|
||||
border_width = None,
|
||||
size = (None, None),
|
||||
s = (None, None),
|
||||
auto_size_text = None,
|
||||
background_color = None,
|
||||
text_color = None,
|
||||
selected_text_color = None,
|
||||
selected_background_color = None,
|
||||
horizontal_scroll = False,
|
||||
change_submits = False,
|
||||
enable_events = False,
|
||||
|
@ -6293,12 +6366,15 @@ Parameter Descriptions:
|
|||
| 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 |
|
||||
| bool | autoscroll_only_at_bottom | If True the contents of the element will automatically scroll only if the scrollbar is at the bottom of the multiline |
|
||||
| int | border_width | width of border around element in pixels |
|
||||
| (int, int) or (None, None) or int | size | (w, h) w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1 |
|
||||
| (int, int) or (None, None) or int | s | Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used |
|
||||
| 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 |
|
||||
| str | selected_text_color | Color of text when it is selected (using mouse or control+A, etc) |
|
||||
| str | selected_background_color | Color of background when it is selected (using mouse or control+A, etc) |
|
||||
| bool | horizontal_scroll | Controls if a horizontal scrollbar should be shown. If True a horizontal scrollbar will be shown in addition to vertical |
|
||||
| bool | change_submits | DO NOT USE. Only listed for backwards compat - Use enable_events instead |
|
||||
| bool | enable_events | If True then any key press that happens when the element has focus will generate an event. |
|
||||
|
@ -6590,6 +6666,22 @@ Parameter Descriptions:
|
|||
|--|--|--|
|
||||
| bool | force | if True will call focus_force otherwise calls focus_set |
|
||||
|
||||
### set_ibeam_color
|
||||
|
||||
Sets the color of the I-Beam that is used to "insert" characters. This is oftens called a "Cursor" by
|
||||
many users. To keep from being confused with tkinter's definition of cursor (the mouse pointer), the term
|
||||
ibeam is used in this case.
|
||||
|
||||
```
|
||||
set_ibeam_color(ibeam_color = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| str | ibeam_color | color to set the "I-Beam" used to indicate where characters will be inserted |
|
||||
|
||||
### set_size
|
||||
|
||||
Changes the size of an element to a specific size.
|
||||
|
@ -7200,11 +7292,11 @@ Parameter Descriptions:
|
|||
|
||||
---------
|
||||
|
||||
## Output Element (No longer recommended - USE `Multiline` instead)
|
||||
## Output Element
|
||||
|
||||
Rather than use the `Output` element, it's recommended that you use the `Multiline` element instead. The reason for this is that more controls have been added to the Multiline and in the future you can expect more features will be added to the Multiline while the `Output` element has stopped being enhanced.
|
||||
Output Element - a multi-lined text area to where stdout, stderr, cprint are rerouted.
|
||||
|
||||
You can control which Multiline Element receives your stdout output as well as use the color-print (`cprint`) with a Multiline.
|
||||
Now based on the `Multiline` element
|
||||
|
||||
Output Element - a multi-lined text area to where stdout, stderr, cprint are rerouted.
|
||||
|
||||
|
@ -7227,6 +7319,7 @@ Output(size = (None, None),
|
|||
text_color = None,
|
||||
pad = None,
|
||||
p = None,
|
||||
autoscroll_only_at_bottom = False,
|
||||
echo_stdout_stderr = False,
|
||||
font = None,
|
||||
tooltip = None,
|
||||
|
@ -7258,6 +7351,7 @@ Parameter Descriptions:
|
|||
| str | text_color | color of the text |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
| bool | autoscroll_only_at_bottom | If True the contents of the element will automatically scroll only if the scrollbar is at the bottom of the multiline |
|
||||
| bool | echo_stdout_stderr | If True then output to stdout will be output to this element AND also to the normal console location |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
|
@ -8902,7 +8996,7 @@ Parameter Descriptions:
|
|||
|--|--|--|
|
||||
| int | h_pixels | number of horizontal pixels |
|
||||
| int | v_pixels | number of vertical pixels |
|
||||
| (Column) | **RETURN** | (Column) A column element that has a pad setting set according to parameters
|
||||
| (Canvas) | **RETURN** | (Canvas) A canvas element that has a pad setting set according to parameters
|
||||
|
||||
-------
|
||||
|
||||
|
@ -9616,7 +9710,7 @@ Parameter Descriptions:
|
|||
| (int, int) or (None, None) or int | size | (w, h) w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1 |
|
||||
| (int, int) or (None, None) or int | s | Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used |
|
||||
| bool | auto_size_text | if True will size the element to match the length of the text |
|
||||
| bool | bind_return_key | If True, then the return key will cause a the element to generate an event |
|
||||
| bool | bind_return_key | If True, then the return key will cause a the element to generate an event when return key is pressed |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| str | background_color | color of background |
|
||||
| str | text_color | color of the text |
|
||||
|
@ -9809,6 +9903,22 @@ Parameter Descriptions:
|
|||
|--|--|--|
|
||||
| bool | force | if True will call focus_force otherwise calls focus_set |
|
||||
|
||||
### set_ibeam_color
|
||||
|
||||
Sets the color of the I-Beam that is used to "insert" characters. This is oftens called a "Cursor" by
|
||||
many users. To keep from being confused with tkinter's definition of cursor (the mouse pointer), the term
|
||||
ibeam is used in this case.
|
||||
|
||||
```
|
||||
set_ibeam_color(ibeam_color = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| str | ibeam_color | color to set the "I-Beam" used to indicate where characters will be inserted |
|
||||
|
||||
### set_size
|
||||
|
||||
Changes the size of an element to a specific size.
|
||||
|
@ -10980,14 +11090,14 @@ Parameter Descriptions:
|
|||
|
||||
Returns the current value for the Tab Group, which will be the currently selected tab's KEY or the text on
|
||||
the tab if no key is defined. Returns None if an error occurs.
|
||||
Note that this is exactly the same data that would be returned from a call to Window.Read. Are you sure you
|
||||
Note that this is exactly the same data that would be returned from a call to Window.read. Are you sure you
|
||||
are using this method correctly?
|
||||
|
||||
`get()`
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|---|---|---|
|
||||
|Any | None| **return** | The key of the currently selected tab or the tab's text if it has no key |
|
||||
|Any | None| **return** | The key of the currently selected tab or None if there is an error |
|
||||
|
||||
### get_next_focus
|
||||
|
||||
|
@ -11212,14 +11322,14 @@ Parameter Descriptions:
|
|||
|
||||
Returns the current value for the Tab Group, which will be the currently selected tab's KEY or the text on
|
||||
the tab if no key is defined. Returns None if an error occurs.
|
||||
Note that this is exactly the same data that would be returned from a call to Window.Read. Are you sure you
|
||||
Note that this is exactly the same data that would be returned from a call to Window.read. Are you sure you
|
||||
are using this method correctly?
|
||||
|
||||
`Get()`
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|---|---|---|
|
||||
|Any | None| **return** | The key of the currently selected tab or the tab's text if it has no key |
|
||||
|Any | None| **return** | The key of the currently selected tab or None if there is an error |
|
||||
|
||||
### SetFocus
|
||||
|
||||
|
@ -11420,15 +11530,13 @@ Parameter Descriptions:
|
|||
|
||||
### get
|
||||
|
||||
Dummy function for tkinter port. In the Qt port you can read back the values in the table in case they were
|
||||
edited. Don't know yet how to enable editing of a Tree in tkinter so just returning the values provided by
|
||||
user when Table was created or Updated.
|
||||
Get the selected rows using tktiner's selection method. Returns a list of the selected rows.
|
||||
|
||||
`get()`
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|---|---|---|
|
||||
|List[List[Any]]| **return** | the current table values (for now what was originally provided up updated) |
|
||||
|List[int]| **return** | a list of the index of the selected rows (a list of ints) |
|
||||
|
||||
### get_next_focus
|
||||
|
||||
|
@ -11652,15 +11760,13 @@ The following methods are here for backwards compatibility reference. You will
|
|||
|
||||
### Get
|
||||
|
||||
Dummy function for tkinter port. In the Qt port you can read back the values in the table in case they were
|
||||
edited. Don't know yet how to enable editing of a Tree in tkinter so just returning the values provided by
|
||||
user when Table was created or Updated.
|
||||
Get the selected rows using tktiner's selection method. Returns a list of the selected rows.
|
||||
|
||||
`Get()`
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|---|---|---|
|
||||
|List[List[Any]]| **return** | the current table values (for now what was originally provided up updated) |
|
||||
|List[int]| **return** | a list of the index of the selected rows (a list of ints) |
|
||||
|
||||
### SetFocus
|
||||
|
||||
|
@ -12194,6 +12300,7 @@ Tree(data = None,
|
|||
show_expanded = False,
|
||||
change_submits = False,
|
||||
enable_events = False,
|
||||
click_toggles_select = None,
|
||||
font = None,
|
||||
justification = "right",
|
||||
text_color = None,
|
||||
|
@ -12245,6 +12352,7 @@ Parameter Descriptions:
|
|||
| 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 |
|
||||
| bool | click_toggles_select | If True then clicking a row will cause the selection for that row to toggle between selected and deselected |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| str | justification | 'left', 'right', 'center' are valid choices |
|
||||
| str | text_color | color of the text |
|
||||
|
@ -13044,6 +13152,7 @@ Window(title,
|
|||
sbar_arrow_width = None,
|
||||
sbar_frame_color = None,
|
||||
sbar_relief = None,
|
||||
watermark = None,
|
||||
metadata = None)
|
||||
```
|
||||
|
||||
|
@ -13111,6 +13220,7 @@ Parameter Descriptions:
|
|||
| int | sbar_arrow_width | Scrollbar width of the arrow on the scrollbar. It will potentially impact the overall width of the scrollbar |
|
||||
| str | sbar_frame_color | Scrollbar Color of frame around scrollbar (available only on some ttk themes) |
|
||||
| str | sbar_relief | Scrollbar relief that will be used for the "thumb" of the scrollbar (the thing you grab that slides). Should be a constant that is defined at starting with "RELIEF_" - RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID |
|
||||
| bool | watermark | If True, then turns on watermarking temporarily for ALL windows created from this point forward. See global settings doc for more info |
|
||||
| Any | metadata | User metadata that can be set to ANYTHING |
|
||||
|
||||
### add_row
|
||||
|
@ -13615,7 +13725,7 @@ IMPORTANT - This method uses THREADS... this means you CANNOT make any PySimpleG
|
|||
the function you provide with the exception of one function, Window.write_event_value.
|
||||
|
||||
```
|
||||
perform_long_operation(func, end_key)
|
||||
perform_long_operation(func, end_key = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -13623,7 +13733,7 @@ Parameter Descriptions:
|
|||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| Any | func | A lambda or a function name with no parms |
|
||||
| Any | end_key | The key that will be generated when the function returns |
|
||||
| (Any or None) | end_key | Optional key that will be generated when the function returns |
|
||||
| threading.Thread | **RETURN** | The id of the thread
|
||||
|
||||
### read
|
||||
|
@ -13837,7 +13947,7 @@ IMPORTANT - This method uses THREADS... this means you CANNOT make any PySimpleG
|
|||
the function you provide with the exception of one function, Window.write_event_value.
|
||||
|
||||
```
|
||||
start_thread(func, end_key)
|
||||
start_thread(func, end_key = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -13845,9 +13955,63 @@ Parameter Descriptions:
|
|||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| Any | func | A lambda or a function name with no parms |
|
||||
| Any | end_key | The key that will be generated when the function returns |
|
||||
| (Any or None) | end_key | Optional key that will be generated when the function returns |
|
||||
| threading.Thread | **RETURN** | The id of the thread
|
||||
|
||||
### timer_get_active_timers
|
||||
|
||||
Returns a list of currently active timers for a window
|
||||
|
||||
`timer_get_active_timers()`
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|---|---|---|
|
||||
|List[int]| **return** | List of timers for the window |
|
||||
|
||||
### timer_start
|
||||
|
||||
Starts a timer that gnerates Timer Events. The default is to repeat the timer events until timer is stopped.
|
||||
You can provide your own key or a default key will be used. The default key is defined
|
||||
with the constants EVENT_TIMER or TIMER_KEY. They both equal the same value.
|
||||
The values dictionary will contain the timer ID that is returned from this function.
|
||||
|
||||
```
|
||||
timer_start(frequency_ms,
|
||||
key = "__TIMER EVENT__",
|
||||
repeating = True)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| int | frequency_ms | How often to generate timer events in milliseconds |
|
||||
| str or int or tuple or object | key | Key to be returned as the timer event |
|
||||
| bool | repeating | If True then repeat timer events until timer is explicitly stopped |
|
||||
| int | **RETURN** | Timer ID for the timer
|
||||
|
||||
### timer_stop
|
||||
|
||||
Stops a timer with a given ID
|
||||
|
||||
```
|
||||
timer_stop(timer_id)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| int | timer_id | Timer ID of timer to stop |
|
||||
|
||||
### timer_stop_all
|
||||
|
||||
Stops all timers for THIS window
|
||||
|
||||
```python
|
||||
timer_stop_all()
|
||||
```
|
||||
|
||||
### un_hide
|
||||
|
||||
Used to bring back a window that was previously hidden using the Hide method
|
||||
|
@ -14911,7 +15075,7 @@ Parameter Descriptions:
|
|||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -14919,6 +15083,7 @@ Parameter Descriptions:
|
|||
| str or int or tuple or object | k | Same as the Key. You can use either k or key. Which ever is set will be used. |
|
||||
| str | locale | defines the locale used to get day names |
|
||||
| str | format | formats result using this strftime format |
|
||||
| int | begin_at_sunday_plus | Determines the left-most day in the display. 0=sunday, 1=monday, etc |
|
||||
| List[str] | month_names | optional list of month names to use (should be 12 items) |
|
||||
| List[str] | day_abbreviations | optional list of abbreviations to display as the day of week |
|
||||
| str | title | Title shown on the date chooser window |
|
||||
|
@ -14963,7 +15128,7 @@ Parameter Descriptions:
|
|||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15021,7 +15186,7 @@ Parameter Descriptions:
|
|||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| 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) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15072,7 +15237,7 @@ Parameter Descriptions:
|
|||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15134,7 +15299,7 @@ Parameter Descriptions:
|
|||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15179,7 +15344,7 @@ Parameter Descriptions:
|
|||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15432,7 +15597,7 @@ Parameter Descriptions:
|
|||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15520,7 +15685,7 @@ Parameter Descriptions:
|
|||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| bool | bind_return_key | (Default = True) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| idk_yetReally | focus | if focus should be set to this |
|
||||
|
@ -15565,7 +15730,7 @@ Parameter Descriptions:
|
|||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| bool | bind_return_key | (Default = True) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| idk_yetReally | focus | if focus should be set to this |
|
||||
|
@ -15610,7 +15775,7 @@ Parameter Descriptions:
|
|||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| bool | bind_return_key | (Default = True) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| idk_yetReally | focus | if focus should be set to this |
|
||||
|
@ -15657,7 +15822,7 @@ Parameter Descriptions:
|
|||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15712,7 +15877,7 @@ Parameter Descriptions:
|
|||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15754,7 +15919,7 @@ Parameter Descriptions:
|
|||
| (int, int) or (None, None) or int | s | Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used |
|
||||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| bool | bind_return_key | (Default = True) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
|
@ -15852,7 +16017,7 @@ Parameter Descriptions:
|
|||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| bool | bind_return_key | (Default = True) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| idk_yetReally | focus | if focus should be set to this |
|
||||
|
@ -15899,7 +16064,7 @@ Parameter Descriptions:
|
|||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = True) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15956,7 +16121,7 @@ Parameter Descriptions:
|
|||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| idk_yetReally | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
|
@ -16009,7 +16174,7 @@ Parameter Descriptions:
|
|||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| idk_yetReally | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
|
@ -16067,7 +16232,7 @@ Parameter Descriptions:
|
|||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| idk_yetReally | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
|
@ -16124,7 +16289,7 @@ Parameter Descriptions:
|
|||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| idk_yetReally | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
|
@ -16571,11 +16736,11 @@ Parameter Descriptions:
|
|||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| str | title | text to display in eleemnt |
|
||||
| str | title | text to display in titlebar of window |
|
||||
| int | current_value | current value |
|
||||
| int | max_value | max value of QuickMeter |
|
||||
| Any | *args | stuff to output |
|
||||
| str or int or tuple or object | key | Used to differentiate between mutliple meters. Used to cancel meter early. Now optional as there is a default value for single meters |
|
||||
| int | max_value | max value of progress meter |
|
||||
| Any | *args | stuff to output as text in the window along with the meter |
|
||||
| str or int or tuple or object | key | Used to differentiate between multiple meters. Used to cancel meter early. Now optional as there is a default value for single meters |
|
||||
| str | orientation | 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical' / 'v') |
|
||||
| (str, str) or str | bar_color | The 2 colors that make up a progress bar. Either a tuple of 2 strings or a string. Tuple - (bar, background). A string with 1 color changes the background of the bar only. A string with 2 colors separated by "on" like "red on blue" specifies a red bar on a blue background. |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
|
@ -16625,11 +16790,11 @@ Parameter Descriptions:
|
|||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| str | title | text to display in eleemnt |
|
||||
| str | title | text to display in titlebar of window |
|
||||
| int | current_value | current value |
|
||||
| int | max_value | max value of QuickMeter |
|
||||
| Any | *args | stuff to output |
|
||||
| str or int or tuple or object | key | Used to differentiate between mutliple meters. Used to cancel meter early. Now optional as there is a default value for single meters |
|
||||
| int | max_value | max value of progress meter |
|
||||
| Any | *args | stuff to output as text in the window along with the meter |
|
||||
| str or int or tuple or object | key | Used to differentiate between multiple meters. Used to cancel meter early. Now optional as there is a default value for single meters |
|
||||
| str | orientation | 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical' / 'v') |
|
||||
| (str, str) or str | bar_color | The 2 colors that make up a progress bar. Either a tuple of 2 strings or a string. Tuple - (bar, background). A string with 1 color changes the background of the bar only. A string with 2 colors separated by "on" like "red on blue" specifies a red bar on a blue background. |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
|
@ -16738,7 +16903,8 @@ popup_animated(image_source,
|
|||
time_between_frames = 0,
|
||||
transparent_color = None,
|
||||
title = "",
|
||||
icon = None)
|
||||
icon = None,
|
||||
no_buffering = False)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -16760,6 +16926,7 @@ Parameter Descriptions:
|
|||
| 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 |
|
||||
| str or bytes | icon | Same as Window icon parameter. Can be either a filename or Base64 byte string. For Windows if filename, it MUST be ICO format. For Linux, must NOT be ICO |
|
||||
| bool | no_buffering | If True then no buffering will be used for the GIF. May work better if you have a large animation |
|
||||
| bool | **RETURN** | True if the window updated OK. False if the window was closed
|
||||
|
||||
Popup that closes itself after some time period
|
||||
|
@ -16942,6 +17109,9 @@ popup_get_date(start_mon = None,
|
|||
locale = None,
|
||||
month_names = None,
|
||||
day_abbreviations = None,
|
||||
day_font = "TkFixedFont 9",
|
||||
mon_year_font = "TkFixedFont 10",
|
||||
arrow_font = "TkFixedFont 7",
|
||||
modal = True)
|
||||
```
|
||||
|
||||
|
@ -16963,6 +17133,9 @@ Parameter Descriptions:
|
|||
| bool | keep_on_top | If True the window will remain above all current windows |
|
||||
| List[str] | month_names | optional list of month names to use (should be 12 items) |
|
||||
| List[str] | day_abbreviations | optional list of abbreviations to display as the day of week |
|
||||
| str or tuple | day_font | Font and size to use for the calendar |
|
||||
| str or tuple | mon_year_font | Font and size to use for the month and year at the top |
|
||||
| str or tuple | arrow_font | Font and size to use for the arrow buttons |
|
||||
| bool | modal | If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True |
|
||||
| None or (int, int, int) | **RETURN** | Tuple containing (month, day, year) of chosen date or None if was cancelled
|
||||
|
||||
|
@ -17816,7 +17989,8 @@ PopupAnimated(image_source,
|
|||
time_between_frames = 0,
|
||||
transparent_color = None,
|
||||
title = "",
|
||||
icon = None)
|
||||
icon = None,
|
||||
no_buffering = False)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -17838,6 +18012,7 @@ Parameter Descriptions:
|
|||
| 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 |
|
||||
| str or bytes | icon | Same as Window icon parameter. Can be either a filename or Base64 byte string. For Windows if filename, it MUST be ICO format. For Linux, must NOT be ICO |
|
||||
| bool | no_buffering | If True then no buffering will be used for the GIF. May work better if you have a large animation |
|
||||
| bool | **RETURN** | True if the window updated OK. False if the window was closed
|
||||
|
||||
Display a Popup without a titlebar. Enables grab anywhere so you can move it
|
||||
|
@ -19704,7 +19879,7 @@ Parameter Descriptions:
|
|||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| str | command | Filename to load settings from (and save to in the future) |
|
||||
| str | command | The command/file to execute. What you would type at a console to run a program or shell command. |
|
||||
| Any | *args | Variable number of arguments that are passed to the program being started as command line parms |
|
||||
| bool | wait | If True then wait for the subprocess to finish |
|
||||
| str | cwd | Working directory to use when executing the subprocess |
|
||||
|
@ -19960,7 +20135,8 @@ set_options(icon = None,
|
|||
sbar_relief = None,
|
||||
alpha_channel = None,
|
||||
hide_window_when_creating = None,
|
||||
use_button_shortcuts = None)
|
||||
use_button_shortcuts = None,
|
||||
watermark_text = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -20033,6 +20209,7 @@ Parameter Descriptions:
|
|||
| float | alpha_channel | Default alpha channel to be used on all windows |
|
||||
| bool | hide_window_when_creating | If True then alpha will be set to 0 while a window is made and moved to location indicated |
|
||||
| bool | use_button_shortcuts | If True then Shortcut Char will be used with Buttons |
|
||||
| str | watermark_text | Set the text that will be used if a window is watermarked |
|
||||
| None | **RETURN** | None
|
||||
|
||||
### Non PEP8 versions
|
||||
|
@ -20116,7 +20293,8 @@ SetOptions(icon = None,
|
|||
sbar_relief = None,
|
||||
alpha_channel = None,
|
||||
hide_window_when_creating = None,
|
||||
use_button_shortcuts = None)
|
||||
use_button_shortcuts = None,
|
||||
watermark_text = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -20189,6 +20367,7 @@ Parameter Descriptions:
|
|||
| float | alpha_channel | Default alpha channel to be used on all windows |
|
||||
| bool | hide_window_when_creating | If True then alpha will be set to 0 while a window is made and moved to location indicated |
|
||||
| bool | use_button_shortcuts | If True then Shortcut Char will be used with Buttons |
|
||||
| str | watermark_text | Set the text that will be used if a window is watermarked |
|
||||
| None | **RETURN** | None
|
||||
|
||||
## Old Themes (Look and Feel) - Replaced by theme()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div style="display: flex; gap: 50px; justify-content: center;">
|
||||
<div>
|
||||
<img src="https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/master/images/for_readme/Logo%20with%20text%20for%20GitHub%20Top.png" alt="Python GUIs for Humans">
|
||||
<h1 style="text-align: center;">Python GUIs for Humans</h1>
|
||||
<img src="https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/master/images/for_readme/Logo%20with%20text%20for%20GitHub%20Top.png" alt="User Interfaces for Humans">
|
||||
<h1 style="text-align: center;">User Interfaces for Humans<sup>TM</sup></h1>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
|
@ -25,9 +25,9 @@
|
|||
<span style="font-weight: normal;">
|
||||
apply coupon for discount:
|
||||
</span>
|
||||
266B9C51C90B3728782E
|
||||
522B20BF5EF123C4AB30
|
||||
</div>
|
||||
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=266B9C51C90B3728782E','_blank');">
|
||||
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=522B20BF5EF123C4AB30','_blank');">
|
||||
click here to visit course page
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div style="display: flex; gap: 50px; justify-content: center;">
|
||||
<div>
|
||||
<img src="https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/master/images/for_readme/Logo%20with%20text%20for%20GitHub%20Top.png" alt="Python GUIs for Humans">
|
||||
<h1 style="text-align: center;">Python GUIs for Humans</h1>
|
||||
<img src="https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/master/images/for_readme/Logo%20with%20text%20for%20GitHub%20Top.png" alt="User Interfaces for Humans">
|
||||
<h1 style="text-align: center;">User Interfaces for Humans<sup>TM</sup></h1>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
|
@ -25,9 +25,9 @@
|
|||
<span style="font-weight: normal;">
|
||||
apply coupon for discount:
|
||||
</span>
|
||||
266B9C51C90B3728782E
|
||||
522B20BF5EF123C4AB30
|
||||
</div>
|
||||
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=266B9C51C90B3728782E','_blank');">
|
||||
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=522B20BF5EF123C4AB30','_blank');">
|
||||
click here to visit course page
|
||||
</button>
|
||||
</div>
|
||||
|
@ -57,7 +57,7 @@
|
|||
|
||||
# PySimpleGUI User's Manual
|
||||
|
||||
## Python GUI For Humans - Transforms tkinter, Qt, Remi, WxPython into portable people-friendly Pythonic interfaces
|
||||
## User Interfaces for Humans - Transforms tkinter, Qt, Remi, WxPython into portable people-friendly Pythonic interfaces
|
||||
|
||||
## <span>The Call Reference Section Moved to <a href="https://pysimplegui.readthedocs.io/en/latest/call%20reference/">here</a></span>
|
||||
|
||||
|
@ -2028,7 +2028,8 @@ popup_animated(image_source,
|
|||
time_between_frames = 0,
|
||||
transparent_color = None,
|
||||
title = "",
|
||||
icon = None)
|
||||
icon = None,
|
||||
no_buffering = False)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -2050,6 +2051,7 @@ Parameter Descriptions:
|
|||
| 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 |
|
||||
| str or bytes | icon | Same as Window icon parameter. Can be either a filename or Base64 byte string. For Windows if filename, it MUST be ICO format. For Linux, must NOT be ICO |
|
||||
| bool | no_buffering | If True then no buffering will be used for the GIF. May work better if you have a large animation |
|
||||
| bool | **RETURN** | True if the window updated OK. False if the window was closed
|
||||
|
||||
***To close animated popups***, call PopupAnimated with `image_source=None`. This will close all of the currently open PopupAnimated windows.
|
||||
|
@ -2078,11 +2080,11 @@ Parameter Descriptions:
|
|||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| str | title | text to display in eleemnt |
|
||||
| str | title | text to display in titlebar of window |
|
||||
| int | current_value | current value |
|
||||
| int | max_value | max value of QuickMeter |
|
||||
| Any | *args | stuff to output |
|
||||
| str or int or tuple or object | key | Used to differentiate between mutliple meters. Used to cancel meter early. Now optional as there is a default value for single meters |
|
||||
| int | max_value | max value of progress meter |
|
||||
| Any | *args | stuff to output as text in the window along with the meter |
|
||||
| str or int or tuple or object | key | Used to differentiate between multiple meters. Used to cancel meter early. Now optional as there is a default value for single meters |
|
||||
| str | orientation | 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical' / 'v') |
|
||||
| (str, str) or str | bar_color | The 2 colors that make up a progress bar. Either a tuple of 2 strings or a string. Tuple - (bar, background). A string with 1 color changes the background of the bar only. A string with 2 colors separated by "on" like "red on blue" specifies a red bar on a blue background. |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
|
@ -7112,12 +7114,54 @@ There are a number of demo programs that show how to use UserSettings to create
|
|||
|
||||
If you're using the default path, remember that previous runs of your file may have old settings that are still in your settings file. It can get confusing when you've forgotten that you previously wrote a setting. Not seeing the filename can have drawbacks like this.
|
||||
|
||||
Also, because the settings automatically save after every update, it can be easy to accidently overwrite a previously saved setting. If you want to avoid this, then perhaps it's best that you work with a dictionary within your code and then explicitly save your dictionary when you're ready to commit it to disk.
|
||||
Also, because the settings automatically save after every update, it can be easy to accidentally overwrite a previously saved setting. If you want to avoid this, then perhaps it's best that you work with a dictionary within your code and then explicitly save your dictionary when you're ready to commit it to disk.
|
||||
|
||||
To save your Python dictionary to a settings file, simply call `user_settings_write_new_dictionary(dict)`, passing in your dictionary as the parameter.
|
||||
|
||||
-------------------------
|
||||
|
||||
# Timer API
|
||||
|
||||
The Timer API calls are in version 4.61.0 that is currently only available on the PySimpleGUI GitHub. It has not been released to PyPI yet.
|
||||
|
||||
## Do Not Use Sleeps In Your Event Loop...
|
||||
|
||||
Instead of sleeping, you can request that an event be generated after some period of time. If you need to "Sleep for 3 seconds" as part of some operation, instead schedule a timer for 3 seconds. Your `window.read` call will return a value of `sg.TIMER_KEY` or `sg.EVENT_TIMER` (they are aliases and thus have the same value).
|
||||
|
||||
## Timer API Calls
|
||||
|
||||
These are the API calls that you'll use to manage timers:
|
||||
|
||||
`window.timer_start` starts a timer
|
||||
|
||||
`window.timer_stop` stops a single timer
|
||||
|
||||
`window.timer_stop_all` stops all timers
|
||||
|
||||
`window.timer_get_active_timers` returns a list of active timer IDs
|
||||
|
||||
Example - start a 3 second timer that does not repeat:
|
||||
|
||||
```python
|
||||
window.timer_start(3000, repeating=False) # start a 3-second timer
|
||||
```
|
||||
|
||||
When this timer expires, you'll get an event `sg.EVENT_TIMER`. If you want to specify your own key to be returned, then use the `key` parameter:
|
||||
|
||||
```python
|
||||
window.timer_start(3000, key='-MY TIMER KEY-', repeating=False)
|
||||
```
|
||||
|
||||
See the call reference for the details of each call.
|
||||
|
||||
## Timer Demo Programs
|
||||
|
||||
Using the PySimpleGUI Demo Browser, search for `window.timer_` to find Demo Programs that use the Timer API calls.
|
||||
|
||||
The program `Demo_WindowTimer.py` demonstrates both repeating and non-repeating timers as well as using custom keys. It's a simple set of API calls to use and the docstrings in combination with the Demo Programs should give you all you need to start using this capability.
|
||||
|
||||
---------------------------
|
||||
|
||||
# Extending PySimpleGUI
|
||||
|
||||
PySimpleGUI doesn't and can't provide every single setting available in the underlying GUI framework. Not all tkinter options are available for a `Text` Element. Same with PySimpleGUIQt and the other ports.
|
||||
|
@ -10092,6 +10136,22 @@ Test Harness and Settings Windows fit on small screens better
|
|||
* Emergency Patch Release for Mac OS 12.3 and greater
|
||||
* Fixed bug in Mac OS version check in yesterday's 4.60.2 release
|
||||
|
||||
## 4.60.4 PySimpleGUI 10-Oct-2022
|
||||
|
||||
* Dot release to quickly fix the Trinket detection which stopped working recently
|
||||
|
||||
## 4.60.5 PySimpleGUI 21-May-2023
|
||||
|
||||
* Mac fixes
|
||||
* Fix for Input Element not working in no-titlebar windows on MacOs 13.2.1
|
||||
* Change to the 0.99 Alpha fix made in 4.60.2. Now only applies patch when running on 8.6.12, regardless of Mac Control Panel setting in PySimpleGUI Global Settings. Removes the need for users to disable when upgrading tkinter.
|
||||
* Added Intelligent Upgrade Service - inform users when there are releases of PySimpleGUI that fix a problem that may be unique to their combination of components
|
||||
* Change to GitHub Issue GUI
|
||||
* Added checkbox for checking if running latest PyPI version
|
||||
* Recommended using Demo Browser to search Demo Programs
|
||||
* Use platform module to fill in the OS information field
|
||||
* SDK Help Window - changed all readthedocs links to use the PySimpleGUI.org hostname for better portability
|
||||
|
||||
## Code Condition
|
||||
|
||||
Make it run
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/master/images/for_readme/Logo%20with%20text%20for%20GitHub%20Top.png" alt="Python GUIs for Humans">
|
||||
<h2 align="center">Python GUIs for Humans</h2>
|
||||
<img src="https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/master/images/for_readme/Logo%20with%20text%20for%20GitHub%20Top.png" alt="User Interfaces for Humans">
|
||||
<h2 align="center">User Interfaces for Humans<sup>TM</sup></h2>
|
||||
</p>
|
||||
|
||||
<table>
|
||||
|
@ -9,8 +9,8 @@
|
|||
<img src="https://www.dropbox.com/s/6wzf3ebmj97v4zs/PySimpleGUI-GitHub-Udemy-Course.png?raw=1" width=200 alt="PySimpleGUI Udemy Course">
|
||||
</td>
|
||||
<td>
|
||||
<h5>apply coupon for discount:<br>266B9C51C90B3728782E</h6>
|
||||
<a href="https://www.udemy.com/course/pysimplegui/?couponCode=266B9C51C90B3728782E">click here to visit course page</a>
|
||||
<h5>apply coupon for discount:<br>522B20BF5EF123C4AB30</h6>
|
||||
<a href="https://www.udemy.com/course/pysimplegui/?couponCode=522B20BF5EF123C4AB30">click here to visit course page</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/master/images/for_readme/Logo%20with%20text%20for%20GitHub%20Top.png" alt="Python GUIs for Humans">
|
||||
<h2 align="center">Python GUIs for Humans</h2>
|
||||
<img src="https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/master/images/for_readme/Logo%20with%20text%20for%20GitHub%20Top.png" alt="User Interfaces for Humans">
|
||||
<h2 align="center">User Interfaces for Humans<sup>TM</sup></h2>
|
||||
</p>
|
||||
|
||||
<table>
|
||||
|
@ -9,8 +9,8 @@
|
|||
<img src="https://www.dropbox.com/s/6wzf3ebmj97v4zs/PySimpleGUI-GitHub-Udemy-Course.png?raw=1" width=200 alt="PySimpleGUI Udemy Course">
|
||||
</td>
|
||||
<td>
|
||||
<h5>apply coupon for discount:<br>266B9C51C90B3728782E</h6>
|
||||
<a href="https://www.udemy.com/course/pysimplegui/?couponCode=266B9C51C90B3728782E">click here to visit course page</a>
|
||||
<h5>apply coupon for discount:<br>522B20BF5EF123C4AB30</h6>
|
||||
<a href="https://www.udemy.com/course/pysimplegui/?couponCode=522B20BF5EF123C4AB30">click here to visit course page</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -27,8 +27,8 @@ HOW DO I INSERT IMAGES ???
|
|||
|
||||
<div style="display: flex; gap: 50px; justify-content: center;">
|
||||
<div>
|
||||
<img src="https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/master/images/for_readme/Logo%20with%20text%20for%20GitHub%20Top.png" alt="Python GUIs for Humans">
|
||||
<h1 style="text-align: center;">Python GUIs for Humans</h1>
|
||||
<img src="https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/master/images/for_readme/Logo%20with%20text%20for%20GitHub%20Top.png" alt="User Interfaces for Humans">
|
||||
<h1 style="text-align: center;">User Interfaces for Humans<sup>TM</sup></h1>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
|
@ -52,9 +52,9 @@ HOW DO I INSERT IMAGES ???
|
|||
<span style="font-weight: normal;">
|
||||
apply coupon for discount:
|
||||
</span>
|
||||
266B9C51C90B3728782E
|
||||
522B20BF5EF123C4AB30
|
||||
</div>
|
||||
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=266B9C51C90B3728782E','_blank');">
|
||||
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=522B20BF5EF123C4AB30','_blank');">
|
||||
click here to visit course page
|
||||
</button>
|
||||
</div>
|
||||
|
@ -96,7 +96,7 @@ HOW DO I INSERT IMAGES ???
|
|||
# PySimpleGUI User's Manual
|
||||
|
||||
|
||||
## Python GUI For Humans - Transforms tkinter, Qt, Remi, WxPython into portable people-friendly Pythonic interfaces
|
||||
## User Interfaces for Humans - Transforms tkinter, Qt, Remi, WxPython into portable people-friendly Pythonic interfaces
|
||||
|
||||
## <span>The Call Reference Section Moved to <a href="https://pysimplegui.readthedocs.io/en/latest/call%20reference/">here</a></span>
|
||||
|
||||
|
|
|
@ -5574,13 +5574,60 @@ There are a number of demo programs that show how to use UserSettings to create
|
|||
|
||||
If you're using the default path, remember that previous runs of your file may have old settings that are still in your settings file. It can get confusing when you've forgotten that you previously wrote a setting. Not seeing the filename can have drawbacks like this.
|
||||
|
||||
Also, because the settings automatically save after every update, it can be easy to accidently overwrite a previously saved setting. If you want to avoid this, then perhaps it's best that you work with a dictionary within your code and then explicitly save your dictionary when you're ready to commit it to disk.
|
||||
Also, because the settings automatically save after every update, it can be easy to accidentally overwrite a previously saved setting. If you want to avoid this, then perhaps it's best that you work with a dictionary within your code and then explicitly save your dictionary when you're ready to commit it to disk.
|
||||
|
||||
To save your Python dictionary to a settings file, simply call `user_settings_write_new_dictionary(dict)`, passing in your dictionary as the parameter.
|
||||
|
||||
|
||||
-------------------------
|
||||
|
||||
# Timer API
|
||||
|
||||
The Timer API calls are in version 4.61.0 that is currently only available on the PySimpleGUI GitHub. It has not been released to PyPI yet.
|
||||
|
||||
## Do Not Use Sleeps In Your Event Loop...
|
||||
|
||||
Instead of sleeping, you can request that an event be generated after some period of time. If you need to "Sleep for 3 seconds" as part of some operation, instead schedule a timer for 3 seconds. Your `window.read` call will return a value of `sg.TIMER_KEY` or `sg.EVENT_TIMER` (they are aliases and thus have the same value).
|
||||
|
||||
|
||||
## Timer API Calls
|
||||
|
||||
These are the API calls that you'll use to manage timers:
|
||||
|
||||
|
||||
`window.timer_start` starts a timer
|
||||
|
||||
`window.timer_stop` stops a single timer
|
||||
|
||||
`window.timer_stop_all` stops all timers
|
||||
|
||||
`window.timer_get_active_timers` returns a list of active timer IDs
|
||||
|
||||
Example - start a 3 second timer that does not repeat:
|
||||
|
||||
```python
|
||||
window.timer_start(3000, repeating=False) # start a 3-second timer
|
||||
```
|
||||
|
||||
When this timer expires, you'll get an event `sg.EVENT_TIMER`. If you want to specify your own key to be returned, then use the `key` parameter:
|
||||
|
||||
```python
|
||||
window.timer_start(3000, key='-MY TIMER KEY-', repeating=False)
|
||||
```
|
||||
|
||||
|
||||
See the call reference for the details of each call.
|
||||
|
||||
## Timer Demo Programs
|
||||
|
||||
Using the PySimpleGUI Demo Browser, search for `window.timer_` to find Demo Programs that use the Timer API calls.
|
||||
|
||||
The program `Demo_WindowTimer.py` demonstrates both repeating and non-repeating timers as well as using custom keys. It's a simple set of API calls to use and the docstrings in combination with the Demo Programs should give you all you need to start using this capability.
|
||||
|
||||
|
||||
|
||||
---------------------------
|
||||
|
||||
|
||||
# Extending PySimpleGUI
|
||||
|
||||
|
|
|
@ -2590,6 +2590,25 @@ Test Harness and Settings Windows fit on small screens better
|
|||
* Emergency Patch Release for Mac OS 12.3 and greater
|
||||
* Fixed bug in Mac OS version check in yesterday's 4.60.2 release
|
||||
|
||||
## 4.60.4 PySimpleGUI 10-Oct-2022
|
||||
|
||||
* Dot release to quickly fix the Trinket detection which stopped working recently
|
||||
|
||||
|
||||
## 4.60.5 PySimpleGUI 21-May-2023
|
||||
|
||||
* Mac fixes
|
||||
* Fix for Input Element not working in no-titlebar windows on MacOs 13.2.1
|
||||
* Change to the 0.99 Alpha fix made in 4.60.2. Now only applies patch when running on 8.6.12, regardless of Mac Control Panel setting in PySimpleGUI Global Settings. Removes the need for users to disable when upgrading tkinter.
|
||||
* Added Intelligent Upgrade Service - inform users when there are releases of PySimpleGUI that fix a problem that may be unique to their combination of components
|
||||
* Change to GitHub Issue GUI
|
||||
* Added checkbox for checking if running latest PyPI version
|
||||
* Recommended using Demo Browser to search Demo Programs
|
||||
* Use platform module to fill in the OS information field
|
||||
* SDK Help Window - changed all readthedocs links to use the PySimpleGUI.org hostname for better portability
|
||||
|
||||
|
||||
|
||||
|
||||
## Code Condition
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
<span style="font-weight: normal;">
|
||||
apply coupon for discount:
|
||||
</span>
|
||||
266B9C51C90B3728782E
|
||||
522B20BF5EF123C4AB30.
|
||||
</div>
|
||||
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=266B9C51C90B3728782E','_blank');">
|
||||
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=522B20BF5EF123C4AB30','_blank');">
|
||||
click here to visit course page
|
||||
</button>
|
||||
</div>
|
||||
|
@ -1111,6 +1111,9 @@ The following methods are here for backwards compatibility reference. You will
|
|||
### set_focus
|
||||
<!-- <+Input.set_focus+> -->
|
||||
|
||||
### set_ibeam_color
|
||||
<!-- <+Input.set_ibeam_color+> -->
|
||||
|
||||
### set_size
|
||||
<!-- <+Input.set_size+> -->
|
||||
|
||||
|
@ -1204,12 +1207,18 @@ The following methods are here for backwards compatibility reference. You will
|
|||
### metadata
|
||||
<!-- <+Listbox.metadata+> -->
|
||||
|
||||
### select_index
|
||||
<!-- <+Listbox.select_index+> -->
|
||||
|
||||
### set_cursor
|
||||
<!-- <+Listbox.set_cursor+> -->
|
||||
|
||||
### set_focus
|
||||
<!-- <+Listbox.set_focus+> -->
|
||||
|
||||
### set_index_color
|
||||
<!-- <+Listbox.set_index_color+> -->
|
||||
|
||||
### set_size
|
||||
<!-- <+Listbox.set_size+> -->
|
||||
|
||||
|
@ -1421,6 +1430,9 @@ See the Column element to get a list of method calls available. The function re
|
|||
### set_focus
|
||||
<!-- <+Multiline.set_focus+> -->
|
||||
|
||||
### set_ibeam_color
|
||||
<!-- <+Input.set_ibeam_color+> -->
|
||||
|
||||
### set_size
|
||||
<!-- <+Multiline.set_size+> -->
|
||||
|
||||
|
@ -1557,11 +1569,11 @@ The following methods are here for backwards compatibility reference. You will
|
|||
---------
|
||||
|
||||
|
||||
## Output Element (No longer recommended - USE `Multiline` instead)
|
||||
## Output Element
|
||||
|
||||
Rather than use the `Output` element, it's recommended that you use the `Multiline` element instead. The reason for this is that more controls have been added to the Multiline and in the future you can expect more features will be added to the Multiline while the `Output` element has stopped being enhanced.
|
||||
Output Element - a multi-lined text area to where stdout, stderr, cprint are rerouted.
|
||||
|
||||
You can control which Multiline Element receives your stdout output as well as use the color-print (`cprint`) with a Multiline.
|
||||
Now based on the `Multiline` element
|
||||
|
||||
<!-- <+Output.doc+> -->
|
||||
<!-- <+Output.__init__+> -->
|
||||
|
@ -2162,6 +2174,9 @@ The following methods are here for backwards compatibility reference. You will
|
|||
### set_focus
|
||||
<!-- <+Spin.set_focus+> -->
|
||||
|
||||
### set_ibeam_color
|
||||
<!-- <+Input.set_ibeam_color+> -->
|
||||
|
||||
### set_size
|
||||
<!-- <+Spin.set_size+> -->
|
||||
|
||||
|
@ -3040,6 +3055,18 @@ Example: If first row has a `VPush`, then your layout will be At the bottom of
|
|||
### start_thread
|
||||
<!-- <+Window.start_thread+> -->
|
||||
|
||||
### timer_get_active_timers
|
||||
<!-- <+Window.timer_get_active_timers+> -->
|
||||
|
||||
### timer_start
|
||||
<!-- <+Window.timer_start+> -->
|
||||
|
||||
### timer_stop
|
||||
<!-- <+Window.timer_stop+> -->
|
||||
|
||||
### timer_stop_all
|
||||
<!-- <+Window.timer_stop_all+> -->
|
||||
|
||||
### un_hide
|
||||
<!-- <+Window.un_hide+> -->
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
<span style="font-weight: normal;">
|
||||
apply coupon for discount:
|
||||
</span>
|
||||
266B9C51C90B3728782E
|
||||
522B20BF5EF123C4AB30.
|
||||
</div>
|
||||
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=266B9C51C90B3728782E','_blank');">
|
||||
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=522B20BF5EF123C4AB30','_blank');">
|
||||
click here to visit course page
|
||||
</button>
|
||||
</div>
|
||||
|
@ -126,7 +126,7 @@ Parameter Descriptions:
|
|||
| (str, str) or str | mouseover_colors | Important difference between Linux & Windows! Linux - Colors when mouse moved over button. Windows - colors when button is pressed. The default is to switch the text and background colors (an inverse effect) |
|
||||
| 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 |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | If True the return key will cause this button to be pressed |
|
||||
| bool | bind_return_key | If True then pressing the return key in an Input or Multiline Element will cause this button to appear to be clicked (generates event with this button's key |
|
||||
| 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) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -1305,6 +1305,7 @@ Checkbox(text,
|
|||
background_color = None,
|
||||
text_color = None,
|
||||
checkbox_color = None,
|
||||
highlight_thickness = 1,
|
||||
change_submits = False,
|
||||
enable_events = False,
|
||||
disabled = False,
|
||||
|
@ -1333,6 +1334,7 @@ Parameter Descriptions:
|
|||
| str | background_color | color of background |
|
||||
| str | text_color | color of the text |
|
||||
| str | checkbox_color | color of background of the box that has the check mark in it. The checkmark is the same color as the text |
|
||||
| int | highlight_thickness | thickness of border around checkbox when gets focus |
|
||||
| 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 |
|
||||
|
@ -2214,7 +2216,7 @@ Parameter Descriptions:
|
|||
| str | text_color | color of the text |
|
||||
| str | button_background_color | The color of the background of the button on the combo box |
|
||||
| str | button_arrow_color | The color of the arrow on the button on the combo box |
|
||||
| bool | bind_return_key | If True, then the return key will cause a the Combo to generate an event |
|
||||
| bool | bind_return_key | If True, then the return key will cause a the Combo to generate an event when return key is pressed |
|
||||
| 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 | enable_per_char_events | Enables generation of events for every character that's input. This is like the Input element's events |
|
||||
|
@ -2481,7 +2483,9 @@ update(value = None,
|
|||
font = None,
|
||||
visible = None,
|
||||
size = (None, None),
|
||||
select = None)
|
||||
select = None,
|
||||
text_color = None,
|
||||
background_color = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -2497,6 +2501,8 @@ Parameter Descriptions:
|
|||
| bool | visible | control visibility of element |
|
||||
| (int, int) | size | width, height. Width = characters-wide, height = NOTE it's the number of entries to show in the list |
|
||||
| bool | select | if True, then the text will be selected, if False then selection will be cleared |
|
||||
| str | background_color | color of background |
|
||||
| str | text_color | color of the text |
|
||||
|
||||
### visible
|
||||
|
||||
|
@ -2586,7 +2592,9 @@ Update(value = None,
|
|||
font = None,
|
||||
visible = None,
|
||||
size = (None, None),
|
||||
select = None)
|
||||
select = None,
|
||||
text_color = None,
|
||||
background_color = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -2602,6 +2610,8 @@ Parameter Descriptions:
|
|||
| bool | visible | control visibility of element |
|
||||
| (int, int) | size | width, height. Width = characters-wide, height = NOTE it's the number of entries to show in the list |
|
||||
| bool | select | if True, then the text will be selected, if False then selection will be cleared |
|
||||
| str | background_color | color of background |
|
||||
| str | text_color | color of the text |
|
||||
|
||||
---------
|
||||
|
||||
|
@ -4881,6 +4891,8 @@ Input(default_text = "",
|
|||
readonly = False,
|
||||
disabled_readonly_background_color = None,
|
||||
disabled_readonly_text_color = None,
|
||||
selected_text_color = None,
|
||||
selected_background_color = None,
|
||||
expand_x = False,
|
||||
expand_y = False,
|
||||
right_click_menu = None,
|
||||
|
@ -4915,6 +4927,8 @@ Parameter Descriptions:
|
|||
| bool | readonly | If True tkinter state set to 'readonly'. Use this in place of use_readonly_for_disable as another way of achieving readonly. Note cannot set BOTH readonly and disabled as tkinter only supplies a single flag |
|
||||
| str | disabled_readonly_background_color | If state is set to readonly or disabled, the color to use for the background |
|
||||
| str | disabled_readonly_text_color | If state is set to readonly or disabled, the color to use for the text |
|
||||
| str | selected_text_color | Color of text when it is selected (using mouse or control+A, etc) |
|
||||
| str | selected_background_color | Color of background when it is selected (using mouse or control+A, etc) |
|
||||
| bool | expand_x | If True the element will automatically expand in the X direction to fill available space |
|
||||
| bool | expand_y | If True the element will automatically expand in the Y direction to fill available space |
|
||||
| List[List[ List[str] or 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. |
|
||||
|
@ -5096,6 +5110,22 @@ Parameter Descriptions:
|
|||
|--|--|--|
|
||||
| bool | force | if True will call focus_force otherwise calls focus_set |
|
||||
|
||||
### set_ibeam_color
|
||||
|
||||
Sets the color of the I-Beam that is used to "insert" characters. This is oftens called a "Cursor" by
|
||||
many users. To keep from being confused with tkinter's definition of cursor (the mouse pointer), the term
|
||||
ibeam is used in this case.
|
||||
|
||||
```
|
||||
set_ibeam_color(ibeam_color = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| str | ibeam_color | color to set the "I-Beam" used to indicate where characters will be inserted |
|
||||
|
||||
### set_size
|
||||
|
||||
Changes the size of an element to a specific size.
|
||||
|
@ -5359,7 +5389,7 @@ Parameter Descriptions:
|
|||
| [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 |
|
||||
| bool | bind_return_key | If True, then the return key will cause a the Listbox to generate an event when return key is pressed |
|
||||
| (int, int) or (int, None) or int | size | w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1 |
|
||||
| (int, int) or (None, None) or int | s | Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used |
|
||||
| bool | disabled | set disable state for element |
|
||||
|
@ -5553,6 +5583,24 @@ Metadata is an Element property that you can use at any time to hold any value
|
|||
|---|---|---|
|
||||
|(Any)| **return** | the current metadata value |
|
||||
|
||||
### select_index
|
||||
|
||||
Selects an index while providing capability to setting the selected color for the index to specific text/background color
|
||||
|
||||
```
|
||||
select_index(index,
|
||||
highlight_text_color = None,
|
||||
highlight_background_color = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| int | index | specifies which item to change. index starts at 0 and goes to length of values list minus one |
|
||||
| str | highlight_text_color | color of the text when this item is selected. |
|
||||
| str | highlight_background_color | color of the background when this item is selected |
|
||||
|
||||
### set_cursor
|
||||
|
||||
Sets the cursor for the current Element.
|
||||
|
@ -5586,6 +5634,28 @@ Parameter Descriptions:
|
|||
|--|--|--|
|
||||
| bool | force | if True will call focus_force otherwise calls focus_set |
|
||||
|
||||
### set_index_color
|
||||
|
||||
Sets the color of a specific item without selecting it
|
||||
|
||||
```
|
||||
set_index_color(index,
|
||||
text_color = None,
|
||||
background_color = None,
|
||||
highlight_text_color = None,
|
||||
highlight_background_color = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| int | index | specifies which item to change. index starts at 0 and goes to length of values list minus one |
|
||||
| str | text_color | color of the text for this item |
|
||||
| str | background_color | color of the background for this item |
|
||||
| str | highlight_text_color | color of the text when this item is selected. |
|
||||
| str | highlight_background_color | color of the background when this item is selected |
|
||||
|
||||
### set_size
|
||||
|
||||
Changes the size of an element to a specific size.
|
||||
|
@ -6244,12 +6314,15 @@ Multiline(default_text = "",
|
|||
enter_submits = False,
|
||||
disabled = False,
|
||||
autoscroll = False,
|
||||
autoscroll_only_at_bottom = False,
|
||||
border_width = None,
|
||||
size = (None, None),
|
||||
s = (None, None),
|
||||
auto_size_text = None,
|
||||
background_color = None,
|
||||
text_color = None,
|
||||
selected_text_color = None,
|
||||
selected_background_color = None,
|
||||
horizontal_scroll = False,
|
||||
change_submits = False,
|
||||
enable_events = False,
|
||||
|
@ -6293,12 +6366,15 @@ Parameter Descriptions:
|
|||
| 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 |
|
||||
| bool | autoscroll_only_at_bottom | If True the contents of the element will automatically scroll only if the scrollbar is at the bottom of the multiline |
|
||||
| int | border_width | width of border around element in pixels |
|
||||
| (int, int) or (None, None) or int | size | (w, h) w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1 |
|
||||
| (int, int) or (None, None) or int | s | Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used |
|
||||
| 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 |
|
||||
| str | selected_text_color | Color of text when it is selected (using mouse or control+A, etc) |
|
||||
| str | selected_background_color | Color of background when it is selected (using mouse or control+A, etc) |
|
||||
| bool | horizontal_scroll | Controls if a horizontal scrollbar should be shown. If True a horizontal scrollbar will be shown in addition to vertical |
|
||||
| bool | change_submits | DO NOT USE. Only listed for backwards compat - Use enable_events instead |
|
||||
| bool | enable_events | If True then any key press that happens when the element has focus will generate an event. |
|
||||
|
@ -6590,6 +6666,22 @@ Parameter Descriptions:
|
|||
|--|--|--|
|
||||
| bool | force | if True will call focus_force otherwise calls focus_set |
|
||||
|
||||
### set_ibeam_color
|
||||
|
||||
Sets the color of the I-Beam that is used to "insert" characters. This is oftens called a "Cursor" by
|
||||
many users. To keep from being confused with tkinter's definition of cursor (the mouse pointer), the term
|
||||
ibeam is used in this case.
|
||||
|
||||
```
|
||||
set_ibeam_color(ibeam_color = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| str | ibeam_color | color to set the "I-Beam" used to indicate where characters will be inserted |
|
||||
|
||||
### set_size
|
||||
|
||||
Changes the size of an element to a specific size.
|
||||
|
@ -7200,11 +7292,11 @@ Parameter Descriptions:
|
|||
|
||||
---------
|
||||
|
||||
## Output Element (No longer recommended - USE `Multiline` instead)
|
||||
## Output Element
|
||||
|
||||
Rather than use the `Output` element, it's recommended that you use the `Multiline` element instead. The reason for this is that more controls have been added to the Multiline and in the future you can expect more features will be added to the Multiline while the `Output` element has stopped being enhanced.
|
||||
Output Element - a multi-lined text area to where stdout, stderr, cprint are rerouted.
|
||||
|
||||
You can control which Multiline Element receives your stdout output as well as use the color-print (`cprint`) with a Multiline.
|
||||
Now based on the `Multiline` element
|
||||
|
||||
Output Element - a multi-lined text area to where stdout, stderr, cprint are rerouted.
|
||||
|
||||
|
@ -7227,6 +7319,7 @@ Output(size = (None, None),
|
|||
text_color = None,
|
||||
pad = None,
|
||||
p = None,
|
||||
autoscroll_only_at_bottom = False,
|
||||
echo_stdout_stderr = False,
|
||||
font = None,
|
||||
tooltip = None,
|
||||
|
@ -7258,6 +7351,7 @@ Parameter Descriptions:
|
|||
| str | text_color | color of the text |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
| bool | autoscroll_only_at_bottom | If True the contents of the element will automatically scroll only if the scrollbar is at the bottom of the multiline |
|
||||
| bool | echo_stdout_stderr | If True then output to stdout will be output to this element AND also to the normal console location |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
|
@ -8902,7 +8996,7 @@ Parameter Descriptions:
|
|||
|--|--|--|
|
||||
| int | h_pixels | number of horizontal pixels |
|
||||
| int | v_pixels | number of vertical pixels |
|
||||
| (Column) | **RETURN** | (Column) A column element that has a pad setting set according to parameters
|
||||
| (Canvas) | **RETURN** | (Canvas) A canvas element that has a pad setting set according to parameters
|
||||
|
||||
-------
|
||||
|
||||
|
@ -9616,7 +9710,7 @@ Parameter Descriptions:
|
|||
| (int, int) or (None, None) or int | size | (w, h) w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1 |
|
||||
| (int, int) or (None, None) or int | s | Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used |
|
||||
| bool | auto_size_text | if True will size the element to match the length of the text |
|
||||
| bool | bind_return_key | If True, then the return key will cause a the element to generate an event |
|
||||
| bool | bind_return_key | If True, then the return key will cause a the element to generate an event when return key is pressed |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| str | background_color | color of background |
|
||||
| str | text_color | color of the text |
|
||||
|
@ -9809,6 +9903,22 @@ Parameter Descriptions:
|
|||
|--|--|--|
|
||||
| bool | force | if True will call focus_force otherwise calls focus_set |
|
||||
|
||||
### set_ibeam_color
|
||||
|
||||
Sets the color of the I-Beam that is used to "insert" characters. This is oftens called a "Cursor" by
|
||||
many users. To keep from being confused with tkinter's definition of cursor (the mouse pointer), the term
|
||||
ibeam is used in this case.
|
||||
|
||||
```
|
||||
set_ibeam_color(ibeam_color = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| str | ibeam_color | color to set the "I-Beam" used to indicate where characters will be inserted |
|
||||
|
||||
### set_size
|
||||
|
||||
Changes the size of an element to a specific size.
|
||||
|
@ -10980,14 +11090,14 @@ Parameter Descriptions:
|
|||
|
||||
Returns the current value for the Tab Group, which will be the currently selected tab's KEY or the text on
|
||||
the tab if no key is defined. Returns None if an error occurs.
|
||||
Note that this is exactly the same data that would be returned from a call to Window.Read. Are you sure you
|
||||
Note that this is exactly the same data that would be returned from a call to Window.read. Are you sure you
|
||||
are using this method correctly?
|
||||
|
||||
`get()`
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|---|---|---|
|
||||
|Any | None| **return** | The key of the currently selected tab or the tab's text if it has no key |
|
||||
|Any | None| **return** | The key of the currently selected tab or None if there is an error |
|
||||
|
||||
### get_next_focus
|
||||
|
||||
|
@ -11212,14 +11322,14 @@ Parameter Descriptions:
|
|||
|
||||
Returns the current value for the Tab Group, which will be the currently selected tab's KEY or the text on
|
||||
the tab if no key is defined. Returns None if an error occurs.
|
||||
Note that this is exactly the same data that would be returned from a call to Window.Read. Are you sure you
|
||||
Note that this is exactly the same data that would be returned from a call to Window.read. Are you sure you
|
||||
are using this method correctly?
|
||||
|
||||
`Get()`
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|---|---|---|
|
||||
|Any | None| **return** | The key of the currently selected tab or the tab's text if it has no key |
|
||||
|Any | None| **return** | The key of the currently selected tab or None if there is an error |
|
||||
|
||||
### SetFocus
|
||||
|
||||
|
@ -11420,15 +11530,13 @@ Parameter Descriptions:
|
|||
|
||||
### get
|
||||
|
||||
Dummy function for tkinter port. In the Qt port you can read back the values in the table in case they were
|
||||
edited. Don't know yet how to enable editing of a Tree in tkinter so just returning the values provided by
|
||||
user when Table was created or Updated.
|
||||
Get the selected rows using tktiner's selection method. Returns a list of the selected rows.
|
||||
|
||||
`get()`
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|---|---|---|
|
||||
|List[List[Any]]| **return** | the current table values (for now what was originally provided up updated) |
|
||||
|List[int]| **return** | a list of the index of the selected rows (a list of ints) |
|
||||
|
||||
### get_next_focus
|
||||
|
||||
|
@ -11652,15 +11760,13 @@ The following methods are here for backwards compatibility reference. You will
|
|||
|
||||
### Get
|
||||
|
||||
Dummy function for tkinter port. In the Qt port you can read back the values in the table in case they were
|
||||
edited. Don't know yet how to enable editing of a Tree in tkinter so just returning the values provided by
|
||||
user when Table was created or Updated.
|
||||
Get the selected rows using tktiner's selection method. Returns a list of the selected rows.
|
||||
|
||||
`Get()`
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|---|---|---|
|
||||
|List[List[Any]]| **return** | the current table values (for now what was originally provided up updated) |
|
||||
|List[int]| **return** | a list of the index of the selected rows (a list of ints) |
|
||||
|
||||
### SetFocus
|
||||
|
||||
|
@ -12194,6 +12300,7 @@ Tree(data = None,
|
|||
show_expanded = False,
|
||||
change_submits = False,
|
||||
enable_events = False,
|
||||
click_toggles_select = None,
|
||||
font = None,
|
||||
justification = "right",
|
||||
text_color = None,
|
||||
|
@ -12245,6 +12352,7 @@ Parameter Descriptions:
|
|||
| 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 |
|
||||
| bool | click_toggles_select | If True then clicking a row will cause the selection for that row to toggle between selected and deselected |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| str | justification | 'left', 'right', 'center' are valid choices |
|
||||
| str | text_color | color of the text |
|
||||
|
@ -13044,6 +13152,7 @@ Window(title,
|
|||
sbar_arrow_width = None,
|
||||
sbar_frame_color = None,
|
||||
sbar_relief = None,
|
||||
watermark = None,
|
||||
metadata = None)
|
||||
```
|
||||
|
||||
|
@ -13111,6 +13220,7 @@ Parameter Descriptions:
|
|||
| int | sbar_arrow_width | Scrollbar width of the arrow on the scrollbar. It will potentially impact the overall width of the scrollbar |
|
||||
| str | sbar_frame_color | Scrollbar Color of frame around scrollbar (available only on some ttk themes) |
|
||||
| str | sbar_relief | Scrollbar relief that will be used for the "thumb" of the scrollbar (the thing you grab that slides). Should be a constant that is defined at starting with "RELIEF_" - RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID |
|
||||
| bool | watermark | If True, then turns on watermarking temporarily for ALL windows created from this point forward. See global settings doc for more info |
|
||||
| Any | metadata | User metadata that can be set to ANYTHING |
|
||||
|
||||
### add_row
|
||||
|
@ -13615,7 +13725,7 @@ IMPORTANT - This method uses THREADS... this means you CANNOT make any PySimpleG
|
|||
the function you provide with the exception of one function, Window.write_event_value.
|
||||
|
||||
```
|
||||
perform_long_operation(func, end_key)
|
||||
perform_long_operation(func, end_key = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -13623,7 +13733,7 @@ Parameter Descriptions:
|
|||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| Any | func | A lambda or a function name with no parms |
|
||||
| Any | end_key | The key that will be generated when the function returns |
|
||||
| (Any or None) | end_key | Optional key that will be generated when the function returns |
|
||||
| threading.Thread | **RETURN** | The id of the thread
|
||||
|
||||
### read
|
||||
|
@ -13837,7 +13947,7 @@ IMPORTANT - This method uses THREADS... this means you CANNOT make any PySimpleG
|
|||
the function you provide with the exception of one function, Window.write_event_value.
|
||||
|
||||
```
|
||||
start_thread(func, end_key)
|
||||
start_thread(func, end_key = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -13845,9 +13955,63 @@ Parameter Descriptions:
|
|||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| Any | func | A lambda or a function name with no parms |
|
||||
| Any | end_key | The key that will be generated when the function returns |
|
||||
| (Any or None) | end_key | Optional key that will be generated when the function returns |
|
||||
| threading.Thread | **RETURN** | The id of the thread
|
||||
|
||||
### timer_get_active_timers
|
||||
|
||||
Returns a list of currently active timers for a window
|
||||
|
||||
`timer_get_active_timers()`
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|---|---|---|
|
||||
|List[int]| **return** | List of timers for the window |
|
||||
|
||||
### timer_start
|
||||
|
||||
Starts a timer that gnerates Timer Events. The default is to repeat the timer events until timer is stopped.
|
||||
You can provide your own key or a default key will be used. The default key is defined
|
||||
with the constants EVENT_TIMER or TIMER_KEY. They both equal the same value.
|
||||
The values dictionary will contain the timer ID that is returned from this function.
|
||||
|
||||
```
|
||||
timer_start(frequency_ms,
|
||||
key = "__TIMER EVENT__",
|
||||
repeating = True)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| int | frequency_ms | How often to generate timer events in milliseconds |
|
||||
| str or int or tuple or object | key | Key to be returned as the timer event |
|
||||
| bool | repeating | If True then repeat timer events until timer is explicitly stopped |
|
||||
| int | **RETURN** | Timer ID for the timer
|
||||
|
||||
### timer_stop
|
||||
|
||||
Stops a timer with a given ID
|
||||
|
||||
```
|
||||
timer_stop(timer_id)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| int | timer_id | Timer ID of timer to stop |
|
||||
|
||||
### timer_stop_all
|
||||
|
||||
Stops all timers for THIS window
|
||||
|
||||
```python
|
||||
timer_stop_all()
|
||||
```
|
||||
|
||||
### un_hide
|
||||
|
||||
Used to bring back a window that was previously hidden using the Hide method
|
||||
|
@ -14911,7 +15075,7 @@ Parameter Descriptions:
|
|||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -14919,6 +15083,7 @@ Parameter Descriptions:
|
|||
| str or int or tuple or object | k | Same as the Key. You can use either k or key. Which ever is set will be used. |
|
||||
| str | locale | defines the locale used to get day names |
|
||||
| str | format | formats result using this strftime format |
|
||||
| int | begin_at_sunday_plus | Determines the left-most day in the display. 0=sunday, 1=monday, etc |
|
||||
| List[str] | month_names | optional list of month names to use (should be 12 items) |
|
||||
| List[str] | day_abbreviations | optional list of abbreviations to display as the day of week |
|
||||
| str | title | Title shown on the date chooser window |
|
||||
|
@ -14963,7 +15128,7 @@ Parameter Descriptions:
|
|||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15021,7 +15186,7 @@ Parameter Descriptions:
|
|||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| 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) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15072,7 +15237,7 @@ Parameter Descriptions:
|
|||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15134,7 +15299,7 @@ Parameter Descriptions:
|
|||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15179,7 +15344,7 @@ Parameter Descriptions:
|
|||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15432,7 +15597,7 @@ Parameter Descriptions:
|
|||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15520,7 +15685,7 @@ Parameter Descriptions:
|
|||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| bool | bind_return_key | (Default = True) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| idk_yetReally | focus | if focus should be set to this |
|
||||
|
@ -15565,7 +15730,7 @@ Parameter Descriptions:
|
|||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| bool | bind_return_key | (Default = True) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| idk_yetReally | focus | if focus should be set to this |
|
||||
|
@ -15610,7 +15775,7 @@ Parameter Descriptions:
|
|||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| bool | bind_return_key | (Default = True) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| idk_yetReally | focus | if focus should be set to this |
|
||||
|
@ -15657,7 +15822,7 @@ Parameter Descriptions:
|
|||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15712,7 +15877,7 @@ Parameter Descriptions:
|
|||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15754,7 +15919,7 @@ Parameter Descriptions:
|
|||
| (int, int) or (None, None) or int | s | Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used |
|
||||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| bool | bind_return_key | (Default = True) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
|
@ -15852,7 +16017,7 @@ Parameter Descriptions:
|
|||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| bool | bind_return_key | (Default = True) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| idk_yetReally | focus | if focus should be set to this |
|
||||
|
@ -15899,7 +16064,7 @@ Parameter Descriptions:
|
|||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| str | tooltip | text, that will appear when mouse hovers over the element |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = True) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | p | Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
|
||||
|
@ -15956,7 +16121,7 @@ Parameter Descriptions:
|
|||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| idk_yetReally | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
|
@ -16009,7 +16174,7 @@ Parameter Descriptions:
|
|||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| idk_yetReally | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
|
@ -16067,7 +16232,7 @@ Parameter Descriptions:
|
|||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| idk_yetReally | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
|
@ -16124,7 +16289,7 @@ Parameter Descriptions:
|
|||
| bool | auto_size_button | True if button size is determined by button text |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
|
||||
| bool | bind_return_key | (Default = False) If True, then the return key will cause a the Listbox to generate an event |
|
||||
| bool | bind_return_key | (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options |
|
||||
| bool | disabled | set disable state for element (Default = False) |
|
||||
| idk_yetReally | focus | if focus should be set to this |
|
||||
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | pad | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
|
||||
|
@ -16571,11 +16736,11 @@ Parameter Descriptions:
|
|||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| str | title | text to display in eleemnt |
|
||||
| str | title | text to display in titlebar of window |
|
||||
| int | current_value | current value |
|
||||
| int | max_value | max value of QuickMeter |
|
||||
| Any | *args | stuff to output |
|
||||
| str or int or tuple or object | key | Used to differentiate between mutliple meters. Used to cancel meter early. Now optional as there is a default value for single meters |
|
||||
| int | max_value | max value of progress meter |
|
||||
| Any | *args | stuff to output as text in the window along with the meter |
|
||||
| str or int or tuple or object | key | Used to differentiate between multiple meters. Used to cancel meter early. Now optional as there is a default value for single meters |
|
||||
| str | orientation | 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical' / 'v') |
|
||||
| (str, str) or str | bar_color | The 2 colors that make up a progress bar. Either a tuple of 2 strings or a string. Tuple - (bar, background). A string with 1 color changes the background of the bar only. A string with 2 colors separated by "on" like "red on blue" specifies a red bar on a blue background. |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
|
@ -16625,11 +16790,11 @@ Parameter Descriptions:
|
|||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| str | title | text to display in eleemnt |
|
||||
| str | title | text to display in titlebar of window |
|
||||
| int | current_value | current value |
|
||||
| int | max_value | max value of QuickMeter |
|
||||
| Any | *args | stuff to output |
|
||||
| str or int or tuple or object | key | Used to differentiate between mutliple meters. Used to cancel meter early. Now optional as there is a default value for single meters |
|
||||
| int | max_value | max value of progress meter |
|
||||
| Any | *args | stuff to output as text in the window along with the meter |
|
||||
| str or int or tuple or object | key | Used to differentiate between multiple meters. Used to cancel meter early. Now optional as there is a default value for single meters |
|
||||
| str | orientation | 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical' / 'v') |
|
||||
| (str, str) or str | bar_color | The 2 colors that make up a progress bar. Either a tuple of 2 strings or a string. Tuple - (bar, background). A string with 1 color changes the background of the bar only. A string with 2 colors separated by "on" like "red on blue" specifies a red bar on a blue background. |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
|
@ -16738,7 +16903,8 @@ popup_animated(image_source,
|
|||
time_between_frames = 0,
|
||||
transparent_color = None,
|
||||
title = "",
|
||||
icon = None)
|
||||
icon = None,
|
||||
no_buffering = False)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -16760,6 +16926,7 @@ Parameter Descriptions:
|
|||
| 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 |
|
||||
| str or bytes | icon | Same as Window icon parameter. Can be either a filename or Base64 byte string. For Windows if filename, it MUST be ICO format. For Linux, must NOT be ICO |
|
||||
| bool | no_buffering | If True then no buffering will be used for the GIF. May work better if you have a large animation |
|
||||
| bool | **RETURN** | True if the window updated OK. False if the window was closed
|
||||
|
||||
Popup that closes itself after some time period
|
||||
|
@ -16942,6 +17109,9 @@ popup_get_date(start_mon = None,
|
|||
locale = None,
|
||||
month_names = None,
|
||||
day_abbreviations = None,
|
||||
day_font = "TkFixedFont 9",
|
||||
mon_year_font = "TkFixedFont 10",
|
||||
arrow_font = "TkFixedFont 7",
|
||||
modal = True)
|
||||
```
|
||||
|
||||
|
@ -16963,6 +17133,9 @@ Parameter Descriptions:
|
|||
| bool | keep_on_top | If True the window will remain above all current windows |
|
||||
| List[str] | month_names | optional list of month names to use (should be 12 items) |
|
||||
| List[str] | day_abbreviations | optional list of abbreviations to display as the day of week |
|
||||
| str or tuple | day_font | Font and size to use for the calendar |
|
||||
| str or tuple | mon_year_font | Font and size to use for the month and year at the top |
|
||||
| str or tuple | arrow_font | Font and size to use for the arrow buttons |
|
||||
| bool | modal | If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True |
|
||||
| None or (int, int, int) | **RETURN** | Tuple containing (month, day, year) of chosen date or None if was cancelled
|
||||
|
||||
|
@ -17816,7 +17989,8 @@ PopupAnimated(image_source,
|
|||
time_between_frames = 0,
|
||||
transparent_color = None,
|
||||
title = "",
|
||||
icon = None)
|
||||
icon = None,
|
||||
no_buffering = False)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -17838,6 +18012,7 @@ Parameter Descriptions:
|
|||
| 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 |
|
||||
| str or bytes | icon | Same as Window icon parameter. Can be either a filename or Base64 byte string. For Windows if filename, it MUST be ICO format. For Linux, must NOT be ICO |
|
||||
| bool | no_buffering | If True then no buffering will be used for the GIF. May work better if you have a large animation |
|
||||
| bool | **RETURN** | True if the window updated OK. False if the window was closed
|
||||
|
||||
Display a Popup without a titlebar. Enables grab anywhere so you can move it
|
||||
|
@ -19704,7 +19879,7 @@ Parameter Descriptions:
|
|||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| str | command | Filename to load settings from (and save to in the future) |
|
||||
| str | command | The command/file to execute. What you would type at a console to run a program or shell command. |
|
||||
| Any | *args | Variable number of arguments that are passed to the program being started as command line parms |
|
||||
| bool | wait | If True then wait for the subprocess to finish |
|
||||
| str | cwd | Working directory to use when executing the subprocess |
|
||||
|
@ -19960,7 +20135,8 @@ set_options(icon = None,
|
|||
sbar_relief = None,
|
||||
alpha_channel = None,
|
||||
hide_window_when_creating = None,
|
||||
use_button_shortcuts = None)
|
||||
use_button_shortcuts = None,
|
||||
watermark_text = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -20033,6 +20209,7 @@ Parameter Descriptions:
|
|||
| float | alpha_channel | Default alpha channel to be used on all windows |
|
||||
| bool | hide_window_when_creating | If True then alpha will be set to 0 while a window is made and moved to location indicated |
|
||||
| bool | use_button_shortcuts | If True then Shortcut Char will be used with Buttons |
|
||||
| str | watermark_text | Set the text that will be used if a window is watermarked |
|
||||
| None | **RETURN** | None
|
||||
|
||||
### Non PEP8 versions
|
||||
|
@ -20116,7 +20293,8 @@ SetOptions(icon = None,
|
|||
sbar_relief = None,
|
||||
alpha_channel = None,
|
||||
hide_window_when_creating = None,
|
||||
use_button_shortcuts = None)
|
||||
use_button_shortcuts = None,
|
||||
watermark_text = None)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -20189,6 +20367,7 @@ Parameter Descriptions:
|
|||
| float | alpha_channel | Default alpha channel to be used on all windows |
|
||||
| bool | hide_window_when_creating | If True then alpha will be set to 0 while a window is made and moved to location indicated |
|
||||
| bool | use_button_shortcuts | If True then Shortcut Char will be used with Buttons |
|
||||
| str | watermark_text | Set the text that will be used if a window is watermarked |
|
||||
| None | **RETURN** | None
|
||||
|
||||
## Old Themes (Look and Feel) - Replaced by theme()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div style="display: flex; gap: 50px; justify-content: center;">
|
||||
<div>
|
||||
<img src="https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/master/images/for_readme/Logo%20with%20text%20for%20GitHub%20Top.png" alt="Python GUIs for Humans">
|
||||
<h1 style="text-align: center;">Python GUIs for Humans</h1>
|
||||
<img src="https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/master/images/for_readme/Logo%20with%20text%20for%20GitHub%20Top.png" alt="User Interfaces for Humans">
|
||||
<h1 style="text-align: center;">User Interfaces for Humans<sup>TM</sup></h1>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
|
@ -25,9 +25,9 @@
|
|||
<span style="font-weight: normal;">
|
||||
apply coupon for discount:
|
||||
</span>
|
||||
266B9C51C90B3728782E
|
||||
522B20BF5EF123C4AB30
|
||||
</div>
|
||||
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=266B9C51C90B3728782E','_blank');">
|
||||
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=522B20BF5EF123C4AB30','_blank');">
|
||||
click here to visit course page
|
||||
</button>
|
||||
</div>
|
||||
|
@ -57,7 +57,7 @@
|
|||
|
||||
# PySimpleGUI User's Manual
|
||||
|
||||
## Python GUI For Humans - Transforms tkinter, Qt, Remi, WxPython into portable people-friendly Pythonic interfaces
|
||||
## User Interfaces for Humans - Transforms tkinter, Qt, Remi, WxPython into portable people-friendly Pythonic interfaces
|
||||
|
||||
## <span>The Call Reference Section Moved to <a href="https://pysimplegui.readthedocs.io/en/latest/call%20reference/">here</a></span>
|
||||
|
||||
|
@ -2028,7 +2028,8 @@ popup_animated(image_source,
|
|||
time_between_frames = 0,
|
||||
transparent_color = None,
|
||||
title = "",
|
||||
icon = None)
|
||||
icon = None,
|
||||
no_buffering = False)
|
||||
```
|
||||
|
||||
Parameter Descriptions:
|
||||
|
@ -2050,6 +2051,7 @@ Parameter Descriptions:
|
|||
| 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 |
|
||||
| str or bytes | icon | Same as Window icon parameter. Can be either a filename or Base64 byte string. For Windows if filename, it MUST be ICO format. For Linux, must NOT be ICO |
|
||||
| bool | no_buffering | If True then no buffering will be used for the GIF. May work better if you have a large animation |
|
||||
| bool | **RETURN** | True if the window updated OK. False if the window was closed
|
||||
|
||||
***To close animated popups***, call PopupAnimated with `image_source=None`. This will close all of the currently open PopupAnimated windows.
|
||||
|
@ -2078,11 +2080,11 @@ Parameter Descriptions:
|
|||
|
||||
|Type|Name|Meaning|
|
||||
|--|--|--|
|
||||
| str | title | text to display in eleemnt |
|
||||
| str | title | text to display in titlebar of window |
|
||||
| int | current_value | current value |
|
||||
| int | max_value | max value of QuickMeter |
|
||||
| Any | *args | stuff to output |
|
||||
| str or int or tuple or object | key | Used to differentiate between mutliple meters. Used to cancel meter early. Now optional as there is a default value for single meters |
|
||||
| int | max_value | max value of progress meter |
|
||||
| Any | *args | stuff to output as text in the window along with the meter |
|
||||
| str or int or tuple or object | key | Used to differentiate between multiple meters. Used to cancel meter early. Now optional as there is a default value for single meters |
|
||||
| str | orientation | 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical' / 'v') |
|
||||
| (str, str) or str | bar_color | The 2 colors that make up a progress bar. Either a tuple of 2 strings or a string. Tuple - (bar, background). A string with 1 color changes the background of the bar only. A string with 2 colors separated by "on" like "red on blue" specifies a red bar on a blue background. |
|
||||
| (str, str) or str | button_color | button color (foreground, background) |
|
||||
|
@ -7112,12 +7114,54 @@ There are a number of demo programs that show how to use UserSettings to create
|
|||
|
||||
If you're using the default path, remember that previous runs of your file may have old settings that are still in your settings file. It can get confusing when you've forgotten that you previously wrote a setting. Not seeing the filename can have drawbacks like this.
|
||||
|
||||
Also, because the settings automatically save after every update, it can be easy to accidently overwrite a previously saved setting. If you want to avoid this, then perhaps it's best that you work with a dictionary within your code and then explicitly save your dictionary when you're ready to commit it to disk.
|
||||
Also, because the settings automatically save after every update, it can be easy to accidentally overwrite a previously saved setting. If you want to avoid this, then perhaps it's best that you work with a dictionary within your code and then explicitly save your dictionary when you're ready to commit it to disk.
|
||||
|
||||
To save your Python dictionary to a settings file, simply call `user_settings_write_new_dictionary(dict)`, passing in your dictionary as the parameter.
|
||||
|
||||
-------------------------
|
||||
|
||||
# Timer API
|
||||
|
||||
The Timer API calls are in version 4.61.0 that is currently only available on the PySimpleGUI GitHub. It has not been released to PyPI yet.
|
||||
|
||||
## Do Not Use Sleeps In Your Event Loop...
|
||||
|
||||
Instead of sleeping, you can request that an event be generated after some period of time. If you need to "Sleep for 3 seconds" as part of some operation, instead schedule a timer for 3 seconds. Your `window.read` call will return a value of `sg.TIMER_KEY` or `sg.EVENT_TIMER` (they are aliases and thus have the same value).
|
||||
|
||||
## Timer API Calls
|
||||
|
||||
These are the API calls that you'll use to manage timers:
|
||||
|
||||
`window.timer_start` starts a timer
|
||||
|
||||
`window.timer_stop` stops a single timer
|
||||
|
||||
`window.timer_stop_all` stops all timers
|
||||
|
||||
`window.timer_get_active_timers` returns a list of active timer IDs
|
||||
|
||||
Example - start a 3 second timer that does not repeat:
|
||||
|
||||
```python
|
||||
window.timer_start(3000, repeating=False) # start a 3-second timer
|
||||
```
|
||||
|
||||
When this timer expires, you'll get an event `sg.EVENT_TIMER`. If you want to specify your own key to be returned, then use the `key` parameter:
|
||||
|
||||
```python
|
||||
window.timer_start(3000, key='-MY TIMER KEY-', repeating=False)
|
||||
```
|
||||
|
||||
See the call reference for the details of each call.
|
||||
|
||||
## Timer Demo Programs
|
||||
|
||||
Using the PySimpleGUI Demo Browser, search for `window.timer_` to find Demo Programs that use the Timer API calls.
|
||||
|
||||
The program `Demo_WindowTimer.py` demonstrates both repeating and non-repeating timers as well as using custom keys. It's a simple set of API calls to use and the docstrings in combination with the Demo Programs should give you all you need to start using this capability.
|
||||
|
||||
---------------------------
|
||||
|
||||
# Extending PySimpleGUI
|
||||
|
||||
PySimpleGUI doesn't and can't provide every single setting available in the underlying GUI framework. Not all tkinter options are available for a `Text` Element. Same with PySimpleGUIQt and the other ports.
|
||||
|
@ -10092,6 +10136,22 @@ Test Harness and Settings Windows fit on small screens better
|
|||
* Emergency Patch Release for Mac OS 12.3 and greater
|
||||
* Fixed bug in Mac OS version check in yesterday's 4.60.2 release
|
||||
|
||||
## 4.60.4 PySimpleGUI 10-Oct-2022
|
||||
|
||||
* Dot release to quickly fix the Trinket detection which stopped working recently
|
||||
|
||||
## 4.60.5 PySimpleGUI 21-May-2023
|
||||
|
||||
* Mac fixes
|
||||
* Fix for Input Element not working in no-titlebar windows on MacOs 13.2.1
|
||||
* Change to the 0.99 Alpha fix made in 4.60.2. Now only applies patch when running on 8.6.12, regardless of Mac Control Panel setting in PySimpleGUI Global Settings. Removes the need for users to disable when upgrading tkinter.
|
||||
* Added Intelligent Upgrade Service - inform users when there are releases of PySimpleGUI that fix a problem that may be unique to their combination of components
|
||||
* Change to GitHub Issue GUI
|
||||
* Added checkbox for checking if running latest PyPI version
|
||||
* Recommended using Demo Browser to search Demo Programs
|
||||
* Use platform module to fill in the OS information field
|
||||
* SDK Help Window - changed all readthedocs links to use the PySimpleGUI.org hostname for better portability
|
||||
|
||||
## Code Condition
|
||||
|
||||
Make it run
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
version: 2
|
||||
|
||||
version: 2
|
||||
build:
|
||||
os: "ubuntu-22.04"
|
||||
tools:
|
||||
python: "3.11"
|
||||
|
||||
python:
|
||||
version: 3.6
|
||||
install:
|
||||
- requirements: docs/requirements.txt
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue