(Window) ¶
~cpp from Tkinter import * root = Tk() root.mainloop()
¶
GUI .( root 해 .)
.
.
~cpp frame = Frame(root) frame.pack()
GUI pack 해 .
Packer ¶
pack() 해 .
side=LEFT # (RIGHT, TOP, BOTTOM)
after=button1 # pack하 button1 .
before=button1 # pack하 button1 .
fill=X # X크 . Y
padx=5, pady=5 # 한.
ipadx=5, ipady=5 # 한.
anchor=NW # . fill 하 ...
after=button1 # pack하 button1 .
before=button1 # pack하 button1 .
fill=X # X크 . Y
padx=5, pady=5 # 한.
ipadx=5, ipady=5 # 한.
anchor=NW # . fill 하 ...
~cpp button.pack(side=LEFT, fill=X, padx=5, pady=10)X 크 5, 10 ....
~cpp button.place(30, 30, width=70, height=25)
크
¶
하 하..
~cpp entry = Entry(frame) entry.insert(0, '') # entry.pack(pady=5)
Label ¶
표해 ()...
textWrite = Label(frame, text="Hello World!")
textWrite.pack()
textWrite.pack()
푸 ¶
~cpp button = Button(frame, text="Push Button", fg="red", command=frame.quit) button.pack(side=LEFT)
pack할 해. ..
크 ¶
하 크하 v표 .
~cpp var = IntVar() # 0 하 () 화. check = Checkbutton(frame, text="Check Button", variable=var, command=cb) check.pack() def cb(): if var.get() == 1: w.configure(text='Variable is Set') elif: w.configure(text='Variable is Reset')
command 행하 함 한.
¶
택하 (?) 표.
한 택할 .
한 택할 .
~cpp var = IntVar() radio1 = Radiobutton(frame, text="One", variable=var, value=1) radio2 = Radiobutton(frame, text="Two", variable=var, value=2) radio1.pack(anchor=w) radio2.pack(anchor=w)
variable 해한.
( varivable 하...???)
( varivable 하...???)
radio1 택하 var 1, radio2 택하 var 2.
Radiobutton 함호 indicatoron=0 푸 .
크 ¶
크 트, (Canvas) 함 .
~cpp scrollbar = Scrollbar(frame) scrollbar.pack(side=RIGHT, fill=Y)
(평)크 하 해 2 해한.
1. () yscrollcommand 함 크 set 한.
2. 크 command yview 하.
1. () yscrollcommand 함 크 set 한.
2. 크 command yview 하.
트 ¶
크 킨 트 ...
~cpp listbox = Listbox(frame, yscrollcommand=scrollbar.set) # 1 listbox.pack(side=LEFT, fill=BOTH) scrollbar.config(command=listbox.yview) # 2평 크 yscrollcommand xscrollcommand, yview xview ..
텍트 ¶
한 텍트 표해 . 한 폰트 함. 할.
Label 텍트 표 해 ..
Label 텍트 표 해 ..
~cpp textArea = Text(frame, width=80, height=20) textArea.pack()
텍트 ¶
~cpp textArea.insert(END, "Hello") textArea.insert(INSERT, "world") textArea.insert(1.0, "!!!!!") # 텍트 하 button = Button(textArea, text="Click") textArea.window_create(INSERT, window=button)
END
INSERT
,
INSERT
,
window_create image_create 하 킬 .
텍트 ¶
~cpp textArea.deletet(1.0, END) # 텍트 textArea.deletet(INSERT) # textArea.deletet(button) #
텍트 ¶
~cpp contents = text.get(1.0, END)
contents 한.
~cpp textArea.config(state=DISABLED)
텍트 .(state=NORMAL 해 )
¶
~cpp index = textArea.index(INSERT)
index '1.17' .