Skip to content

Commit

Permalink
Add to_tabs method to interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ejohb committed Oct 17, 2024
1 parent f04b42c commit 0b034bb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions fmtr/tools/interface_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ def loop(self):
sleep(3)
st.success("Success!")

def to_tabs(self, *classes):
"""
Add tabs from a list of interface classes
"""
tab_names = [cls.NAME for cls in classes]
tabs = st.tabs(tab_names)

for cls, tab in zip(classes, tabs):
with tab:
cls()

@classmethod
def is_streamlit(cls):
"""
Expand Down
2 changes: 1 addition & 1 deletion fmtr/tools/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.5
0.9.6

0 comments on commit 0b034bb

Please sign in to comment.