 M: object row-color 2drop f ;
 
 TUPLE: table < gadget
-renderer filled-column column-alignment action hook
+renderer filled-column column-alignment action single-click? hook
 column-widths total-width
 font selection-color focus-border-color
 mouse-color column-line-color selection-required?

    dup control-value empty? [ drop ] [
        origin get [
            {
                [ draw-selected ]
                [ draw-columns ]
                [ draw-lines ]
                [ draw-moused ]
            } cleave
        ] with-translation
    ] if ;

PRIVATE>

: row-action ( table -- )
    dup selected-row
    [ swap [ action>> call ] [ hook>> call ] bi ]
    [ 2drop ]
    if ;

<PRIVATE

: table-button-up ( table -- )
    dup single-click?>> hand-click# get 2 = or
    [ row-action ] [ update-selected-value ] if ;

: select-row ( table n -- )
