TomSchimansky / CustomTkinter

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

Fixed locale-dependent canvas scaling bug #2468

Open ElSaico opened 3 weeks ago

ElSaico commented 3 weeks ago

Closes #571

Currently CTk does not run at all under some locales (such as German and Portuguese) because the widget scaling triggers an ancient Tk canvas bug.

This solution is not mine - it was posted a while ago on the issue comments - but I documented it and added a locale on the scaling integration tests to detect regressions.

ElSaico commented 3 weeks ago

Some helpful background:

There's this app, EDMarketConnector - best known as EDMC - which has a Tkinter UI, a reasonably large userbase and a history that stretches back to the late Python 2 days. It also has a set of homebrew themes, but it's a maintenance nightmare which mostly inviabilizes the use of ttk stuff... so eventually I volunteered to deal with this.

Since the majority of its appeal is on its plugin ecosystem - in fact, facing ttk issues while starting out a plugin was my motivation - leaving Tkinter is the absolute last choice. CTk was my first pick because it's mature, well-supported and has a very streamlined theming system, but finding this bug was a dealbreaker; so off to ttk styles I went!

Despite the advances so far, there's some weird bugs on the way, and I suspect that part of it is the OS-specific stuff that's hard to understand and is handled by CTk already, so why not make a small contribution to fix what stopped me before?