Python-Easy-Chess-GUI
Python-Easy-Chess-GUI copied to clipboard
install new engine causes a crash
System information
Macbook Air with M1 16GB
OS: OSX 11.0.1 Big Sur
Python: Python 3.9.1
packages:
python-chess: 1.999
pysimplegui: 4.32.1
pyperclip: 1.8.1
i clicked menu>engine>manage>install
Traceback (most recent call last):
File "/Users/nic/chess/Python-Easy-Chess-GUI/python_easy_chess_gui.py", line 3575, in <module>
main()
File "/Users/nic/chess/Python-Easy-Chess-GUI/python_easy_chess_gui.py", line 3571, in main
pecg.main_loop()
File "/Users/nic/chess/Python-Easy-Chess-GUI/python_easy_chess_gui.py", line 2859, in main_loop
window.Disable()
File "/Users/nic/miniforge3/envs/python39/lib/python3.9/site-packages/PySimpleGUI/PySimpleGUI.py", line 8537, in Disable
self.TKroot.attributes('-disabled', 1)
File "/Users/nic/miniforge3/envs/python39/lib/python3.9/tkinter/__init__.py", line 1968, in wm_attributes
return self.tk.call(args)
_tkinter.TclError: bad attribute "-disabled": must be -alpha, -fullscreen, -modified, -notify, -titlepath, -topmost, -transparent, or -type
Thanks for the info. It seems related to this issue #36 and #35.
I need to examine what happened to the PySimpleGUI framework.
If you want to experiment modify the pysimplegui.py source with the following.
def disable(self):
"""
Disables window from taking any input from the user
"""
if not self._is_window_created():
return
self.TKroot.grab_release() # Only 'disables' an already 'enabled' window. Does nothing to a normal window
# self.TKroot.attributes('-disabled', 1)
# self.TKroot.grab_set_global()
def enable(self):
"""
Re-enables window to take user input after having it be Disabled previously
"""
if not self._is_window_created():
return
self.TKroot.grab_set # I read grab_set_global messes with all open windows so I wanted to avoid that
# self.TKroot.attributes('-disabled', 0)
# self.TKroot.grab_release()
This works on windows 10, and linux, perhaps it will work too in osx.
If you want to experiment modify the pysimplegui.py source with the following.
def disable(self): """ Disables window from taking any input from the user """ if not self._is_window_created(): return self.TKroot.grab_release() # Only 'disables' an already 'enabled' window. Does nothing to a normal window # self.TKroot.attributes('-disabled', 1) # self.TKroot.grab_set_global() def enable(self): """ Re-enables window to take user input after having it be Disabled previously """ if not self._is_window_created(): return self.TKroot.grab_set # I read grab_set_global messes with all open windows so I wanted to avoid that # self.TKroot.attributes('-disabled', 0) # self.TKroot.grab_release()
This works on windows 10, and linux, perhaps it will work too in osx.
on mac osx and that worked for me ... thanks @fsmosca
There is a new commit at 41a4ae236dc0c8ba0644b8eb7cde7ad55acf8977 to try to fix this issue.
Windows: ok Linux/Ubuntu: ok mac: not tested