You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I stumbled onto the Iconipy project and a couple of others that featured mouseover images. It sounded like an interesting feature to add to PySimpleGUI. It's been possible for a long time for users to do this on their own, but it's not the cleanest code since the user's event loop needs to handle the mouseovers. So, I'm trying out what it's like to do it via the Button element itself.
Test Harness
importPySimpleGUIassg""" Demo - Mouseover Images Demo of mouseover images on Buttons. Can specify a mouseover image if an image is set for a Button Copyright 2026 PySimpleGUI. All rights reserved."""defmain():
layout= [[sg.Button(image_source=sg.EMOJI_BASE64_HAPPY_BIG_SMILE, mouseover_image_source=sg.EMOJI_BASE64_SAD, k='-BUTTON 1-'),
sg.Button(image_source=sg.EMOJI_BASE64_HAPPY_LAUGH, mouseover_image_source=sg.EMOJI_BASE64_CRY, k='-BUTTON 2-')]]
window=sg.Window('Mouseover Image Test', layout)
whileTrue:
event, values=window.read()
print(event, values)
ifevent==sg.WIN_CLOSEDorevent=='Exit':
breakwindow.close()
if__name__=='__main__':
main()
Type of Issue (Enhancement, Error, Bug, Question)
Enhancement
Operating System
Win, Mac, Linux
PySimpleGUI Port (tkinter, Qt, Wx, Web)
tkinter
Versions
PySimpleGUI Version (
sg.__version__)6.2.1
Detailed Description
I stumbled onto the Iconipy project and a couple of others that featured mouseover images. It sounded like an interesting feature to add to PySimpleGUI. It's been possible for a long time for users to do this on their own, but it's not the cleanest code since the user's event loop needs to handle the mouseovers. So, I'm trying out what it's like to do it via the Button element itself.
Test Harness
Screenshot
python_6EggpLak7M.mp4