You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from kivy.config import Config
Config.set('kivy', 'exit_on_escape', 0)
from kivy.base import EventLoop
EventLoop.ensure_window()
Config.set('kivy', 'exit_on_escape', 1)
You'll get the following exception:
Config.set('kivy', 'exit_on_escape', 1)
File "C:\kivy-dev\kivy\kivy\config.py", line 313, in set
self._do_callbacks(section, option, value)
File "C:\kivy-dev\kivy\kivy\config.py", line 278, in _do_callbacks
callback(section, key, value)
File "C:\kivy-dev\kivy\kivy\core\window\__init__.py", line 801, in __exit
WindowBase.on_keyboard.exit_on_escape = value
AttributeError: 'instancemethod' object has no attribute 'exit_on_escape'
This post seems to describe why this is happening: https://stackoverflow.com/questions/7034063/adding-attributes-to-instancemethods-in-python. From there the fix seems to be to change WindowBase.on_keyboard.exit_on_escape = value to WindowBase.on_keyboard.__func__.exit_on_escape = value. However, they also seem to imply that it is different between python 2 and 3, so I'm not sure that is the proper fix.
The text was updated successfully, but these errors were encountered:
If you run the following code:
You'll get the following exception:
This post seems to describe why this is happening: https://stackoverflow.com/questions/7034063/adding-attributes-to-instancemethods-in-python. From there the fix seems to be to change
WindowBase.on_keyboard.exit_on_escape = value
toWindowBase.on_keyboard.__func__.exit_on_escape = value
. However, they also seem to imply that it is different between python 2 and 3, so I'm not sure that is the proper fix.The text was updated successfully, but these errors were encountered: