Content Widget with history

Thank you very much for Textual, it’s awesome.

However I am struggling to get a simple app layout working:

  • Header
  • Content
  • Footer

Initially the ”Content” should be a simple list of buttons, each of them leading to a subpage.

I managed to do this with push_screen but this feels like duplication of Header and Footer. Is this the go-to way to do this? Benefit is that with pop_screen you automatically have a Back-functionality.

How do you dynamically change the content of a Container e.g.? Looping over children and removing them? Manually maintaining a stack of content, them selectively hiding them (is_visible=False?).

Or is there something like a SubScreen (like an <iframe> in HTML)?

I’ve partially solved it now with a custom Container that maintains a list of displayed contents and can push and pop that list and styles.display = "none" and styles.display ="block" all children as needed. However, a weird scrollbar flicker happens and it seems this is not the way to do this.

Got rid of the weird scrollbar flicker by first setting styles.display = "none" before widget.remove().