Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-think the TK GUI in the light of the new TK v9.0! #829

Open
otizonaizit opened this issue Oct 4, 2024 · 6 comments
Open

Re-think the TK GUI in the light of the new TK v9.0! #829

otizonaizit opened this issue Oct 4, 2024 · 6 comments

Comments

@otizonaizit
Copy link
Member

27 years after its last release, a new release of TCL/TK is out:
https://www.tcl-lang.org/software/tcltk/9.0.html
it seems to support a lot of the stuff we always wanted, including better unicode, SVG and scalable graphics.
I don't know when this will be available in Python, but it may save us the trouble of migrating to a different toolkit altogether.

@Debilski
Copy link
Member

Debilski commented Oct 4, 2024

Remains to be seen if this gives us anti-aliasing and predictable button colours.

@Debilski
Copy link
Member

Debilski commented Oct 4, 2024

Built-in widgets and themes are scaling-aware

Sounds good. Unfortunately no info on whether the Tk canvas has anti-aliasing on non macOS systems and how well its alpha-channel capabilities work.

@Debilski
Copy link
Member

Anti-aliasing is still not here but SVG works with Tk 9.0. It does look indeed a bit more defined than what we have been doing manually with the ghost ‘feet’. (But maybe it would be possible to improve on our solution as well.)

Screenshot from 2024-11-15 14-02-32

NB: This is not the final ghost design, it is just the SVG I had lying around for the web viewer. We can still decide to have it as close to ‘our’ design as possible.

@Debilski
Copy link
Member

Slight problem: Tkinter needs the external library; we may have to support both versions in parallel until all systems have upgraded to 9.0.

@otizonaizit
Copy link
Member Author

Well, in any case we can't proceed until this is fixed python/cpython#124111

And even then, this may mean that we have to drop compatibility with Python <=3.13... Not sure how we can do it. Supporting both the old and the new TK seems like a lot of work in an area of pelita that is already very messy?

@Debilski
Copy link
Member

Simply plugging in SVG graphics for the sprites when Tk9 is available, while keeping the old implementation around, is probably doable. But yeah, any change greater than that will become painful. (Plus there needs to be some testing: Should the walls also become SVG? If so, how long does it take to generate and render them.)

We should probably target the stateless rewrite that I’ve sketched in #819 first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants