-
Notifications
You must be signed in to change notification settings - Fork 1.1k
CTkTabview
Tom Schimansky edited this page Oct 14, 2022
·
5 revisions

Recommended usage:
tabview = customtkinter.CTkTabview(app)
tabview.pack(padx=20, pady=20)
tabview.add("tab 1") # add tab at the end
tabview.add("tab 2") # add tab at the end
tabview.set("tab 2") # set currently visible tab
button_1 = customtkinter.Button(tabview.tab("tab 1"))
button.pack(padx=20, pady=20)
It's also possible to save tabs in extra variables:
tabview = customtkinter.CTkTabview(app)
tabview.pack(padx=20, pady=20)
tab_1 = tabview.add("tab 1")
tab_2 = tabview.add("tab 2")
tabview.set("tab 2")
button_1 = customtkinter.Button(tab_1)
button.pack(padx=20, pady=20)
The tabs are instances of CTkFrame, so any widgets can be placed on them.
argument | value |
---|---|
master | root, frame, top-level |
width | width in px, tabs will be slightly smaller |
height | height in px, tabs will be slightly smaller |
corner_radius | corner radius in px |
border_width | border width in px |
fg_color | foreground color of the tabview itself and the tabs, tuple: (light_color, dark_color) or single color |
border_color | border color, tuple: (light_color, dark_color) or single color |
segmented_button_fg_color | foreground color of segmented button, tuple: (light_color, dark_color) or single color |
segmented_button_selected_color | selected color of segmented button, tuple: (light_color, dark_color) or single color |
segmented_button_selected_hover_color | selected hover color of segmented button, tuple: (light_color, dark_color) or single color |
segmented_button_unselected_color | unselected color of segmented button, tuple: (light_color, dark_color) or single color |
segmented_button_unselected_hover_color | unselected hover color of segmented button, tuple: (light_color, dark_color) or single color |
text_color | text color of segmented button, tuple: (light_color, dark_color) or single color |
text_color_disabled | text color of segmented buttons when widget is disabled, tuple: (light_color, dark_color) or single color |
command | function will be called when segmented button is clicked |
state | "normal" or "disabled" |
-
All attributes can be configured and updated.
-
Get values of all attributes specified as string.
-
Returns reference to tab with given name.
-
Insert tab with name at position of index, name must be unique.
-
Add tab with name at the end, name must be unique.
-
Delete tab with name.
-
Set tab with name to be visible.
-
Get name of tab that's currently visible.
CustomTkinter by Tom Schimansky 2022
The Github Wiki is outdated, the new documentation can be found at: