0
내가 프레임 이를 생성하는 함수를 작성하기 위해 노력하고있어 코드입니다 :만들기 프레임 기능 파이썬
from Tkinter import *
from ttk import *
def button(master, txt, line, col):
new = Button(master, text=txt)
new.grid(row=line, column =col, columnspan=2)
def frame(nb, txt):
f = Frame(nb)
nb.add(f, text = txt)
root = Tk()
nb = Notebook(root)
f1 = frame(nb, '1')
f2 = frame(nb, '2')
button(f1, '1', 0, 0)
nb.grid()
root.mainloop()
하지만이 코드를 실행하면 버튼은 마스터에있어,하지 F1을 받고있다 창 자체 (그림 참조) :
어떻게 내가 f1 아래로 이동할 수 있습니까? 그리고 내가 그것을 볼 때, 나는 Button을 보았고, f2에있을 때 창에 아무것도 없었습니까?
감사합니다! – BlackFox7