LoloCG / Sample-KivyMD-Apps

My Kivy and KivyMD sample application templates, that can be used for my personal projects for deployment using python language on multiplatform.
0 stars 0 forks source link

BUG: page history bug when repeating page. #2

Open LoloCG opened 1 day ago

LoloCG commented 1 day ago

Not sure how, but returning to a duplicate page makes the application crash

LoloCG commented 1 day ago

The error occurs:

Error message:


   File "c:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\BottomNavBar\kivy_app.py", line 166, in <module>
     MainApp().run()
   File "C:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\venv\Lib\site-packages\kivy\app.py", line 956, in run
     runTouchApp()
   File "C:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\venv\Lib\site-packages\kivy\base.py", line 574, in runTouchApp
     EventLoop.mainloop()
   File "C:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\venv\Lib\site-packages\kivy\base.py", line 339, in mainloop
     self.idle()
   File "C:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\venv\Lib\site-packages\kivy\base.py", line 383, in idle
     self.dispatch_input()
   File "C:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\venv\Lib\site-packages\kivy\base.py", line 334, in dispatch_input
     post_dispatch_input(*pop(0))
   File "C:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\venv\Lib\site-packages\kivy\base.py", line 263, in post_dispatch_input
     listener.dispatch('on_motion', etype, me)
   File "kivy\\_event.pyx", line 731, in kivy._event.EventDispatcher.dispatch
   File "C:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\venv\Lib\site-packages\kivy\core\window\__init__.py", line 1709, in on_motion
     self.dispatch('on_touch_down', me)
   File "kivy\\_event.pyx", line 731, in kivy._event.EventDispatcher.dispatch
   File "C:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\venv\Lib\site-packages\kivy\core\window\__init__.py", line 1726, in on_touch_down
     if w.dispatch('on_touch_down', touch):
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "kivy\\_event.pyx", line 731, in kivy._event.EventDispatcher.dispatch
   File "C:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\venv\Lib\site-packages\kivy\uix\widget.py", line 589, in on_touch_down
     if child.dispatch('on_touch_down', touch):
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "kivy\\_event.pyx", line 731, in kivy._event.EventDispatcher.dispatch
   File "C:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\venv\Lib\site-packages\kivy\uix\widget.py", line 589, in on_touch_down
     if child.dispatch('on_touch_down', touch):
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "kivy\\_event.pyx", line 731, in kivy._event.EventDispatcher.dispatch
   File "C:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\venv\Lib\site-packages\kivy\uix\widget.py", line 589, in on_touch_down
     if child.dispatch('on_touch_down', touch):
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "kivy\\_event.pyx", line 731, in kivy._event.EventDispatcher.dispatch
   File "C:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\venv\Lib\site-packages\kivy\uix\widget.py", line 589, in on_touch_down
     if child.dispatch('on_touch_down', touch):
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "kivy\\_event.pyx", line 731, in kivy._event.EventDispatcher.dispatch
   File "C:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\venv\Lib\site-packages\kivymd\uix\behaviors\ripple_behavior.py", line 361, in on_touch_down
     super().on_touch_down(touch)
   File "C:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\venv\Lib\site-packages\kivy\uix\behaviors\button.py", line 151, in on_touch_down
     self.dispatch('on_press')
   File "kivy\\_event.pyx", line 727, in kivy._event.EventDispatcher.dispatch
   File "kivy\\_event.pyx", line 1307, in kivy._event.EventObservers.dispatch
   File "kivy\\_event.pyx", line 1191, in kivy._event.EventObservers._dispatch
   File "C:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\venv\Lib\site-packages\kivy\lang\builder.py", line 60, in custom_callback
     exec(__kvlang__.co_value, idmap)
   File "c:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\BottomNavBar\main_layout.kv", line 16, in <module>
     on_press: app.go_back_screen()
 ^^^^^^^^
   File "c:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\BottomNavBar\kivy_app.py", line 109, in go_back_screen
     self.sm.remove_widget(self.sm.get_screen(recent_screen))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "C:\Users\Lolo\Desktop\Programming\GITRepo\SampleKivyApp\venv\Lib\site-packages\kivy\uix\screenmanager.py", line 1078, in get_screen
     raise ScreenManagerException('No Screen with name "%s".' % name)
 kivy.uix.screenmanager.ScreenManagerException: No Screen with name "None".```

the logs shown in terminal:
```Loading screen "home_screen"
In screen "home_screen"
Added home_screen to manager.
[INFO   ] [Base        ] Start application main loop
Switching to screen: second_screen
Loading screen second_screen
Adding SecondScreen layout
Added second_screen to manager.
In screen second_screen
Leaving home_screen.
Switching to screen: third_screen
Loading screen third_screen
Adding SecondScreen layout
Added third_screen to manager.
In screen third_screen
Leaving second_screen.
Switching to screen: second_screen
Loading screen second_screen
Adding SecondScreen layout
Added second_screen to manager.
In screen second_screen
Leaving third_screen.
Switching to screen: third_screen
Loading screen third_screen
Adding SecondScreen layout
Added third_screen to manager.
In screen third_screen
Leaving second_screen.
Going back to screen: third_screen
Going back to screen: second_screen
Loading screen second_screen
Adding SecondScreen layout
In screen second_screen
Added second_screen to manager.
[INFO   ] [Base        ] Leaving application in progress...```