Set Color : Common Dialog « GUI Tk « Python






Set Color

Set Color

from Tkinter import *
from tkColorChooser import askcolor

def setBgColor():
    (triple, hexstr) = askcolor()
    if hexstr:
        print hexstr
        push.config(bg=hexstr)

root = Tk()
push = Button(root, text='Set Background Color', command=setBgColor)
push.config(height=3, font=('times', 20, 'bold'))
push.pack(expand=YES, fill=BOTH)
root.mainloop()

           
       








Related examples in the same category

1.OK cancel dialogOK cancel dialog
2.Question dialogQuestion dialog
3.Error dialogError dialog
4.Entry dialogEntry dialog
5.File open dialogFile open dialog
6.Color chooser dialogColor chooser dialog
7.Buildin dialogs: warning dialog, info dialog and error dialogBuildin dialogs: warning dialog, info dialog and error dialog
8.YES NO CANCEL dialogYES NO CANCEL dialog