 : >>selected-index ( table n -- table ) over (>>selected-index) ;
 : >>selected-value ( table val -- table ) over (>>selected-value) ;
 
-M: table selected-value>> selected-values>> [ [ peek ] [ f ] if* ] <arrow> ;
+M: table selected-value>> selected-values>> [ [ f ] [ peek ] if-empty ] <arrow> ;
 M: table (>>selected-value) [ [ 1vector ] <arrow> ] dip (>>selected-values) ;
-M: table selected-index>> selected-indices>> [ peek ] [ f ] if* ;
+M: table selected-index>> selected-indices>> [ f ] [ peek ] if-empty ;
 M: table (>>selected-index) [ 1vector ] dip (>>selected-indices) ;
 
 IN: ui.gadgets.tables


: draw-selected-rows ( table -- )
    {
        { [ dup selected-indices>> not ] [ drop ] }
        [
            [ selected-indices>> ] [ selection-color>> gl-color ] [ ] tri
            [ swap row-bounds gl-fill-rect ] curry each

    new-line-gadget
        swap >>renderer
        swap >>model
        V{ } clone <model> >>selected-values
        sans-serif-font >>font
        focus-border-color >>focus-border-color
        transparent >>column-line-color ; inline
