aekarahan
aekarahan

Reputation: 39

Kivy Application - Widgets Disappear When Resizing Window Issue

Kivy users, Kivy lovers,

It's worth noting that a similar problem was reported in Kivy version 1.9.1, but it was supposedly resolved with an update. However, with the current version (2.3.0), the issue has reappeared noticeably. Therefore, please do not classify my question as previously asked. The same problem is repeating in the new version.

I'm relatively new to Kivy, having started just a few days ago. Regardless of which example code I try, or even if I attempt a simple "Hello world" application with just a single label, I'm encountering a consistent problem. Both Kivy and KivyMD exhibit the same issue.

The specific problem is that when I resize the application window, everything appears to be working initially, but after a while, all widgets disappear, leaving only a blank screen. The window remains responsive, and I can still move and resize it, but none of the widgets are visible any more.

Any insights, guidance, or potential solutions to troubleshoot and resolve this issue would be greatly appreciated.

Thanks in advance for your assistance!

I've checked and ensured the following:

pip install kivy[base] kivymd 

but got the same warning again, KivyMD version 1.2.0 outdated...

pip install git+https://github.com/kivy/kivy.git
pip install git+https://github.com/kivymd/KivyMD.git

Resizing app window ends always with following screen and widgets disappear.

SCREEN LOG:

(venv) D:\Learning\Projects\Kivy\Udemy\hello_kivymd>d:/Learning/Projects/Kivy/Udemy/hello_kivymd/venv/Scripts/python.exe d:/Learning/Projects/Kivy/Udemy/hello_kivymd/hello/hello.py
[INFO   ] [Logger      ] Record log in C:\Users\eakar\.kivy\logs\kivy_24-01-24_7.txt
[INFO   ] [deps        ] Successfully imported "kivy_deps.angle" 0.4.0
[INFO   ] [deps        ] Successfully imported "kivy_deps.glew" 0.3.1
[INFO   ] [deps        ] Successfully imported "kivy_deps.sdl2" 0.7.0
[INFO   ] [Kivy        ] v3.0.0.dev0
[INFO   ] [Kivy        ] Installed at "d:\Learning\Projects\Kivy\Udemy\hello_kivymd\venv\Lib\site-packages\kivy\__init__.py"
[INFO   ] [Python      ] v3.12.1 (tags/v3.12.1:2305ca5, Dec  7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)]
[INFO   ] [Python      ] Interpreter at "d:\Learning\Projects\Kivy\Udemy\hello_kivymd\venv\Scripts\python.exe"
[INFO   ] [Logger      ] Purge log fired. Processing...
[INFO   ] [Logger      ] Purge finished!
[INFO   ] [KivyMD      ] 2.0.1.dev0, git-ab67546, 2024-01-23 (installed at "d:\Learning\Projects\Kivy\Udemy\hello_kivymd\venv\Lib\site-packages\kivymd\__init__.py")
[INFO   ] [Factory     ] 195 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: sdl2
[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.6.0 Compatibility Profile Context 22.20.27.09.230330'>
[INFO   ] [GL          ] OpenGL vendor <b'ATI Technologies Inc.'>
[INFO   ] [GL          ] OpenGL renderer <b'Radeon RX 5500 XT'>
[INFO   ] [GL          ] OpenGL parsed version: 4, 6
[INFO   ] [GL          ] Shading version <b'4.60'>
[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   ] [Clipboard   ] Provider: winctypes
[INFO   ] [GL          ] NPOT texture support is available
[INFO   ] [Base        ] Start application main loop
[INFO   ] [KivyMD      ] Color scheme generation. Get a color scheme from an installed palette - 0.004485299999942072 sec.
 Exception ignored on calling ctypes callback function: <bound method _WindowsSysDPIWatch._wnd_proc of <kivy.core.window.window_sdl2._WindowsSysDPIWatch object at 0x00000290FB4F2F90>>
 Traceback (most recent call last):
   File "d:\Learning\Projects\Kivy\Udemy\hello_kivymd\venv\Lib\site-packages\kivy\core\window\window_sdl2.py", line 998, in _wnd_proc
     return windll.user32.CallWindowProcW(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 OSError: exception: access violation reading 0x000002909F58E3A8
[INFO   ] [Base        ] Leaving application in prog

AND the content of kivy_24-01-24_7.txt file mentioned above

[INFO   ] Logger: Record log in C:\Users\eakar\.kivy\logs\kivy_24-01-24_7.txt
[INFO   ] deps: Successfully imported "kivy_deps.angle" 0.4.0
[INFO   ] deps: Successfully imported "kivy_deps.glew" 0.3.1
[INFO   ] deps: Successfully imported "kivy_deps.sdl2" 0.7.0
[INFO   ] Kivy: v3.0.0.dev0
[INFO   ] Kivy: Installed at "d:\Learning\Projects\Kivy\Udemy\hello_kivymd\venv\Lib\site-packages\kivy\__init__.py"
[INFO   ] Python: v3.12.1 (tags/v3.12.1:2305ca5, Dec  7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)]
[INFO   ] Python: Interpreter at "d:\Learning\Projects\Kivy\Udemy\hello_kivymd\venv\Scripts\python.exe"
[INFO   ] Logger: Purge log fired. Processing...
[INFO   ] Logger: Purge finished!
[INFO   ] KivyMD: 2.0.1.dev0, git-ab67546, 2024-01-23 (installed at "d:\Learning\Projects\Kivy\Udemy\hello_kivymd\venv\Lib\site-packages\kivymd\__init__.py")
[INFO   ] Factory: 195 symbols loaded
[INFO   ] Image: Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO   ] Text: Provider: sdl2
[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.6.0 Compatibility Profile Context 22.20.27.09.230330'>
[INFO   ] GL: OpenGL vendor <b'ATI Technologies Inc.'>
[INFO   ] GL: OpenGL renderer <b'Radeon RX 5500 XT'>
[INFO   ] GL: OpenGL parsed version: 4, 6
[INFO   ] GL: Shading version <b'4.60'>
[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   ] Clipboard: Provider: winctypes
[INFO   ] GL: NPOT texture support is available
[INFO   ] Base: Start application main loop
[INFO   ] KivyMD: Color scheme generation. Get a color scheme from an installed palette - 0.004485299999942072 sec.
[WARNING] stderr: Exception ignored on calling ctypes callback function: <bound method _WindowsSysDPIWatch._wnd_proc of <kivy.core.window.window_sdl2._WindowsSysDPIWatch object at 0x00000290FB4F2F90>>
[WARNING] stderr: Traceback (most recent call last):
[WARNING] stderr:   File "d:\Learning\Projects\Kivy\Udemy\hello_kivymd\venv\Lib\site-packages\kivy\core\window\window_sdl2.py", line 998, in _wnd_proc
[WARNING] stderr:     return windll.user32.CallWindowProcW(
[WARNING] stderr:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[WARNING] stderr: OSError: exception: access violation reading 0x000002909F58E3A8
[INFO   ] Base: Leaving application in progress...

Upvotes: 0

Views: 201

Answers (1)

EGarbus
EGarbus

Reputation: 291

KivyMD has updated to 2.0 and added that warning message. It is fine to continue to use 1.20. See: https://github.com/kivymd/KivyMD?tab=readme-ov-file#installation

KivyMD 2.0.0 is not yet up on PyPI. I suggest using KivyMD 1.2 until the kivymd 2.0 version docs are up and the code is available from Pypi.

Upvotes: 0

Related Questions