Modifier la couleur de fond et la couleur de texte d’un widget

Author:

 tkinter
{filelink=15416}

 
from Tkinter import *
 
class MonBouton(Frame):
    """
     Modification des options fg(Couleur de fond)
     et bg(Couleur de texte)
    """
    def __init__(self):
        Frame.__init__(self)
        self.pack()
        bt = Button(self, text='Text', command=self.quit)
        bt.pack()
        bt.config(bg='navy', fg='white', bd=8)
        lbl=Label(self, text="Mon label")
        lbl.pack(expand=YES, fill=BOTH)
        lbl.config(bg='#FFFFFF', fg='cyan', bd=12)
 
if __name__ == '__main__':
    MonBouton().mainloop()