Comments (278)
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:
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
Looks very nice! If I wanted less bevel on the borders, could I change it without css?
from pysimplegui.
Very bagel. Can't wait to try it next week. Thanks!
from pysimplegui.
from pysimplegui.
This is by FAR the easiest way to share images on the net!
Wow, super-easy drag and drop.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
Same form with system default and 3 different look and feels.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
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)
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
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')
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
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)
from pysimplegui.
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)
from pysimplegui.
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')
from pysimplegui.
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()
from pysimplegui.
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()
from pysimplegui.
from pysimplegui.
These forms are in the "cookbook" document
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
More Sudoku... this time with Frames!
Qt
Tk
from pysimplegui.
from pysimplegui.
from pysimplegui.
from pysimplegui.
Related Issues (20)
- [ Bug ] Problem with HID device at first fire in the edit focused in pysimplegui tkinter. HOT 8
- [Question] Is there a better way to convert a JPG image into a PNG? HOT 5
- [ Question] Is it possible for me to force update the values dictionary for my menubutton elements to None? HOT 10
- [ Enhancement/Question] Programmatically setting Horizontal Scroll position of a Column() HOT 9
- [Question] Demo_Matplotlib_Ping_Graph_Large.py does not run/compile on Pi4 HOT 26
- Flask click SystemError when used with pySimpleGUI output redirect HOT 1
- [Question] How to trap an event HOT 2
- [Enhancement] CI friendly handling for the first time installation dialog HOT 3
- [Question] How to update class parameter within inherited class HOT 4
- [Question] How To Re-Enter Data For A Specific Field - AND 'CR to act like TAB HOT 1
- [ Bug] sg.ColorChooserButton Unless Additional Tkinter Import HOT 1
- [Bug] Hitting the image-count limit [Fail to create pixmap with Tk_GetPixmap in TkImgPhotoInstanceSetSize] HOT 6
- [Question] Import error HOT 3
- [Question] Change focus highlight when tabbing to button HOT 8
- [ Enhancement/Bug/Question] NOTE - you can also call sg.main() or sg.main_open_github_issue() to post an issue HOT 1
- [ Question] Compiling Errors since License validation HOT 2
- [ Bug] Broken Doc Link HOT 2
- [Question] NOTE - Table get doesn't work HOT 6
- [ Enhancement] allow arrowheads for lines in tkinter graphs HOT 8
- [Question] Question of shortcut HOT 17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysimplegui.