Skip to content

Fix _tkinter.TclError when on MacOS#283

Open
RemoteCTO wants to merge 3 commits intooscarpilote:masterfrom
RemoteCTO:master
Open

Fix _tkinter.TclError when on MacOS#283
RemoteCTO wants to merge 3 commits intooscarpilote:masterfrom
RemoteCTO:master

Conversation

@RemoteCTO
Copy link

The .trace method is (being) deprecated in favour of .trace_add, and references to "ButtonPress-2" are now "ButtonPress-3"

See the following for more info: https://github.com/orgs/Homebrew/discussions/5809

@w8sl
Copy link

w8sl commented Jan 8, 2025

Thank you for PR!

Usage of TCL9 is inconsistent at the moment. Python.org and
GitHub runners are still on TCL8. Therefore, it may be better to fix buttons as recommended in discussion:

if "dar" in sys.platform and tk.TkVersion < 9:
            self.canvas.bind("<ButtonPress-2>", self.scroll_start)
            self.canvas.bind("<B2-Motion>", self.scroll_move)
            self.canvas.bind("<Control-ButtonPress-2>", self.delPol)

@RemoteCTO
Copy link
Author

@w8sl - Ah yes good point, I'll flip it over to that instead.

NB: There is one weird quirk I'm noticing in my local version of this, which is that it doesn't seem to persist the last selected square when closing and re-opening the app. Though I can't confirm yet if it's related.

@w8sl
Copy link

w8sl commented Jan 8, 2025

Cannot reproduce. Tested patched version of O4XP on Sequoia with all latest requirements (no versions) with Python 3.11, 3.12, 3.13

@w8sl
Copy link

w8sl commented Jan 8, 2025

brew reinstall python-tk (to get fixed version)

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

Successfully merging this pull request may close these issues.

2 participants