CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

font argument not allowing multiple "<optional keywords>"

Open EN20M opened this issue 2 years ago • 1 comments
trafficstars

Since 5.0.0 having more than one optional keyword isn't supported anmore:

ctk.CTkLabel(self, text="Label", font=("default_font", 10, "bold", "underline"), anchor='w', width=0)

this gives an error. There isn't any reason obvious to me why this shouldn't be allowed. Expanding _apply_font_scaling() and _check_font_type() to support two optional arguments works just fine but I sea no reason why this shouldn't even work with as many optionals a one would like.

EN20M avatar Dec 05 '22 09:12 EN20M

I dient even know it was possible to put them into separate strings, I always put them into one string (the third string in the tuple). In tkinter there are so many possibilities to manipulate the arguments, in my opinion this is a mess. There should only be one way and it should be consistent. But I can add this possibility.

But I would prefer to use the new CTkFont class anyways. Because there you only have to pass the arguments you want to change and everything else will be default, which is not the case for the tuple.

TomSchimansky avatar Dec 05 '22 13:12 TomSchimansky

Well as you didn't know they go in separate strings I didn't know they can go in one. I am totaly with you that there should not be different ways for doing the same thing. I'll try to make the change to CTkFonts and untill then I'll be fine with merging those strings into one.

By the way thank you for all the great work you put into this

EN20M avatar Dec 06 '22 09:12 EN20M

Multiple style strings are now possible with version 5.0.2.

TomSchimansky avatar Dec 06 '22 22:12 TomSchimansky