Skip to content

Tab Titles not showing up in vscode jupyter notebooks #3657

Open
@Aidan645

Description

@Aidan645

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
image
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

  1. copy code & run.
    (1. create a tab with a little content using widgets.Tab(), widgets.Button() and tab.children = buttons
  2. display the tab in vscode with jupyter notebook extention

What i did

  1. 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
  2. ctrl-c, ctrl-v
  3. run into this error
  4. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions