Я делаю цифровую клавиатуру (для моего решения судоку) с помощью kivy VKeyboard.
Я сделал файл json, и он отлично работал, но я могу перемещать его с помощью мыши.
Я читал о закрепленном режиме ( kivy VKeyboard ), но когда я добавляю "docked: True". выдает ошибку.
Как правильно использовать закрепленный режим?
Киви сценарий
Main:
VKeyboard:
layout: "numeric.json"
docked: True
ошибка:
[INFO ] [Logger ] Record log in C:\Users\...\.kivy\logs\kivy_18-08-28_20.txt
[INFO ] [Kivy ] v1.10.1
[INFO ] [Python ] v3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]
[INFO ] [Factory ] 194 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] GLEW initialization succeeded
[INFO ] [GL ] Backend used <glew>
[INFO ] [GL ] OpenGL version <b'4.5.0 - Build 22.20.16.4836'>
[INFO ] [GL ] OpenGL vendor <b'Intel'>
[INFO ] [GL ] OpenGL renderer <b'Intel(R) HD Graphics 620'>
[INFO ] [GL ] OpenGL parsed version: 4, 5
[INFO ] [GL ] Shading version <b'4.50 - Build 22.20.16.4836'>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <32>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [Text ] Provider: sdl2
Traceback (most recent call last):
File "C:\Users\...\Anaconda3\lib\site-packages\kivy\lang\builder.py", line 619, in _apply_rule
setattr(widget_set, key, value)
File "kivy\weakproxy.pyx", line 33, in kivy.weakproxy.WeakProxy.__setattr__
File "kivy\properties.pyx", line 483, in kivy.properties.Property.__set__
File "kivy\properties.pyx", line 524, in kivy.properties.Property.set
File "kivy\properties.pyx", line 579, in kivy.properties.Property.dispatch
File "kivy\_event.pyx", line 1214, in kivy._event.EventObservers.dispatch
File "kivy\_event.pyx", line 1120, in kivy._event.EventObservers._dispatch
File "C:\Users\...\Anaconda3\lib\site-packages\kivy\uix\vkeyboard.py", line 466, in setup_mode
self.setup_mode_dock()
File "C:\Users\...\Anaconda3\lib\site-packages\kivy\uix\vkeyboard.py", line 485, in setup_mode_dock
scale = win.width / float(self.width)
AttributeError: 'NoneType' object has no attribute 'width'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/DATA/.../Programmeren/Sudoku/test kivy.py", line 15, in <module>
kivy_file = Builder.load_file("test kivy.kv")
File "C:\Users\...\Anaconda3\lib\site-packages\kivy\lang\builder.py", line 301, in load_file
return self.load_string(data, **kwargs)
File "C:\Users\...\Anaconda3\lib\site-packages\kivy\lang\builder.py", line 400, in load_string
self._apply_rule(widget, parser.root, parser.root)
File "C:\Users\...\Anaconda3\lib\site-packages\kivy\lang\builder.py", line 630, in _apply_rule
e), cause=tb)
kivy.lang.builder.BuilderException: Parser: File "C:\DATA\...\Programmeren\Sudoku\test kivy.kv", line 4:
...
2: VKeyboard:
3: layout: "numeric.json"
>> 4: docked: True
...
AttributeError: 'NoneType' object has no attribute 'width'
File "C:\Users\...\Anaconda3\lib\site-packages\kivy\lang\builder.py", line 619, in _apply_rule
setattr(widget_set, key, value)
File "kivy\weakproxy.pyx", line 33, in kivy.weakproxy.WeakProxy.__setattr__
File "kivy\properties.pyx", line 483, in kivy.properties.Property.__set__
File "kivy\properties.pyx", line 524, in kivy.properties.Property.set
File "kivy\properties.pyx", line 579, in kivy.properties.Property.dispatch
File "kivy\_event.pyx", line 1214, in kivy._event.EventObservers.dispatch
File "kivy\_event.pyx", line 1120, in kivy._event.EventObservers._dispatch
File "C:\Users\...\Anaconda3\lib\site-packages\kivy\uix\vkeyboard.py", line 466, in setup_mode
self.setup_mode_dock()
File "C:\Users\...\Anaconda3\lib\site-packages\kivy\uix\vkeyboard.py", line 485, in setup_mode_dock
scale = win.width / float(self.width)