ScreenManager: switch back to last screen / back button helper / screen call stack
Is your feature request related to a problem? Please describe.
- I have a screen to be re-used in multiple places, thus, I cannot put simple
root.manager.currentstatic reference. - I cannot see any sort of screen call stack to be used easily to go back.
- All should work from
*.kvfile no python involved.
Describe the solution you'd like
At this point I have this implementation that works and does the job :
- On a first screen, on a button press:
on_press: root.manager.back = 'screen1'; root.manager.current = 'screen2'
- On second screen, on a button press:
on_press: root.manager.current = root.manager.back
Describe alternatives you've considered
- Not sure if fully featured Screen Call Stack is necessary, but it may help trace user behaviors.
- If that feature would lead to code unnecessary complication, then just the example from above may be added to the documentation :-)
Additional context
It would be nice and fairly trivial to have this back() functionality by default in ScreenManager. That would just need to remember current screen when current is set. current would have to be implemented as setter or getter not the property..? :-)
ScreenManager has previous() and next() functions you may try them!
👋 We use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please use our support channels to get help with the project.
If you're having trouble installing Kivy, make sure to check out the installation docs for Windows, Linux and macOS.
Let us know if this comment was made in error, and we'll be happy to reopen the issue.