Skip to content

Commit

Permalink
Merge pull request #2532 from proneon267/optioncontainer_example_fix
Browse files Browse the repository at this point in the history
Fixed `OptionContainer` example app
  • Loading branch information
freakboy3742 authored Apr 27, 2024
2 parents 06f68da + f374e76 commit e2dc95a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions changes/2532.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The Next/Previous Tab commands in the OptionContainer example were updated to remove the use of a backwards incompatible API.
8 changes: 6 additions & 2 deletions examples/optioncontainer/optioncontainer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,15 @@ def set_next_tab(self, widget):
self.optioncontainer.current_tab.index
< len(self.optioncontainer.content) - 1
):
self.optioncontainer.current_tab += 1
self.optioncontainer.current_tab = (
self.optioncontainer.current_tab.index + 1
)

def set_previous_tab(self, widget):
if self.optioncontainer.current_tab.index > 0:
self.optioncontainer.current_tab -= 1
self.optioncontainer.current_tab = (
self.optioncontainer.current_tab.index - 1
)

def on_select_tab(self, widget, **kwargs):
self.selected_label.text = (
Expand Down

0 comments on commit e2dc95a

Please sign in to comment.