示例#1
0
    def init(self):

        combo_options = ['Paris', 'New York', 'Enschede', 'Tokio']

        with ui.HBox():
            self.tree = TreeWithControls(flex=1, max_selected=1)
            self.combo = ui.ComboBox(flex=1,
                                     options=combo_options,
                                     editable=True)

        with self.tree:
            for cat in ('foo', 'bar', 'spam'):
                with ui.TreeItem(text=cat):
                    for name in ('Martin', 'Kees', 'Hans'):
                        item = ui.TreeItem(title=name)
                        item.checked = cat == 'foo' or None
示例#2
0
    def init(self):

        with ui.HSplit():
            with ui.TreeWidget(max_selected=1, flex=1) as self.videolist:
                for name in sorted(videos):
                    ui.TreeItem(text=name)

            self.player = ui.VideoWidget(flex=5)
示例#3
0
 def init(self):
     # A nice and cosy tree view
     with ui.DropdownContainer(text='Scene graph'):
         with ui.TreeWidget(max_selected=1):
             for i in range(20):
                 ui.TreeItem(text='foo %i' % i, checked=False)