Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ColumnView

A Finder-style stack of columns, one level per column.

with sc.ColumnView('Pick a file', 'data/sample') as tree:
    ...

path = tree.value.get()

Layout:

[ /current/folder v ] [home] [refresh]        <- toolbar
+---------+ +---------+ +---------+
| alpha/  | | one.py  | | a.txt   |
| beta/   | | two.py  | | b.txt   |
+---------+ +---------+ +---------+
ArgumentTypeMeaning
labelstr | PropertyLabel
start_directorystrFolder the first column opens on
filterstr or tupleSuffixes to keep
heightintHeight of every column, default 500
max_columnsintColumns on show at once, default 4
home_directorystrWhere home returns
accept_new_optionboolOffer a typed path in the location bar
show_locationboolDraw the location ladder
show_confirm_buttonboolDefault True
rows_visiblebool | PropertyWhether the columns are drawn
label_visibilitystrSee Inputs
helpstr | PropertyTooltip

Properties: value, mode (always 'single'), directory (the folder the rightmost column shows).

Signals: on_navigate(directory), on_submit(paths).

Methods: reload(), select(path), clear(), resolve().

Interaction

  • Clicking a folder opens its contents in a new column to the right.
  • Clicking a file marks it.
  • Clicking a folder in a column further left replaces everything to its right, so the whole trail stays on show.
  • The panel needs no “go up” row; the trail is the way back.

value

Single-select. It names the node picked in the rightmost column, or that column’s folder while nothing inside is picked. A column view always has a current folder, so value is never empty.

Windowing

At most max_columns columns are on show. Walking deeper scrolls the earlier ones out; the window keeps the last max_columns folders, so the column just opened stays visible. The location ladder and home still reach any ancestor in one pick.

Toolbar

The toolbar holds the location ladder, home, and refresh. With leading / trailing, a wrapper can add its own widgets around them.