TomSchimansky / CustomTkinter

A modern and customizable python UI-library based on Tkinter
MIT License
11.58k stars 1.08k forks source link

Why can CTkButton not resize dynamically according to the length of text #2540

Closed Toby1218 closed 3 months ago

Toby1218 commented 3 months ago

I am trying to make a navbar but when packing the buttons in it, all the buttons are kept at width=140px even though the length of text inside them is different. I want buttons to resize dynamically according to the length of text

dipeshSam commented 3 months ago

This isn't the case. Could you please demonstrate it?

Regards.

Akascape commented 3 months ago

@Toby1218 Try to adjust the wraplength of the button like this:

button._text_label.config(wraplength=140)