-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
When CTkTabview is created with an anchor that is not sw, s, or se, it creates child frames that do not expand to fill the tab area.
This can be seen with the following simple app:
import customtkinter
import pprint
class App(customtkinter.CTk):
def __init__(self):
super().__init__()
anchors = {
'nw': (0,0),
'n': (1,0),
'ne': (2,0),
'w': (0,1),
'center': (1,1),
'e': (2,1),
'sw': (0,2),
's': (1,2),
'se': (2,2),
}
self.tabs = {}
for (anchor,(gcol,grow)) in anchors.items():
tabview = customtkinter.CTkTabview(self, anchor=anchor)
self.tabs[anchor] = tabview
tabview.grid(column=gcol, row=grow, sticky="nsew")
tab = tabview.add(anchor)
tab.grid_columnconfigure(0, weight=1)
tab.grid_rowconfigure(0, weight=1)
tab.grid(column=0, row=0, sticky="nsew")
tab.tabInfo = TabInfo(tab)
tab.tabInfo.grid(column=0, row=0, sticky="nsew")
class TabInfo(customtkinter.CTkLabel):
def __init__(self, master):
super().__init__(master)
self.setup_text()
self.bind("<Configure>", self.reconfigure)
def reconfigure(self, event):
self.setup_text()
def setup_text(self):
self.configure(text=self.winfo_geometry())
if __name__ == '__main__':
app = App()
app.mainloop()Metadata
Metadata
Assignees
Labels
No labels