0
from tkinter import *
from tkinter import ttk
class App(Frame):
def __init__(self,*args,**kwargs):
Frame.__init__(self,*args,**kwargs)
self.notebook = ttk.Notebook()
self.add_tab()
self.notebook.grid(row=0)
def add_tab(self):
tab = Area(self.notebook)
tab2 = Volume(self.notebook)
self.notebook.add(tab,text="Tag")
self.notebook.add(tab2,text="Tag2")
class Area(Frame):
def __init__(self,name,*args,**kwargs):
Frame.__init__(self,*args,**kwargs)
self.label = Label(text="Hi This is Tab1")
self.label.grid(row=1,column=0,padx=10,pady=10)
self.name = name
class Volume(Frame):
def __init__(self,name,*args,**kwargs):
Frame.__init__(self,*args,**kwargs)
self.label = Label(text="Hi This is Tab2")
self.label.grid(row=1,column=0,padx=10,pady=10)
self.name = name
my_app = App()
卷類的標籤在覆蓋區域類的標籤,同時在標籤 我怎麼能解決這個問題,我如何能在添加類不同的東西不同的標籤。如何在python創建來自不同班級的Tkinter多個標籤