diff --git a/basis/ui/gadgets/tables/tables-tests.factor b/basis/ui/gadgets/tables/tables-tests.factor index 3191753324..b92f72a2dd 100644 --- a/basis/ui/gadgets/tables/tables-tests.factor +++ b/basis/ui/gadgets/tables/tables-tests.factor @@ -1,6 +1,6 @@ IN: ui.gadgets.tables.tests USING: ui.gadgets.tables ui.gadgets.scrollers ui.gadgets.debug accessors -models namespaces tools.test kernel combinators ; +models namespaces tools.test kernel combinators prettyprint arrays ; SINGLETON: test-renderer @@ -44,4 +44,19 @@ M: test-renderer column-titles drop { "First" "Last" } ; [ selected-row drop ] } cleave ] with-grafted-gadget -] unit-test \ No newline at end of file +] unit-test + +SINGLETON: silly-renderer + +M: silly-renderer row-columns drop unparse 1array ; + +M: silly-renderer column-titles drop { "Foo" } ; + +: test-table-2 ( -- table ) + { 1 2 f } silly-renderer ; + +[ f f ] [ + test-table dup [ + selected-row + ] with-grafted-gadget +] unit-test diff --git a/basis/ui/gadgets/tables/tables.factor b/basis/ui/gadgets/tables/tables.factor index 3856553b96..225cf90d8c 100644 --- a/basis/ui/gadgets/tables/tables.factor +++ b/basis/ui/gadgets/tables/tables.factor @@ -303,11 +303,12 @@ PRIVATE> f >>mouse-index [ hide-status ] [ relayout-1 ] bi ; : find-row-index ( value table -- n/f ) - [ model>> value>> ] [ renderer>> '[ _ row-value ] map index ] bi ; + [ model>> value>> ] [ renderer>> ] bi + '[ _ row-value eq? ] with find drop ; : (update-selected-indices) ( table -- set ) - [ selection>> value>> dup array? [ 1array ] unless ] keep - [ find-row-index ] curry map sift unique f assoc-like ; + [ selection>> value>> dup [ array? not ] [ ] bi and [ 1array ] when ] keep + '[ _ find-row-index ] map sift unique f assoc-like ; : initial-selected-indices ( table -- set ) { diff --git a/basis/ui/tools/profiler/profiler.factor b/basis/ui/tools/profiler/profiler.factor index 8be357b409..c3fbdb88cd 100644 --- a/basis/ui/tools/profiler/profiler.factor +++ b/basis/ui/tools/profiler/profiler.factor @@ -147,7 +147,7 @@ M: method-renderer column-titles drop { "" "Method" "Count" } ; horizontal { 3 3 } >>gap profiler vocabs>> vocab-renderer - profiler vocab>> >>selected-value + profiler vocab>> >>selection 10 >>min-rows 10 >>max-rows "Vocabularies" @@ -164,11 +164,11 @@ M: method-renderer column-titles drop { "" "Method" "Count" } ; horizontal { 3 3 } >>gap profiler word-renderer - profiler generic>> >>selected-value + profiler generic>> >>selection "Generic words" 1/2 track-add profiler word-renderer - profiler class>> >>selected-value + profiler class>> >>selection "Classes" 1/2 track-add 1/2 track-add