Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add better support for dynamically sized TabViews #397

Open
Freddo3000 opened this issue Jul 28, 2023 · 1 comment
Open

Add better support for dynamically sized TabViews #397

Freddo3000 opened this issue Jul 28, 2023 · 1 comment

Comments

@Freddo3000
Copy link

Currently TabViews are mainly oriented towards static bindings and content, making it difficult to interface between tabs and the broader program, and vice versa.

What I'd like to see is

  • A clear way to create bindings into data contained within a tab, such as for example .thenSelected(Tab::some_data) and .thenSelectedIndex(Tab::some_data, Index).
  • Some way to direct Events to the currently selected tab within a tabview.
  • An integrated way to determine which tab in a TabView is currently open.

Some of this is possible to do with the .on_select() callback together with .with_selected(), though it isn't an ideal solution. For example, using the .on_select() callback to set a separate index variable instead of querying the TabView's own selected_index.

@geom3trik
Copy link
Collaborator

I'm not sure I understand what you mean by your first point. What do you mean by data contained within a tab? Typically your data should be in a model, probably further up the tree than the tabview.

Yes it's true that on_select and with_selected moves the managements of the tab index to your own data, but this is intentional as it gives you full control of the selected tab without needing messy events to sync with the internal tabview index.

If you could provide an example scenario of what you're trying to achieve I think that would help me understand what features you need me to add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants