Bouton de survol de Tkinter
#Here is a sample code for tkinter animation and hover
from tkinter import *
app = Tk()
app.geometry("300x250")
app.configure(bg="#141414")
app.title("Hover GUI")
def bttn(x,y,text,bcolor,fcolor, cmd):
def on_enter(e):
mybutton['background']= fcolor
mybutton['foreground']= bcolor
def on_leave(e):
mybutton['background']= fcolor
mybutton['foreground']= bcolor
mybutton=Button(app, width=42, height=2, text=text,
fg=fcolor,
bg = bcolor,
border=0,
activebackground=bcolor,
activeforeground=fcolor,
command=cmd)
mybutton.bind("<Enter>", on_enter)
mybutton.bind("<Leave>", on_leave)
mybutton.place(x=x,y=y)
def cmd():
print('You clicked A C E R')
def cmd1():
print('You clicked A C E R')
def cmd2():
print('You clicked A C E R')
def cmd3():
print('You clicked A C E R')
bttn(22,0,"A C E R", "#ffcc66", "#141414", cmd)
bttn(22,37,"H A R D", "lime","#ffcc66", cmd1)
bttn(22,74," E A SY", "red","#ffcc66", cmd2)
bttn(22,148,"A S I A N", "blue","#ffcc66", cmd3)
app.mainloop()
Vitalik-Hakim