Change font of CTkTabview #709
-
How can I change the font size of CTkTabview? Can I frame the frame background color of a specific tab in CTkTabview? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
The font can not be configured at the moment, but you can configure a specific frame with: |
Beta Was this translation helpful? Give feedback.
-
Is there an update on this? It really messes up the look of the UI when things like tab names and frame names don't match the font used on the rest of the UI. |
Beta Was this translation helpful? Give feedback.
-
Hi, 2024 here, We would love an update for this. Thanks |
Beta Was this translation helpful? Give feedback.
-
@Hancie123 , @PrizeGotti , @mromrell You can simply achieve it by updating font of internal from customtkinter import CTk, CTkTabview
from customtkinter import CTkFont
def apply_font_to_tabs(tabs: CTkTabview, font: CTkFont | tuple):
"""Applies given `font` either tuple or `CTkFont` to tab names."""
tabs._segmented_button.configure(font=font)
if __name__ == "__main__":
app = CTk()
app.geometry("500x300")
tabs = CTkTabview(app)
tabs.place(relx=0.5, anchor="center", rely=0.5)
apply_font_to_tabs(tabs, ("Impact", 15))
tabs.add("Tab 1")
tabs.add("Tab 2")
tabs.add("Tab 3")
app.mainloop() Regards |
Beta Was this translation helpful? Give feedback.
The font can not be configured at the moment, but you can configure a specific frame with:
tabview.tab("tab_name").configure(...)
Maybe I will add font attribute to the tabview.