Skip to content

Dynamic configuration of CTkLabel wraplength not working on dual monitor setup #2681

Answered by dipeshSam
debicarroll asked this question in Q&A
Discussion options

You must be logged in to vote

@debicarroll You are right. The wrap="word" parameter is only supported in Text widget, not in Label. If you want responsive text area for the application then it is recommended to use Text widget instead of Label in tkinter or customtkinter. Although, I wrote a fully wrap-supportive label class for customtkinter. Here it is:

from customtkinter import (
    CTk,
    CTkFont,
    AppearanceModeTracker,
    ThemeManager
)
from tkinter import Event, Label


class WrappableLabel(Label):
    def __init__(self, 
        master=None, 
        text: str = "Sample Text",
        fg_color: str | tuple[str, str] = None,
        text_color: str | tuple[str, str] = None,
        font: CTkFont | tuple[str

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@debicarroll
Comment options

@dipeshSam
Comment options

@debicarroll
Comment options

Comment options

You must be logged in to vote
2 replies
@debicarroll
Comment options

@dipeshSam
Comment options

Answer selected by debicarroll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants