kcauto icon indicating copy to clipboard operation
kcauto copied to clipboard

kcauto does not start on macOS

Open cplusx opened this issue 5 years ago • 5 comments

  • kcauto version (version on first line of CHANGELOG.md):v8.0.0-rc1
  • Operating system and/or VM: MacOS catalina

Is the issue consistent (can be reproduced consistently) or is it intermittent (only happens sometimes)?: Yes

Please provide a thorough description of the issue. Screenshots, videos, or at least a step-by-step description of what is happening in the game is typically necessary to debug. line self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) pops error _tkinter.TclError: unknown option "-relief". My python is 3.7.5, tkinter version 3.6.8

Log

python3 kcauto -cli
[2019-12-02 21:08:31] Initializing kcauto vv8.0.0-rc1 GUI.
[2019-12-02 21:08:31] Starting kcauto GUI.
Traceback (most recent call last):
  File "/Users/jiaxincheng/anaconda3/envs/kcauto/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/jiaxincheng/anaconda3/envs/kcauto/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "kcauto/__main__.py", line 29, in <module>
    gui_main()
  File "kcauto/kcauto_gui.py", line 59, in gui_main
    update_gui(window, event, values)
  File "kcauto/kcauto_gui.py", line 173, in update_gui
    LayoutBase.update_widgets(window)
  File "kcauto/gui/layout_base.py", line 181, in update_widgets
    window[element].Widget.configure(relief='flat')
  File "/Users/jiaxincheng/anaconda3/envs/kcauto/lib/python3.7/tkinter/__init__.py", line 1485, in configure
    return self._configure('configure', cnf, kw)
  File "/Users/jiaxincheng/anaconda3/envs/kcauto/lib/python3.7/tkinter/__init__.py", line 1476, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: unknown option "-relief"

cplusx avatar Dec 03 '19 05:12 cplusx

Likely due to You are running on OSX, and that OS has strict guidelines for the appearance of buttons. You can't change the relief on buttons on OSX.

Source: https://stackoverflow.com/a/45035271

perryhuynh avatar Dec 03 '19 06:12 perryhuynh

kcauto is largely untested on OSX. That said, for your current issue you can remove the two lines here:

https://github.com/mrmin123/kcauto/blob/master/kcauto/gui/layout_base.py#L180-L181

and run it again.

mrmin123 avatar Dec 03 '19 06:12 mrmin123

The relief issue is solved, but got another tkinter error _tkinter.TclError: unknown option "-fg" Do you have any idea about which file should I locate? I searched for keyword, there is no explicit assignment of fg=xxx

cplusx avatar Dec 03 '19 06:12 cplusx

the CLI should run without issues, the flag is --cli you were missing a -

as for the -fg option, theres multiple usages of it in config_tab_buttons.py and gui_tab_buttons.py

In order to get it running on OSX you may need to also install pyobjc

perryhuynh avatar Dec 03 '19 06:12 perryhuynh

Note that PySimpleGUI Buttons recently changed for the Mac. They are no longer tk.Button but instead ttk.Button. You can force them to be either one but for the Mac the default is ttk buttons. If using the .Widget extension of PySimpleGUI then you'll likely run into problems if originally used the settings using tk.Button parameters.

PySimpleGUI avatar Dec 06 '19 17:12 PySimpleGUI