 colors call io.styles ;
 IN: ui.gadgets.panes
 
-TUPLE: pane < pack
+TUPLE: pane < track
 output current input last-line prototype scrolls?
 selection-color caret mark selecting? ;
 

    bi ;

: new-pane ( input class -- pane )
    new
        swap >>input
        1 >>fill
        vertical >>orientation
        <shelf> +baseline+ >>align >>prototype
        <incremental> [ >>output ] [ add-gadget ] bi
        dup prepare-last-line
        selection-color >>selection-color ; inline


        dup prototype>> clone >>current
        [ current>> f track-add ]
        [ input>> [ 1 track-add ] when* ]
        [ swap [ >>last-line ] [ 1 track-add ] bi drop ]
        tri
    ]
    [ input>> [ request-focus ] when* ] tri ;
