Example #1
0
class TestWindow(Tk):
    def __init__(self):
        super().__init__()

        # Set the window parameters
        self.wm_title("Test Window")
        self.wm_geometry("800x600")

        self._nb = Notebook(self)
        self._nb.pack(fill=BOTH, expand=1)

        # Add the ScrollableTreeview
        self.STV = ScrollableTreeview(
            self._nb,
            columns=('first','second'),
            headers={
                '#0':'Default',
                'first':{'text':'First'},
                'second':{'text':'Second'}
            }
        )
        self._nb.add(self.STV, text="Scrollable Treeview")

        iid = self.STV.insert('', 'end', text='Root Node')
        self.STV.insert(iid, 'end', text='Child 1')
        self.STV.insert(iid, 'end', text='Child 2')