PySimpleGUI/docs/eCookbook/custom-elements-buttons-radio-buttons-etc/toggle-button-super-simple.md
2022-06-30 15:54:57 -04:00

26 lines
1 KiB
Markdown

## Toggle Button - Super Simple
This demo shows you how to make a toggle button using 2 methods.
1. A Button that changes color and text
2. A Button with a graphic that changes
It's a simple way to get a toggle button in PySimpleGUI using the Button Element.
<iframe src='https://trinket.io/embed/pygame/d9a29fa9b9?start=result' width='100%' height='500' frameborder='0' marginwidth='0' marginheight='0' allowfullscreen></iframe>
## Toggle Button - Super Simple Graphic Only
And this one is even more simplified.
<iframe src='https://trinket.io/embed/pygame/3027862692?start=result' width='100%' height='500' frameborder='0' marginwidth='0' marginheight='0' allowfullscreen></iframe>
## Toggle Button - Simple Graphic - No Button Animation
Maybe you don't want the graphic to move up and down like a button does. Not a problem....just switch from Button to Image.
<iframe src='https://trinket.io/embed/pygame/15059fc6f6?start=result' width='100%' height='500' frameborder='0' marginwidth='0' marginheight='0' allowfullscreen></iframe>