Skip to content

TK to TTK Overhaul #2116

Open
Open

Description

@Rixxan

A number of locations in the code eschew the TTK library and continue to use the original "tk" library. This holds us back from supporting custom themes as well as breaks a few things. That, and TK in general is just... awful to work with.

We should migrate as much of the styling code as possible from tk to ttk.

And redo theme.py while we're at it.

Activity

  1. added this to the 6.0.0 milestone on Dec 28, 2023
  2. ElSaico commented on May 15, 2024

    @ElSaico
    Contributor

    As said on Discord, I propose the use of CustomTkinter as a semi-drop-in replacement. My arguments:

    • It's extremely light on dependencies (darkdetect is self-explanatory and packaging is used for version detection logic; neither depends on anything else)
    • The API avoids deviating from standard Tk as much as possible
    • Well-maintained
    • Reasonably popular (~10k stars, supported by many other libraries)
    • Modernized widgets - while still supporting the original Tkinter ones
    • Automatic HiDPI scaling - though the factor can be overridden if so desired
    • Perhaps the most important of all: a painless theming support (fully configurable via .json files)
  3. ElSaico commented on May 23, 2024

    @ElSaico
    Contributor

    Option B: https://ttkbootstrap.readthedocs.io/en/latest/
    Less popular but still nothing to scoff at with ~1.7k stars - and the documentation is much nicer.

    The only dependency is Pillow, which is already on develop anyway.

    EDIT: the latest release does not work with Pillow 10.x - which means no Python 3.12 either; although it's fixed on master (see: israel-dryer/ttkbootstrap#490), the dev has been AWOL for a while.

  4. ElSaico commented on May 23, 2024

    @ElSaico
    Contributor

    CTk's scaling code stumbles upon an ancient Tk bug in some locales: TomSchimansky/CustomTkinter#571

    Although there's a fix on the comments, facing such an issue from the outset - after both libraries gave me hope to start tackling our UI nightmare - just makes me want to yeet anything Tkinter-based into an active volcano.

  5. linked a pull request that will close this issueTtk-based theming #2241on Jun 9, 2024
  6. modified the milestones: 6.0, 5.12 on Jun 10, 2024
  7. added a commit that references this issue on Apr 30, 2025
  8. self-assigned this
    on Nov 10, 2025
  9. added a commit that references this issue on Nov 12, 2025
  10. Rixxan commented on Nov 12, 2025

    @Rixxan
    ContributorAuthor

    After #2525, the following files still have old TK elements that (in theory) could be reformatted to TTK:

    • tk.Widget: theme.py, plug.py
    • tk.Button: prefs.py, theme.py, click_counter\load.py
    • tk.Entry: theme.py, prefs.py
    • tk.Frame: ttkHyperlinkLabel.py, EDMarketConnector.py, plug.py, theme.py, click_counter\load.py, eddn.py
    • tk.Label: EDMarketConnector.py, journal_lock.py, stats.py, ttkHyperlinkLabel.py, click_counter\load.py
    • tk.Scale: prefs.py
  11. modified the milestones: 6.0, Post-6.0 Changes on Dec 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions