美文网首页
python3.0 tkinter button

python3.0 tkinter button

作者: Albert新荣 | 来源:发表于2019-04-10 22:53 被阅读0次
    import tkinter as tk
    from tkinter import ttk
    win=tk.Tk()
    win.title('GUI004')
    aLabel=ttk.Label(win,text='A Label')
    aLabel.grid(column=0,row=0)
    
    def clickme():
        action.configure(text='*I have been clicked!')
        aLabel.configure(foreground='red')
    
    action=ttk.Button(win,text='Click Me',command=clickme)
    action.grid(column=1,row=0)
    
    win.mainloop()
    

    相关文章

      网友评论

          本文标题:python3.0 tkinter button

          本文链接:https://www.haomeiwen.com/subject/rxvaiqtx.html