0
我想將按鈕添加到python框架中的特定選項卡,但不幸的是它被添加到框架而不是選項卡。如何改善?在特定選項卡上添加按鈕
from Tkinter import *
from ttk import *
class Example(Frame):
def __init__(self, parent):
Frame.__init__(self, parent)
def main():
root = Tk()
root.geometry("450x300+300+100")
notebook = Notebook(root)
p1=notebook.add(Frame(width=450, height=300),text="Add")
p2=notebook.add(Frame(width=450, height=300),text="Show)
p3=notebook.add(Frame(width=450, height=300),text="select")
b = Button(p1, text="OK")
b.pack()
b2=Button(p2, text="No")
b2.pack()
notebook.pack()
root.mainloop()
if __name__ == "__main__":
main()
非常感謝!我明白這一點。 – Texicans