We can display images over buttons by using image attributes. We can also replace this image based on click event to use them as ON/ OFF switches.
Based on this event we can configure the background colour of the window by using the background attribute of the window.
Two images one for ON and one for OFF position are created in PNG image format and used as images over the button.
Full source code with sample images to download.
[ Ссылка ]
#ButtonImage #TkinterImageButton #Python #plus2net #ImageSwitch #ONoff #backgroundColour
Ещё видео!