Closed willmcgugan closed 2 weeks ago
It looks like you've already pushed this feature to main, but perhaps before/after params similar to mount
could be useful?
Isn't that redundant, if only one child widget is ever visible at a time?
Maybe. Perhaps I'm overthinking this, but perhaps the order of the child widgets might matter in some contexts.
content_switcher = self.query_one(ContentSwitcher)
first_content = content_switcher.children[0]
content_switcher.current = first_content.id
I think in the 99% case, the order doesn't matter. Going to leave that as a "if anyone asks" possible addition.
Don't forget to star the repository!
Follow @textualizeio for Textual updates.
We could use a method to add new content to a ContentSwitcher. At the moment you can call
mount
but you need also need to setdisplay=False
.Something like this: