Python-Easy-Chess-GUI icon indicating copy to clipboard operation
Python-Easy-Chess-GUI copied to clipboard

Thank you for writing this!

Open PySimpleGUI opened this issue 6 years ago • 3 comments

Really appreciate you taking the time to make this game (and using PySimpleGUI in the process). I use it a lot as a successful example. The screenshots in your readme are awesome. Thanks for your hard work!

PySimpleGUI avatar Feb 08 '20 16:02 PySimpleGUI

Thanks for your PySimpleGUI and the chess demo, without it, it would have been too long for me to get a working chess GUI in python.

I am currently looking on the issue of Linux support. I am using WSLinux on windows 10.

  • GUI is generally ok, but there are minor issues.

  • Major issue is window.Disable() (linux tkinter does not like it but windows is ok) when you change engine opponent for example. I saw this was mentioned in PySimpleGUI but have not checked its status yet.
Traceback (most recent call last):
  File "python_easy_chess_gui.py", line 3492, in <module>
    main()
  File "python_easy_chess_gui.py", line 3488, in main
    pecg.main_loop()
  File "python_easy_chess_gui.py", line 3196, in main_loop
    window.Disable()
  File "/usr/local/lib/python3.7/dist-packages/PySimpleGUI/PySimpleGUI.py", line 6279, in Disable
    self.TKroot.attributes('-disabled', 1)
  File "/usr/lib/python3.7/tkinter/__init__.py", line 1788, in wm_attributes
    return self.tk.call(args)
_tkinter.TclError: bad attribute "-disabled": must be -alpha, -topmost, -zoomed, -fullscreen, or -type

This is on PySimpleGUI v4.14.1

fsmosca avatar Feb 09 '20 03:02 fsmosca

I'll have to look, but I think that problem with disable is fixed in 4.15.

Also, Linux icons must be PNGs, not ICOs. Or maybe GIFs. I just recall that ICO file don't work with Linux. Maybe something I should document if it's not in there now.

Let me know any other problems you run into and you'll get priority support!

PySimpleGUI avatar Feb 09 '20 04:02 PySimpleGUI

Thanks, png icons for linux are working.

Still there is issue in window.Disable() with PSG v4.15.2, both in Python 3.6 and 3.7 on win10 WSLinux Ubuntu 18.04.

For Python 3.7.6

Traceback (most recent call last):
  File "python_easy_chess_gui.py", line 3534, in <module>
    main()
  File "python_easy_chess_gui.py", line 3530, in main
    pecg.main_loop()
  File "python_easy_chess_gui.py", line 2827, in main_loop
    window.Disable()
  File "/home/ubu2019/.local/lib/python3.7/site-packages/PySimpleGUI/PySimpleGUI.py", line 6379, in Disable
    self.TKroot.attributes('-disabled', 1)
  File "/usr/lib/python3.7/tkinter/__init__.py", line 1788, in wm_attributes
    return self.tk.call(args)
_tkinter.TclError: bad attribute "-disabled": must be -alpha, -topmost, -zoomed, -fullscreen, or -type

fsmosca avatar Feb 09 '20 12:02 fsmosca

At the moment, the issue on _tkinter.TclError: bad attribute "-disabled": must be -alpha, -topmost, -zoomed, -fullscreen, or -type is fixed. I use Hide()/UnHide instead of Disable/Enable. The disadvantage is that hiding the window will hide the GUI. But this is better than crashing the GUI in linux and perhaps mac.

fsmosca avatar Dec 02 '22 01:12 fsmosca

Current display in windows 10.

image

WSL - Ubuntu 20.04

image

fsmosca avatar Dec 02 '22 01:12 fsmosca

the window.disable() is not working for me in linux, can anyone point out possible alternatives for this thing ?

ahmadmousily avatar Jan 13 '23 09:01 ahmadmousily

Just use the latest script. window.disable is now replaced by hide/unhide.

fsmosca avatar Jan 23 '23 17:01 fsmosca

I know that hide/unhide works on links, but i don't want the first window to get hidden I want it to be there and disabled, as the user have to take some data from it.

ahmadmousily avatar Jan 24 '23 09:01 ahmadmousily