community icon indicating copy to clipboard operation
community copied to clipboard

ScreenManager: switch back to last screen / back button helper / screen call stack

Open cederom opened this issue 3 years ago • 1 comments

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.current static reference.
  • I cannot see any sort of screen call stack to be used easily to go back.
  • All should work from *.kv file no python involved.

Describe the solution you'd like

At this point I have this implementation that works and does the job :

  1. On a first screen, on a button press:
on_press: root.manager.back = 'screen1'; root.manager.current = 'screen2'
  1. 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..? :-)

cederom avatar Aug 19 '22 19:08 cederom

ScreenManager has previous() and next() functions you may try them!

drahba avatar Aug 20 '22 18:08 drahba

👋 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.

github-actions[bot] avatar Oct 31 '23 04:10 github-actions[bot]