Ortho4XP icon indicating copy to clipboard operation
Ortho4XP copied to clipboard

Fix _tkinter.TclError when on MacOS

Open RemoteCTO opened this issue 1 year ago • 4 comments

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

RemoteCTO avatar Jan 08 '25 11:01 RemoteCTO

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)

w8sl avatar Jan 08 '25 13:01 w8sl

@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.

RemoteCTO avatar Jan 08 '25 14:01 RemoteCTO

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

w8sl avatar Jan 08 '25 15:01 w8sl

brew reinstall python-tk (to get fixed version)

w8sl avatar Jan 08 '25 15:01 w8sl