[Python] Text Change Event
from tkinter import *
# Tkinter 인스턴스 생성
win = Tk()
# Window 사이즈 지정
win.geometry("700x350")
# Text 변경 Function 정의
def on_click():
label["text"] = "Python"
b["state"] = "disabled"
# Label 생성
label = Label(win, text="Text",
font=('Calibri 15 bold'))
label.pack(pady=20)
# 버튼 생성
b = Button(win, text="Update Text", command=on_click)
b.pack(pady=20)
win.mainloop()
댓글
댓글 쓰기