]>
vault307.fbx.one Git - mu_code.git/blob - styledBtn.py
2 from tkinter
import ttk
11 style
.theme_use('default')
12 style
.configure('styled.TButton',foreground
='deep pink',background
='purple3')
13 style
.map('styled.TButton',
14 foreground
=[('pressed','DeepPink2'),('focus','hot pink'),('!focus','deep pink')],
15 background
=[('active','DeepPink4'),('focus','MediumOrchid4')])
17 btn
=ttk
.Button(win
,text
='Styled Button',command
=click
, style
='styled.TButton')
19 #btn['state']='disabled'
20 btn2
=ttk
.Button(win
,text
='Styled Button2',command
=click2
, style
='styled.TButton')
21 btn2
.pack(fill
='both')