Open
Description
Description
this code should make two tabs both with individual buttons, and labeled appropriately.
yet it seems it doesnt show the label on the tabs for some reason.
import ipywidgets as widgets
# Create the tab widget
tab = widgets.Tab()
# Create the first tab and its content - a button
tab1 = widgets.VBox()
button1 = widgets.Button(description='Button 1')
tab1.children = [button1]
# Create the second tab and its content - a button
tab2 = widgets.VBox()
button2 = widgets.Button(description='Button 2')
tab2.children = [button2]
# Add the tabs to the tab widget
tab.children = [tab1, tab2]
# Set the tab titles
tab.set_title(0, 'Tab 1')
tab.set_title(1, 'Tab 2')
# Display the tab widget
tab
A screenshot for clarification
As you probably can see, the titles are empty in this screenshot, ive tryed to reproduce this in colab, jupyterlite and these ides dont seem to share the same issue, though every time i try in vscode the tabs are unlabeled, or atleast the label wont show.
Reproduce
- copy code & run.
(1. create a tab with a little content using widgets.Tab(), widgets.Button() and tab.children = buttons - display the tab in vscode with jupyter notebook extention
What i did
- Ask chatgpt for some sample code on how to make a very simple gui to try to learn some basics for making gui in python
- ctrl-c, ctrl-v
- run into this error
- problem solve for a couple of hours trying diffrent ides and packages for gui in python, only to find that this package is what you are looking for but it doesn't work in the ide you preferr "grrr..."
Expected behavior
labeled tabs like the documentation shows but then in vscode :
https://ipywidgets.readthedocs.io/en/stable/examples/Widget%20List.html#Tabs
Context
- ipywidgets version 8.0.4
- Operating System and version: windows 10, fresh reset (harddrive malfunction)
- Browser and version: browser is chrome but not necessary for the ide.
Metadata
Metadata
Assignees
Labels
No labels