0
需要在一个标签内设置一个ipywidget容器小部件(HBox,VBox等) 以下是我试图使用一个文本小部件列表作为展台的虚拟示例对于任何其他部件ipywidgets在内部使用容器标签
创建VBox窗口小部件的列表,将此窗口小部件列表绑定到VBox,然后显示VBox;这按预期工作:
import ipywidgets as widgets
from IPython.display import display
#just "dummy" widgets for exsample
subwids=[widgets.Text(value='Hello City'),
widgets.Text(value='Hello State'),
widgets.Text(value='Hello country '),
widgets.Text(value='Hello Contant'),
widgets.Text(value='Hello Continent')
]
#bind the dummy widgets to a VBox
BOX=widgets.VBox(subwids)
#display the VBox
display(BOX)
现在我想设置在标签控件制表现有的垂直框,而这正是它不会工作,并发出一个可以运行时可以看到一个错误以下:
tab=widgets.Tab(BOX)
tab.set_title(0, 'GeoLevels')
display(tab)
但我希望它做的是,除了在标签中的垂直框,就像我在Qt的