Skip to content

v1.5.4

Choose a tag to compare

@ColonelPanicX ColonelPanicX released this 14 Apr 02:38
· 67 commits to main since this release

Fix window icon (fourth attempt — different root cause than assumed).

Previous attempts all used ICO format via wm_iconbitmap, which was silently failing in the PyInstaller bundle at runtime. Root cause: tk's wm iconbitmap appears to reject the encoded ICO, the exception is swallowed, and CTk's default blue square wins.

New approach:

  • Generate a 16×16 RGBA PNG at runtime using stdlib struct + zlib (no encoding surprises — structurally guaranteed valid)
  • Block CTk's scheduled after(200) callback by setting _iconbitmap_method_called = True immediately after super().__init__()
  • Set icon via iconphoto() with the generated PhotoImage (PNG-native in Tk 8.6+, which ships with all modern Python/Windows builds)