import tkinter as tk import numpy as np # COPY HERE SHADOW CLASS def test_click(): button1.configure(text='You have clicked me!') if __name__ == '__main__': root = tk.Tk() # Create dummy buttons button1 = tk.Button(root, text="Click me!", width=20, height=2, command=test_click) button1.grid(row=0, column=0, padx=50, pady=20) button2 = tk.Button(root, text="Hover me!", width=20, height=2) button2.bind('<Enter>', lambda e: button2.configure(text='You have hovered me!')) button2.grid(row=1, column=0, padx=50, pady=20) # Add shadow Shadow(button1, color='#ff0000', size=1.3, offset_x=-5, onclick={'color':'#00ff00'}) Shadow(button2, size=10, offset_x=10, offset_y=10, onhover={'size':5, 'offset_x':5, 'offset_y':5}) root.mainloop()
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter