|
from tkinter import *
from tkinter.colorchooser 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()
请问这段代码中, (triple, hexstr) = askcolor(),为什么要这样写呢???triple 在这里是什么意思??
>>> help(tkinter.colorchooser.askcolor)
Help on function askcolor in module tkinter.colorchooser:
askcolor(color=None, **opti**)
Ask for a color
这里第一个参数不是应该是颜色吗????
|
|