RELEASE 3.4.0
This commit is contained in:
parent
9db96fd10f
commit
92bafa24f0
|
@ -14,18 +14,21 @@ layout = [
|
||||||
[sg.Text('All graphic widgets in one form!', size=(30, 1), font=("Helvetica", 25))],
|
[sg.Text('All graphic widgets in one form!', size=(30, 1), font=("Helvetica", 25))],
|
||||||
[sg.Text('Here is some text.... and a place to enter text')],
|
[sg.Text('Here is some text.... and a place to enter text')],
|
||||||
[sg.InputText('This is my text')],
|
[sg.InputText('This is my text')],
|
||||||
|
|
||||||
|
[sg.Frame([
|
||||||
[sg.Checkbox('Checkbox'), sg.Checkbox('My second checkbox!', default=True)],
|
[sg.Checkbox('Checkbox'), sg.Checkbox('My second checkbox!', default=True)],
|
||||||
[sg.Radio('My first Radio! ', "RADIO1", default=True), sg.Radio('My second Radio!', "RADIO1")],
|
[sg.Radio('My first Radio! ', "RADIO1", default=True), sg.Radio('My second Radio!', "RADIO1")]], title='Options',text_color='red', relief=sg.RELIEF_RAISED)],
|
||||||
[sg.Multiline(default_text='This is the default Text should you decide not to type anything', size=(35, 3)),
|
[sg.Multiline(default_text='This is the default Text should you decide not to type anything', size=(35, 3)),
|
||||||
sg.Multiline(default_text='A second multi-line', size=(35, 3))],
|
sg.Multiline(default_text='A second multi-line', size=(35, 3))],
|
||||||
[sg.InputCombo(('Combobox 1', 'Combobox 2'), size=(20, 1)),
|
[sg.InputCombo(('Combobox 1', 'Combobox 2'), size=(20, 1)),
|
||||||
sg.Slider(range=(1, 100), orientation='h', size=(34, 20), default_value=85)],
|
sg.Slider(range=(1, 100), orientation='h', size=(34, 20), default_value=85)],
|
||||||
[sg.InputOptionMenu(('Menu Option 1', 'Menu Option 2', 'Menu Option 3'))],
|
[sg.InputOptionMenu(('Menu Option 1', 'Menu Option 2', 'Menu Option 3'))],
|
||||||
[sg.Listbox(values=('Listbox 1', 'Listbox 2', 'Listbox 3'), size=(30, 3)),
|
[sg.Listbox(values=('Listbox 1', 'Listbox 2', 'Listbox 3'), size=(30, 3)),
|
||||||
|
sg.Frame([[
|
||||||
sg.Slider(range=(1, 100), orientation='v', size=(5, 20), default_value=25),
|
sg.Slider(range=(1, 100), orientation='v', size=(5, 20), default_value=25),
|
||||||
sg.Slider(range=(1, 100), orientation='v', size=(5, 20), default_value=75),
|
sg.Slider(range=(1, 100), orientation='v', size=(5, 20), default_value=75),
|
||||||
sg.Slider(range=(1, 100), orientation='v', size=(5, 20), default_value=10),
|
sg.Slider(range=(1, 100), orientation='v', size=(5, 20), default_value=10),
|
||||||
sg.Column(column1, background_color='#F7F3EC')],
|
sg.Column(column1, background_color='#F7F3EC')]],'Labelled Group', text_color='purple')],
|
||||||
[sg.Text('_' * 80)],
|
[sg.Text('_' * 80)],
|
||||||
[sg.Text('Choose A Folder', size=(35, 1))],
|
[sg.Text('Choose A Folder', size=(35, 1))],
|
||||||
[sg.Text('Your Folder', size=(15, 1), auto_size_text=False, justification='right'),
|
[sg.Text('Your Folder', size=(15, 1), auto_size_text=False, justification='right'),
|
||||||
|
@ -35,6 +38,6 @@ layout = [
|
||||||
|
|
||||||
button, values = form.LayoutAndRead(layout)
|
button, values = form.LayoutAndRead(layout)
|
||||||
|
|
||||||
sg.Popup('Title', 'The results of the form.', 'The button clicked was "{}"'.format(button), 'The values are', values)
|
sg.PopupAutoClose('Title', 'The results of the form.', 'The button clicked was "{}"'.format(button), 'The values are', values, auto_close_duration=1)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ layout = [
|
||||||
form = sg.FlexForm("Button Click", default_element_size=(12,1), text_justification='r', auto_size_text=False, auto_size_buttons=False,
|
form = sg.FlexForm("Button Click", default_element_size=(12,1), text_justification='r', auto_size_text=False, auto_size_buttons=False,
|
||||||
default_button_element_size=(12,1))
|
default_button_element_size=(12,1))
|
||||||
form.Layout(layout)
|
form.Layout(layout)
|
||||||
form.Finalize()
|
form.Finalize() # only needed if want to diable elements prior to showing form
|
||||||
|
|
||||||
form.FindElement('submit').Update(disabled=True)
|
form.FindElement('submit').Update(disabled=True)
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,10 @@ sg.SetOptions(element_padding=(0,0))
|
||||||
layout = [[sg.T('User:', pad=((3,0),0)), sg.OptionMenu(values = ('User 1', 'User 2'), size=(20,1)), sg.T('0', size=(8,1))],
|
layout = [[sg.T('User:', pad=((3,0),0)), sg.OptionMenu(values = ('User 1', 'User 2'), size=(20,1)), sg.T('0', size=(8,1))],
|
||||||
[sg.T('Customer:', pad=((3,0),0)), sg.OptionMenu(values=('Customer 1', 'Customer 2'), size=(20,1)), sg.T('1', size=(8,1))],
|
[sg.T('Customer:', pad=((3,0),0)), sg.OptionMenu(values=('Customer 1', 'Customer 2'), size=(20,1)), sg.T('1', size=(8,1))],
|
||||||
[sg.T('Notes:', pad=((3,0),0)), sg.In(size=(44,1), background_color='white', text_color='black')],
|
[sg.T('Notes:', pad=((3,0),0)), sg.In(size=(44,1), background_color='white', text_color='black')],
|
||||||
[sg.ReadFormButton('Start', button_color=('white', 'black'), key='start'),
|
[sg.ReadFormButton('Start', button_color=('white', 'black'), key='Start'),
|
||||||
sg.ReadFormButton('Stop', button_color=('gray34', 'black'), key='stop'),
|
sg.ReadFormButton('Stop', button_color=('white', 'black'), disabled=True, key='Stop'),
|
||||||
sg.ReadFormButton('Reset', button_color=('gray', 'firebrick3'), key='reset'),
|
sg.ReadFormButton('Reset', button_color=('gray', 'firebrick3'), key='Reset'),
|
||||||
sg.ReadFormButton('Submit', button_color=('gray34', 'springgreen4'), key='submit')]
|
sg.ReadFormButton('Submit', button_color=('gray34', 'springgreen4'), key='Submit')]
|
||||||
]
|
]
|
||||||
|
|
||||||
form = sg.FlexForm("Time Tracker", default_element_size=(12,1), text_justification='r', auto_size_text=False, auto_size_buttons=False,
|
form = sg.FlexForm("Time Tracker", default_element_size=(12,1), text_justification='r', auto_size_text=False, auto_size_buttons=False,
|
||||||
|
@ -23,30 +23,31 @@ form.Layout(layout)
|
||||||
recording = have_data = False
|
recording = have_data = False
|
||||||
while True:
|
while True:
|
||||||
button, values = form.Read()
|
button, values = form.Read()
|
||||||
|
print(button)
|
||||||
if button is None:
|
if button is None:
|
||||||
exit(69)
|
exit(69)
|
||||||
if button is 'Start':
|
if button is 'Start':
|
||||||
form.FindElement('start').Update(button_color=('gray34','black'))
|
form.FindElement('Start').Update(disabled=True)
|
||||||
form.FindElement('stop').Update(button_color=('white', 'black'))
|
form.FindElement('Stop').Update(disabled=False)
|
||||||
form.FindElement('reset').Update(button_color=('white', 'firebrick3'))
|
form.FindElement('Reset').Update(disabled=False)
|
||||||
recording = True
|
recording = True
|
||||||
elif button is 'Stop' and recording:
|
elif button is 'Stop' and recording:
|
||||||
form.FindElement('stop').Update(button_color=('gray34','black'))
|
form.FindElement('Stop').Update(disabled=True)
|
||||||
form.FindElement('start').Update(button_color=('white', 'black'))
|
form.FindElement('Start').Update(disabled=False)
|
||||||
form.FindElement('submit').Update(button_color=('white', 'springgreen4'))
|
form.FindElement('Submit').Update(disabled=False)
|
||||||
recording = False
|
recording = False
|
||||||
have_data = True
|
have_data = True
|
||||||
elif button is 'Reset':
|
elif button is 'Reset':
|
||||||
form.FindElement('stop').Update(button_color=('gray34','black'))
|
form.FindElement('Stop').Update(button_color=('gray34','black'))
|
||||||
form.FindElement('start').Update(button_color=('white', 'black'))
|
form.FindElement('Start').Update(button_color=('white', 'black'))
|
||||||
form.FindElement('submit').Update(button_color=('gray34', 'springgreen4'))
|
form.FindElement('Submit').Update(button_color=('gray34', 'springgreen4'))
|
||||||
form.FindElement('reset').Update(button_color=('gray34', 'firebrick3'))
|
form.FindElement('Reset').Update(button_color=('gray34', 'firebrick3'))
|
||||||
recording = False
|
recording = False
|
||||||
have_data = False
|
have_data = False
|
||||||
elif button is 'Submit' and have_data:
|
elif button is 'Submit' and have_data:
|
||||||
form.FindElement('stop').Update(button_color=('gray34','black'))
|
form.FindElement('Stop').Update(button_color=('gray34','black'))
|
||||||
form.FindElement('start').Update(button_color=('white', 'black'))
|
form.FindElement('Start').Update(button_color=('white', 'black'))
|
||||||
form.FindElement('submit').Update(button_color=('gray34', 'springgreen4'))
|
form.FindElement('Submit').Update(button_color=('gray34', 'springgreen4'))
|
||||||
form.FindElement('reset').Update(button_color=('gray34', 'firebrick3'))
|
form.FindElement('Reset').Update(button_color=('gray34', 'firebrick3'))
|
||||||
recording = False
|
recording = False
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
import PySimpleGUI as gui
|
import PySimpleGUI as sg
|
||||||
|
|
||||||
|
|
||||||
layout = [
|
layout = [
|
||||||
[gui.Canvas(size=(100,100), background_color='red', key='canvas')],
|
[sg.Canvas(size=(150, 150), background_color='red', key='canvas')],
|
||||||
[gui.T('Change circle color to:'), gui.ReadFormButton('Red'), gui.ReadFormButton('Blue')]
|
[sg.T('Change circle color to:'), sg.ReadFormButton('Red'), sg.ReadFormButton('Blue')]
|
||||||
]
|
]
|
||||||
|
|
||||||
form = gui.FlexForm('Canvas test')
|
form = sg.FlexForm('Canvas test')
|
||||||
form.Layout(layout)
|
form.Layout(layout)
|
||||||
form.Finalize()
|
form.Finalize()
|
||||||
|
|
||||||
|
|
|
@ -1662,7 +1662,6 @@ GoodColors = [('#0e6251', sg.RGB(255, 246, 122)),
|
||||||
(sg.RGB(0, 210, 87), sg.RGB(0, 74, 60)),
|
(sg.RGB(0, 210, 87), sg.RGB(0, 74, 60)),
|
||||||
(sg.RGB(0, 164, 73), sg.RGB(0, 74, 60)),
|
(sg.RGB(0, 164, 73), sg.RGB(0, 74, 60)),
|
||||||
(sg.RGB(0, 74, 60), sg.RGB(0, 74, 60)),
|
(sg.RGB(0, 74, 60), sg.RGB(0, 74, 60)),
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,6 @@
|
||||||
import PySimpleGUI as sg
|
import PySimpleGUI as sg
|
||||||
import time
|
import time
|
||||||
|
|
||||||
"""
|
|
||||||
Timer Desktop Widget
|
|
||||||
Creates a floating timer that is always on top of other windows
|
|
||||||
You move it by grabbing anywhere on the window
|
|
||||||
Good example of how to do a non-blocking, polling program using PySimpleGUI
|
|
||||||
Can be used to poll hardware when running on a Pi
|
|
||||||
|
|
||||||
NOTE - you will get a warning message printed when you exit using exit button.
|
|
||||||
It will look something like:
|
|
||||||
invalid command name "1616802625480StopMove"
|
|
||||||
"""
|
|
||||||
|
|
||||||
# ---------------- Create Form ----------------
|
# ---------------- Create Form ----------------
|
||||||
sg.ChangeLookAndFeel('Black')
|
sg.ChangeLookAndFeel('Black')
|
||||||
sg.SetOptions(element_padding=(0, 0))
|
sg.SetOptions(element_padding=(0, 0))
|
||||||
|
|
|
@ -12,12 +12,12 @@ def FindDuplicatesFilesInFolder(path):
|
||||||
small_count, dup_count, error_count = 0,0,0
|
small_count, dup_count, error_count = 0,0,0
|
||||||
pngdir = path
|
pngdir = path
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
sg.MsgBox('Duplicate Finder', '** Folder doesn\'t exist***', path)
|
sg.Popup('Duplicate Finder', '** Folder doesn\'t exist***', path)
|
||||||
return
|
return
|
||||||
pngfiles = os.listdir(pngdir)
|
pngfiles = os.listdir(pngdir)
|
||||||
total_files = len(pngfiles)
|
total_files = len(pngfiles)
|
||||||
for idx, f in enumerate(pngfiles):
|
for idx, f in enumerate(pngfiles):
|
||||||
if not sg.EasyProgressMeter('Counting Duplicates', idx + 1, total_files, 'Counting Duplicate Files'):
|
if not sg.OneLineProgressMeter('Counting Duplicates', idx + 1, total_files, 'Counting Duplicate Files'):
|
||||||
break
|
break
|
||||||
total += 1
|
total += 1
|
||||||
fname = os.path.join(pngdir, f)
|
fname = os.path.join(pngdir, f)
|
||||||
|
@ -37,7 +37,7 @@ def FindDuplicatesFilesInFolder(path):
|
||||||
shatab.append(f_sha)
|
shatab.append(f_sha)
|
||||||
|
|
||||||
msg = '{} Files processed\n {} Duplicates found'.format(total_files, dup_count)
|
msg = '{} Files processed\n {} Duplicates found'.format(total_files, dup_count)
|
||||||
sg.MsgBox('Duplicate Finder Ended', msg)
|
sg.Popup('Duplicate Finder Ended', msg)
|
||||||
|
|
||||||
# ====____====____==== Pseudo-MAIN program ====____====____==== #
|
# ====____====____==== Pseudo-MAIN program ====____====____==== #
|
||||||
# This is our main-alike piece of code #
|
# This is our main-alike piece of code #
|
||||||
|
@ -48,9 +48,9 @@ def FindDuplicatesFilesInFolder(path):
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
source_folder = None
|
source_folder = None
|
||||||
rc, source_folder = sg.GetPathBox('Duplicate Finder - Count number of duplicate files', 'Enter path to folder you wish to find duplicates in')
|
rc, source_folder = sg.PopupGetFolder('Duplicate Finder - Count number of duplicate files', 'Enter path to folder you wish to find duplicates in')
|
||||||
if rc is True and source_folder is not None:
|
if rc is True and source_folder is not None:
|
||||||
FindDuplicatesFilesInFolder(source_folder)
|
FindDuplicatesFilesInFolder(source_folder)
|
||||||
else:
|
else:
|
||||||
sg.MsgBoxCancel('Cancelling', '*** Cancelling ***')
|
sg.PopupCancel('Cancelling', '*** Cancelling ***')
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
|
@ -6,6 +6,7 @@ import PySimpleGUI as sg
|
||||||
|
|
||||||
STEP_SIZE=1
|
STEP_SIZE=1
|
||||||
SAMPLES = 6000
|
SAMPLES = 6000
|
||||||
|
CANVAS_SIZE = (6000,500)
|
||||||
|
|
||||||
# globale used to communicate with thread.. yea yea... it's working fine
|
# globale used to communicate with thread.. yea yea... it's working fine
|
||||||
g_exit = False
|
g_exit = False
|
||||||
|
@ -17,20 +18,23 @@ def ping_thread(args):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
global g_exit, g_response_time
|
global g_exit, g_response_time
|
||||||
|
|
||||||
# start ping measurement thread
|
# start ping measurement thread
|
||||||
thread = Thread(target=ping_thread, args=(None,))
|
thread = Thread(target=ping_thread, args=(None,))
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
# sg.ChangeLookAndFeel('Black')
|
sg.ChangeLookAndFeel('Black')
|
||||||
sg.SetOptions(element_padding=(0,0))
|
sg.SetOptions(element_padding=(0,0))
|
||||||
|
|
||||||
layout = [ [sg.T('Ping times to Google.com', font='Any 18')],
|
layout = [ [sg.T('Ping times to Google.com', font='Any 12'), sg.Quit(pad=((100,0), 0), button_color=('white', 'black'))],
|
||||||
[sg.Graph((6000,200), (0,0), (SAMPLES,500),background_color='black', key='graph')],
|
[sg.Graph(CANVAS_SIZE, (0,0), (SAMPLES,500),background_color='black', key='graph')],]
|
||||||
[sg.Quit()]]
|
|
||||||
|
|
||||||
form = sg.FlexForm('Canvas test', grab_anywhere=True, background_color='black')
|
form = sg.FlexForm('Canvas test', grab_anywhere=True, background_color='black', no_titlebar=False, use_default_focus=False)
|
||||||
form.Layout(layout)
|
form.Layout(layout)
|
||||||
|
|
||||||
|
form.Finalize()
|
||||||
|
graph = form.FindElement('graph')
|
||||||
|
|
||||||
prev_response_time = None
|
prev_response_time = None
|
||||||
i=0
|
i=0
|
||||||
prev_x, prev_y = 0, 0
|
prev_x, prev_y = 0, 0
|
||||||
|
@ -40,7 +44,6 @@ def main():
|
||||||
button, values = form.ReadNonBlocking()
|
button, values = form.ReadNonBlocking()
|
||||||
if button == 'Quit' or values is None:
|
if button == 'Quit' or values is None:
|
||||||
break
|
break
|
||||||
graph = form.FindElement('graph')
|
|
||||||
if g_response_time is None or prev_response_time == g_response_time:
|
if g_response_time is None or prev_response_time == g_response_time:
|
||||||
continue
|
continue
|
||||||
new_x, new_y = i, g_response_time[0]
|
new_x, new_y = i, g_response_time[0]
|
||||||
|
|
|
@ -24,9 +24,9 @@ def MachineLearningGUI():
|
||||||
[sg.Text('l', size=(8, 1)), sg.In(default_text='0.4', size=(8, 1)), sg.Text('Layers', size=(8, 1)),
|
[sg.Text('l', size=(8, 1)), sg.In(default_text='0.4', size=(8, 1)), sg.Text('Layers', size=(8, 1)),
|
||||||
sg.Drop(values=('BatchNorm', 'other'), auto_size_text=True)],]
|
sg.Drop(values=('BatchNorm', 'other'), auto_size_text=True)],]
|
||||||
|
|
||||||
layout = [[sg.Frame('Command Line Parameteres', command_line_parms, text_color='green', font='Any 12')],
|
layout = [[sg.Frame('Command Line Parameteres', command_line_parms, title_color='green', font='Any 12')],
|
||||||
[sg.Frame('Flags', flags, font='Any 12', text_color='blue')],
|
[sg.Frame('Flags', flags, font='Any 12', title_color='blue')],
|
||||||
[sg.Frame('Loss Functions', loss_functions, font='Any 12', text_color='red')],
|
[sg.Frame('Loss Functions', loss_functions, font='Any 12', title_color='red')],
|
||||||
[sg.Submit(), sg.Cancel()]]
|
[sg.Submit(), sg.Cancel()]]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,8 @@ def TestMenus():
|
||||||
# ------ GUI Defintion ------ #
|
# ------ GUI Defintion ------ #
|
||||||
layout = [
|
layout = [
|
||||||
[sg.Menu(menu_def)],
|
[sg.Menu(menu_def)],
|
||||||
[sg.Output(size=(60,20))]
|
[sg.Output(size=(60,20))],
|
||||||
|
[sg.In('Test', key='input', do_not_clear=True)]
|
||||||
]
|
]
|
||||||
|
|
||||||
form = sg.FlexForm("Windows-like program", default_element_size=(12, 1), auto_size_text=False, auto_size_buttons=False,
|
form = sg.FlexForm("Windows-like program", default_element_size=(12, 1), auto_size_text=False, auto_size_buttons=False,
|
||||||
|
|
|
@ -40,9 +40,9 @@ from binascii import hexlify
|
||||||
sg.ChangeLookAndFeel('GreenTan')
|
sg.ChangeLookAndFeel('GreenTan')
|
||||||
|
|
||||||
if len(sys.argv) == 1:
|
if len(sys.argv) == 1:
|
||||||
rc, fname = sg.GetFileBox('PDF Browser', 'PDF file to open', file_types=(("PDF Files", "*.pdf"),))
|
rc, fname = sg.PopupGetFile('PDF Browser', 'PDF file to open', file_types=(("PDF Files", "*.pdf"),))
|
||||||
if rc is False:
|
if rc is False:
|
||||||
sg.MsgBoxCancel('Cancelling')
|
sg.PopupCancel('Cancelling')
|
||||||
exit(0)
|
exit(0)
|
||||||
else:
|
else:
|
||||||
fname = sys.argv[1]
|
fname = sys.argv[1]
|
||||||
|
|
|
@ -61,7 +61,10 @@ while True:
|
||||||
|
|
||||||
if g_response_time is None or prev_response_time == g_response_time:
|
if g_response_time is None or prev_response_time == g_response_time:
|
||||||
continue
|
continue
|
||||||
new_x, new_y = convert_xy_to_canvas_xy(i, g_response_time[0])
|
try:
|
||||||
|
new_x, new_y = convert_xy_to_canvas_xy(i, g_response_time[0])
|
||||||
|
except: continue
|
||||||
|
|
||||||
prev_response_time = g_response_time
|
prev_response_time = g_response_time
|
||||||
canvas.create_line(prev_x, prev_y, new_x, new_y, width=1, fill='black')
|
canvas.create_line(prev_x, prev_y, new_x, new_y, width=1, fill='black')
|
||||||
prev_x, prev_y = new_x, new_y
|
prev_x, prev_y = new_x, new_y
|
||||||
|
|
|
@ -1,17 +1,15 @@
|
||||||
import PySimpleGUI as sg
|
import PySimpleGUI as sg
|
||||||
|
|
||||||
|
print (sg.PopupYesNo('Yes No'))
|
||||||
|
|
||||||
|
print(sg.PopupGetText('Get text', background_color='blue', text_color='white', location=(1000,200)))
|
||||||
print(sg.PopupGetFolder('Get text', background_color='blue', text_color='white'))
|
print(sg.PopupGetFile('Get file', background_color='blue', text_color='white'))
|
||||||
print(sg.PopupGetFile('Get text', background_color='blue', text_color='white'))
|
print(sg.PopupGetFolder('Get folder', background_color='blue', text_color='white'))
|
||||||
print(sg.PopupGetFolder('Get text', background_color='blue', text_color='white'))
|
|
||||||
|
|
||||||
|
|
||||||
sg.Popup('Simple popup')
|
sg.Popup('Simple popup')
|
||||||
|
|
||||||
sg.PopupNonBlocking('Non Blocking')
|
sg.PopupNonBlocking('Non Blocking', location=(500,500))
|
||||||
sg.PopupError('Error')
|
|
||||||
sg.PopupYesNo('Yes No')
|
|
||||||
sg.PopupNoTitlebar('No titlebar')
|
sg.PopupNoTitlebar('No titlebar')
|
||||||
sg.PopupNoBorder('No border')
|
sg.PopupNoBorder('No border')
|
||||||
sg.PopupNoFrame('No frame')
|
sg.PopupNoFrame('No frame')
|
||||||
|
@ -19,6 +17,3 @@ sg.PopupNoButtons('No Buttons')
|
||||||
sg.PopupCancel('Cancel')
|
sg.PopupCancel('Cancel')
|
||||||
sg.PopupOKCancel('OK Cancel')
|
sg.PopupOKCancel('OK Cancel')
|
||||||
sg.PopupAutoClose('Autoclose')
|
sg.PopupAutoClose('Autoclose')
|
||||||
print(sg.PopupGetText('Get text'))
|
|
||||||
print(sg.PopupGetFile('Get File'))
|
|
||||||
print(sg.PopupGetFolder('Get folder'))
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ from time import sleep
|
||||||
import PySimpleGUI as sg
|
import PySimpleGUI as sg
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Demonstration of multiple OneLineProgressMeter's
|
Demonstration of simple and multiple OneLineProgressMeter's
|
||||||
|
|
||||||
Shows how 2 progress meters can be running at the same time.
|
Shows how 2 progress meters can be running at the same time.
|
||||||
Note -- If the user wants to cancel a meter, it's important to use the "Cancel" button, not the X
|
Note -- If the user wants to cancel a meter, it's important to use the "Cancel" button, not the X
|
||||||
|
@ -10,7 +10,26 @@ import PySimpleGUI as sg
|
||||||
calling OneLineProgresMeterCancel(key) will cancel the meter with the matching key
|
calling OneLineProgresMeterCancel(key) will cancel the meter with the matching key
|
||||||
"""
|
"""
|
||||||
|
|
||||||
sg.ChangeLookAndFeel('Dark')
|
# sg.ChangeLookAndFeel('Dark')
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
The simple case is that you want to add a single meter to your code. The one-line solution
|
||||||
|
"""
|
||||||
|
|
||||||
|
import PySimpleGUI as sg
|
||||||
|
|
||||||
|
# Display a progress meter in work loop. User is not allowed to break out of the loop
|
||||||
|
for i in range(10000):
|
||||||
|
if i % 5 == 0: sg.OneLineProgressMeter('My 1-line progress meter', i+1, 10000, 'single')
|
||||||
|
|
||||||
|
# Display a progress meter. Allow user to break out of loop using cancel button
|
||||||
|
for i in range(10000):
|
||||||
|
if not sg.OneLineProgressMeter('My 1-line progress meter', i+1, 10000, 'single'):
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
layout = [
|
layout = [
|
||||||
[sg.T('One-Line Progress Meter Demo', font=('Any 18'))],
|
[sg.T('One-Line Progress Meter Demo', font=('Any 18'))],
|
||||||
|
|
|
@ -41,7 +41,6 @@ def Launcher2():
|
||||||
namesonly.append(ntpath.basename(file))
|
namesonly.append(ntpath.basename(file))
|
||||||
|
|
||||||
layout = [
|
layout = [
|
||||||
[sg.Text('Script output....', size=(40, 1))],
|
|
||||||
[sg.Listbox(values=namesonly, size=(30, 19), select_mode=sg.SELECT_MODE_EXTENDED, key='demolist'), sg.Output(size=(88, 20), font='Courier 10')],
|
[sg.Listbox(values=namesonly, size=(30, 19), select_mode=sg.SELECT_MODE_EXTENDED, key='demolist'), sg.Output(size=(88, 20), font='Courier 10')],
|
||||||
[sg.Checkbox('Wait for program to complete', default=False, key='wait')],
|
[sg.Checkbox('Wait for program to complete', default=False, key='wait')],
|
||||||
[sg.ReadFormButton('Run'), sg.ReadFormButton('Shortcut 1'), sg.ReadFormButton('Fav Program'), sg.SimpleButton('EXIT')],
|
[sg.ReadFormButton('Run'), sg.ReadFormButton('Shortcut 1'), sg.ReadFormButton('Fav Program'), sg.SimpleButton('EXIT')],
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import csv
|
import csv
|
||||||
import PySimpleGUI as sg
|
import PySimpleGUI as sg
|
||||||
|
|
||||||
filename = sg.PopupGetFile('filename to open', no_window=True, file_types=(("CSV Files","*.csv"),))
|
# filename = sg.PopupGetFile('filename to open', no_window=True, file_types=(("CSV Files","*.csv"),))
|
||||||
|
filename = 'C:/Python/PycharmProjects/GooeyGUI/CSV/Gruen Movement Catalog V5.3 for Lucid less data 2017-08-30.csv'
|
||||||
# --- populate table with file contents --- #
|
# --- populate table with file contents --- #
|
||||||
data = []
|
data = []
|
||||||
if filename is not None:
|
if filename is not None:
|
||||||
|
@ -19,8 +20,11 @@ col_layout = [[sg.Table(values=data[1:][:], headings=[data[0][x] for x in range(
|
||||||
auto_size_columns=True, display_row_numbers=True, justification='right', size=(None, len(data)))]]
|
auto_size_columns=True, display_row_numbers=True, justification='right', size=(None, len(data)))]]
|
||||||
|
|
||||||
layout = [[sg.Column(col_layout, size=(1200,600), scrollable=True)],]
|
layout = [[sg.Column(col_layout, size=(1200,600), scrollable=True)],]
|
||||||
|
|
||||||
form = sg.FlexForm('Table', grab_anywhere=False)
|
form = sg.FlexForm('Table', grab_anywhere=False)
|
||||||
b, v = form.LayoutAndRead(layout)
|
form.Layout(layout)
|
||||||
|
|
||||||
|
form.Finalize()
|
||||||
|
|
||||||
|
b, v = form.Read()
|
||||||
|
|
||||||
exit(69)
|
exit(69)
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
# PySimpleGUI
|
# PySimpleGUI
|
||||||
|
|
||||||
(Ver 3.3.0)
|
(Ver 3.4.0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -107,6 +107,8 @@ The `PySimpleGUI` package is focused on the ***developer***. Create a custom GU
|
||||||
Radio Buttons
|
Radio Buttons
|
||||||
Listbox
|
Listbox
|
||||||
Slider
|
Slider
|
||||||
|
Graph
|
||||||
|
Frame with title
|
||||||
Icons
|
Icons
|
||||||
Multi-line Text Input
|
Multi-line Text Input
|
||||||
Scroll-able Output
|
Scroll-able Output
|
||||||
|
@ -2155,6 +2157,7 @@ A MikeTheWatchGuy production... entirely responsible for this code.... unless it
|
||||||
| 3.01.02 | Step 11, 2018 - All Element.Update functions have a `disabled` parameter so they can be disabled. Renamed some parameters in Update function (sorry if I broke your code), fix for bug in Image.Update. Wasn't setting size correctly, changed grab_anywhere logic again,added grab anywhere option to PupupGetText (assumes disabled)
|
| 3.01.02 | Step 11, 2018 - All Element.Update functions have a `disabled` parameter so they can be disabled. Renamed some parameters in Update function (sorry if I broke your code), fix for bug in Image.Update. Wasn't setting size correctly, changed grab_anywhere logic again,added grab anywhere option to PupupGetText (assumes disabled)
|
||||||
| 3.02.00 | Sept 14, 2018 - New Table Element (Beta release), MsgBox removed entirely, font setting for InputText Element, **packing change** risky change that allows some Elements to be resized,removed command parameter from Menu Element, new function names for ReadNonBlocking (Finalize, PreRead), change to text element autosizing and wrapping (yet again), lots of parameter additions to Popup functions (colors, etc).
|
| 3.02.00 | Sept 14, 2018 - New Table Element (Beta release), MsgBox removed entirely, font setting for InputText Element, **packing change** risky change that allows some Elements to be resized,removed command parameter from Menu Element, new function names for ReadNonBlocking (Finalize, PreRead), change to text element autosizing and wrapping (yet again), lots of parameter additions to Popup functions (colors, etc).
|
||||||
| 3.03.00 | New feature - One Line Progress Meters, new display_row_numbers for Table Element, fixed bug in EasyProgresssMeters (function will soon go away), OneLine and Easy progress meters set to grab anywhere but can be turned off.
|
| 3.03.00 | New feature - One Line Progress Meters, new display_row_numbers for Table Element, fixed bug in EasyProgresssMeters (function will soon go away), OneLine and Easy progress meters set to grab anywhere but can be turned off.
|
||||||
|
{ 03,04.00 | New features - Graph Element, Frame Element, more settings exposed to Popup calls. See notes below for more.
|
||||||
|
|
||||||
|
|
||||||
### Release Notes
|
### Release Notes
|
||||||
|
@ -2188,6 +2191,7 @@ Related to the Grab Anywhere feature is the no_titlebar option, again found in t
|
||||||
|
|
||||||
3.3.0 OneLineProgressMeter function added which gives you not only a one-line solution to progress meters, but it also gives you the ability to have more than 1 running at the same time, something not possible with the EasyProgressMeterCall
|
3.3.0 OneLineProgressMeter function added which gives you not only a one-line solution to progress meters, but it also gives you the ability to have more than 1 running at the same time, something not possible with the EasyProgressMeterCall
|
||||||
|
|
||||||
|
3.4.0 New Elements - Frame (a labelled frame for grouping elements. Similar to Column), Graph (like a Canvas element except uses the caller's coordinate system rather than tkinter's). Set an initial_folder for browsing type buttons (browse for file/folder). Buttons return key value rather than button text if a key is specified, OneLineProgressMeter! Replaced EasyProgressMeter (sorry folks that's the way progress works sometimes), changed ALL of the Popup calls to provide many more customization settings - changed PopupGetFolder, PopupGetFile, PopupGetText, Popup, PopupNoButtons, PopupNonBlocking, PopupNoTitlebar, PopupAutoClose, PopupCancel, PopupOK, PopupOKCancel, PopupYesNo
|
||||||
|
|
||||||
### Upcoming
|
### Upcoming
|
||||||
Make suggestions people! Future release features
|
Make suggestions people! Future release features
|
||||||
|
@ -2263,7 +2267,7 @@ Here are the steps to run that application
|
||||||
|
|
||||||
The pip command is all there is to the setup.
|
The pip command is all there is to the setup.
|
||||||
|
|
||||||
The way HowDoI works is that it uses your search term to look through stack overflow posts. It finds the best answer, gets the code from the answer, and presents it as a response. It gives you the correct answer OFTEN. It's a miracle that it work SO well.
|
The way HowDoI works is that it uses your search term to look through stack overflow posts. It finds the best answer, gets the code from the answer, and presents it as a response. It gives you the correct answer OFTEN. It's a miracle that it work SO well.
|
||||||
For Python questions, I simply start my query with 'Python'. Let's say you forgot how to reverse a list in Python. When you run HowDoI and ask this question, this is what you'll see.
|
For Python questions, I simply start my query with 'Python'. Let's say you forgot how to reverse a list in Python. When you run HowDoI and ask this question, this is what you'll see.
|
||||||
|
|
||||||
![howdoiwithhistory](https://user-images.githubusercontent.com/13696193/45064009-5fd61180-b07f-11e8-8ead-eb0d1ff3a6be.jpg)
|
![howdoiwithhistory](https://user-images.githubusercontent.com/13696193/45064009-5fd61180-b07f-11e8-8ead-eb0d1ff3a6be.jpg)
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
# PySimpleGUI
|
# PySimpleGUI
|
||||||
|
|
||||||
(Ver 3.3.0)
|
(Ver 3.4.0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -107,6 +107,8 @@ The `PySimpleGUI` package is focused on the ***developer***. Create a custom GU
|
||||||
Radio Buttons
|
Radio Buttons
|
||||||
Listbox
|
Listbox
|
||||||
Slider
|
Slider
|
||||||
|
Graph
|
||||||
|
Frame with title
|
||||||
Icons
|
Icons
|
||||||
Multi-line Text Input
|
Multi-line Text Input
|
||||||
Scroll-able Output
|
Scroll-able Output
|
||||||
|
@ -2155,6 +2157,7 @@ A MikeTheWatchGuy production... entirely responsible for this code.... unless it
|
||||||
| 3.01.02 | Step 11, 2018 - All Element.Update functions have a `disabled` parameter so they can be disabled. Renamed some parameters in Update function (sorry if I broke your code), fix for bug in Image.Update. Wasn't setting size correctly, changed grab_anywhere logic again,added grab anywhere option to PupupGetText (assumes disabled)
|
| 3.01.02 | Step 11, 2018 - All Element.Update functions have a `disabled` parameter so they can be disabled. Renamed some parameters in Update function (sorry if I broke your code), fix for bug in Image.Update. Wasn't setting size correctly, changed grab_anywhere logic again,added grab anywhere option to PupupGetText (assumes disabled)
|
||||||
| 3.02.00 | Sept 14, 2018 - New Table Element (Beta release), MsgBox removed entirely, font setting for InputText Element, **packing change** risky change that allows some Elements to be resized,removed command parameter from Menu Element, new function names for ReadNonBlocking (Finalize, PreRead), change to text element autosizing and wrapping (yet again), lots of parameter additions to Popup functions (colors, etc).
|
| 3.02.00 | Sept 14, 2018 - New Table Element (Beta release), MsgBox removed entirely, font setting for InputText Element, **packing change** risky change that allows some Elements to be resized,removed command parameter from Menu Element, new function names for ReadNonBlocking (Finalize, PreRead), change to text element autosizing and wrapping (yet again), lots of parameter additions to Popup functions (colors, etc).
|
||||||
| 3.03.00 | New feature - One Line Progress Meters, new display_row_numbers for Table Element, fixed bug in EasyProgresssMeters (function will soon go away), OneLine and Easy progress meters set to grab anywhere but can be turned off.
|
| 3.03.00 | New feature - One Line Progress Meters, new display_row_numbers for Table Element, fixed bug in EasyProgresssMeters (function will soon go away), OneLine and Easy progress meters set to grab anywhere but can be turned off.
|
||||||
|
{ 03,04.00 | New features - Graph Element, Frame Element, more settings exposed to Popup calls. See notes below for more.
|
||||||
|
|
||||||
|
|
||||||
### Release Notes
|
### Release Notes
|
||||||
|
@ -2188,6 +2191,7 @@ Related to the Grab Anywhere feature is the no_titlebar option, again found in t
|
||||||
|
|
||||||
3.3.0 OneLineProgressMeter function added which gives you not only a one-line solution to progress meters, but it also gives you the ability to have more than 1 running at the same time, something not possible with the EasyProgressMeterCall
|
3.3.0 OneLineProgressMeter function added which gives you not only a one-line solution to progress meters, but it also gives you the ability to have more than 1 running at the same time, something not possible with the EasyProgressMeterCall
|
||||||
|
|
||||||
|
3.4.0 New Elements - Frame (a labelled frame for grouping elements. Similar to Column), Graph (like a Canvas element except uses the caller's coordinate system rather than tkinter's). Set an initial_folder for browsing type buttons (browse for file/folder). Buttons return key value rather than button text if a key is specified, OneLineProgressMeter! Replaced EasyProgressMeter (sorry folks that's the way progress works sometimes), changed ALL of the Popup calls to provide many more customization settings - changed PopupGetFolder, PopupGetFile, PopupGetText, Popup, PopupNoButtons, PopupNonBlocking, PopupNoTitlebar, PopupAutoClose, PopupCancel, PopupOK, PopupOKCancel, PopupYesNo
|
||||||
|
|
||||||
### Upcoming
|
### Upcoming
|
||||||
Make suggestions people! Future release features
|
Make suggestions people! Future release features
|
||||||
|
@ -2263,7 +2267,7 @@ Here are the steps to run that application
|
||||||
|
|
||||||
The pip command is all there is to the setup.
|
The pip command is all there is to the setup.
|
||||||
|
|
||||||
The way HowDoI works is that it uses your search term to look through stack overflow posts. It finds the best answer, gets the code from the answer, and presents it as a response. It gives you the correct answer OFTEN. It's a miracle that it work SO well.
|
The way HowDoI works is that it uses your search term to look through stack overflow posts. It finds the best answer, gets the code from the answer, and presents it as a response. It gives you the correct answer OFTEN. It's a miracle that it work SO well.
|
||||||
For Python questions, I simply start my query with 'Python'. Let's say you forgot how to reverse a list in Python. When you run HowDoI and ask this question, this is what you'll see.
|
For Python questions, I simply start my query with 'Python'. Let's say you forgot how to reverse a list in Python. When you run HowDoI and ask this question, this is what you'll see.
|
||||||
|
|
||||||
![howdoiwithhistory](https://user-images.githubusercontent.com/13696193/45064009-5fd61180-b07f-11e8-8ead-eb0d1ff3a6be.jpg)
|
![howdoiwithhistory](https://user-images.githubusercontent.com/13696193/45064009-5fd61180-b07f-11e8-8ead-eb0d1ff3a6be.jpg)
|
||||||
|
|
Loading…
Reference in New Issue