Screen shots (Not to be used by users... these are a scratchpad)
MikeTheWatchGuy opened this issue ยท 278 comments
MikeTheWatchGuy commented
Learned this trick for hosting screen shots within GitHub
https://app.leanboard.io/board/3efa539b-3c23-4ddb-98a6-b2cd4558565c
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
happyconcepts commented
Looks very nice! If I wanted less bevel on the borders, could I change it without css?
MikeTheWatchGuy commented
You can control the "depth" of the Elements by using the BorderDepth option when creating the form. I don't have an option to control it only on the buttons; so I can't do it just to the buttons.
For narrower looking bevels,use something like this:
with g.FlexForm('Everything bagel', AutoSizeText=True, DefaultElementSize=(40,1), BorderDepth=3) as form:
It produces a form that looks like this:
happyconcepts commented
Very bagel. Can't wait to try it next week. Thanks!
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
import PySimpleGUI as sg
form = sg.FlexForm('Simple data entry form') # begin with a blank form
layout = [
[sg.Text('Please enter your Name, Address, Phone')],
[sg.Text('Name', size=(15, 1)), sg.InputText()],
[sg.Text('Address', size=(15, 1)), sg.InputText()],
[sg.Text('Phone', size=(15, 1)), sg.InputText()],
[sg.Submit(), sg.Cancel()]
]
button, (name, address, phone) = form.LayoutAndRead(layout)
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
import easygui_qt as eq
import PySimpleGUI as sg
import easygui as eg
def codebox(msg, title, text):
return sg.FlexForm(title).LayoutAndRead([[sg.Multiline(size=(60,4), default_text=msg)],[ sg.Multiline(size=(60,14), default_text=text)], [sg.OK(), sg.Cancel()]])
eg.codebox('msg', 'title', 'test')
codebox('msg', 'title', 'test')
# SourceDestFolders()
eq.show_message('message', 'title')
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
import PySimpleGUI as g
layout = [[g.Text('YouTube Download Link', auto_size_text=True)],
[g.InputText()],
[g.OK(), g.Cancel()]]
button, (youtube_link, ) = g.FlexForm('Enter YouTube Link').LayoutAndRead(layout)
# insert code here to determine what options to include based on data from the link
resolution_1080p, resolution_720p, resolution_360 = None, True, False
if youtube_link is not None:
form = g.FlexForm('Download Example', auto_size_text=True)
layout = [[g.Text('YouTube Download Link', auto_size_text=True)],
[g.Text('Your link is:')],
[g.Text(youtube_link)],
[g.Text('')],
[g.Text('Video dimensions')],
[g.Checkbox('1080p', default=resolution_1080p),
g.Checkbox('720p', default=resolution_720p),
g.Checkbox('360', default=resolution_360)],
[g.OK(), g.Cancel()]]
button, (values) = form.LayoutAndRead(layout)
g.MsgBox(button, values)
MikeTheWatchGuy commented
import PySimpleGUI as g
form = g.FlexForm('Registration form', auto_size_text=True)
layout = [
[g.Text('Registration Form', size=(20,1), font=('Helvitica', 20))],
[g.Text('Full name', size=(15,1)), g.InputText()],
[g.Text('Email', size=(15,1)), g.InputText()],
[g.Text('Gender', size=(15,1)), g.Radio('Male', group_id=1), g.Radio('Female', group_id=1)],
[g.Text('Country', size=(15,1)), g.Combo(values=('select your country', 'USA', 'Other'))],
[g.Text('Programming', size=(15,1)), g.Checkbox('Java'), g.Checkbox('Python')],
[g.Submit(button_color=('white', 'red'))]
]
form.LayoutAndRead(layout)
MikeTheWatchGuy commented
import PySimpleGUI as g
output1 = g.Text('')
layout = [
[g.Text('What is your guess?')],
[g.InputText()],
[g.ReadFormButton('Submit')]
]
form = g.FlexForm('Number game')
form.Layout(layout)
number = 100
while True:
button, (value,) = form.Read()
guess = int(value)
if guess == number:
form.CloseNonBlockingForm()
g.MsgBox('You Guessed Correctly!', 'Right')
break
if guess > number:
output1.Update('Too high')
elif guess < number:
output1.Update('Too low')
MikeTheWatchGuy commented
import PySimpleGUI as sg
import os
def Launcher():
form = sg.FlexForm('Script launcher')
layout = [
[sg.Text('Script output....', size=(40, 1))],
[sg.Output(size=(88, 20))],
[sg.ReadFormButton('script1'), sg.ReadFormButton('script2'), sg.SimpleButton('EXIT')]
]
form.Layout(layout)
# ---===--- Loop taking in user input and using it to query HowDoI --- #
while True:
(button, value) = form.Read()
if button == 'EXIT' or button is None:
break # exit button clicked
if button == 'script1':
ExecuteCommandOS('python SimScript.py')
elif button == 'script2':
ExecuteCommandOS('python SimScript.py')
elif button == 'Enter':
ExecuteCommandOS(value[0]) # send string without carriage return on end
def ExecuteCommandOS(command):
output = os.popen(command).read()
print(output)
if __name__ == '__main__':
Launcher()
MikeTheWatchGuy commented
import time
import PySimpleGUI as sg
def CubeTimer():
# Show a form that's a running counter
form = sg.FlexForm('Running Timer', auto_size_text=True)
text_element = sg.Text('', size=(10, 2), font=('Helvetica', 20), justification='center')
form_rows = [[sg.Text('Rubix Cube Timer')],
[text_element],
[sg.T(' ' * 15), sg.ReadFormButton('Start/Stop', focus=True), sg.Quit()]]
form.LayoutAndRead(form_rows, non_blocking=True)
# logic for reading the form buttons, starting/stopping timer
timer_running = True
i = 0
while True:
if timer_running:
i += 1
text_element.Update('{:02d}:{:02d}.{:02d}'.format((i//100)//60, (i//100)%60, i%100))
button, values = form.ReadNonBlocking()
if values is None or button == 'Quit': # if user closed the window using X or clicked Quit button
break
elif button == 'Start/Stop':
timer_running = not timer_running
time.sleep(.01)
# if the loop finished then need to close the form for the user
form.CloseNonBlockingForm()
del(form)
CubeTimer()
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented
MikeTheWatchGuy commented