From 97888ee01712f8da42280575a75e1fb2e44b12de Mon Sep 17 00:00:00 2001 From: Sam Anklesaria Date: Tue, 26 May 2009 14:26:11 -0500 Subject: [PATCH] fixed hang bug in ui.gadgets.tables --- basis/pseudo-slots/pseudo-slots.factor | 14 -------------- basis/ui/gadgets/tables/tables.factor | 12 +++++++----- 2 files changed, 7 insertions(+), 19 deletions(-) delete mode 100644 basis/pseudo-slots/pseudo-slots.factor diff --git a/basis/pseudo-slots/pseudo-slots.factor b/basis/pseudo-slots/pseudo-slots.factor deleted file mode 100644 index 27308beab3..0000000000 --- a/basis/pseudo-slots/pseudo-slots.factor +++ /dev/null @@ -1,14 +0,0 @@ -USING: functors kernel lexer sequences vocabs.parser ; -IN: pseudo-slots -FUNCTOR: make-definitions ( D -- ) -D>> DEFINES ${D}>> ->>D DEFINES >>${D} -(>>D) DEFINES (>>${D}) - -WHERE -GENERIC: (>>D) ( value object -- ) -GENERIC: D>> ( object -- value ) -: >>D ( object value -- object ) over (>>D) ; -;FUNCTOR - -SYNTAX: PSEUDO-SLOTS: ";" parse-tokens [ make-definitions ] each ; \ No newline at end of file diff --git a/basis/ui/gadgets/tables/tables.factor b/basis/ui/gadgets/tables/tables.factor index 8848a0fe77..2ec0ca4c59 100644 --- a/basis/ui/gadgets/tables/tables.factor +++ b/basis/ui/gadgets/tables/tables.factor @@ -2,11 +2,11 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays colors colors.constants fry kernel math math.functions math.ranges math.rectangles math.order math.vectors -models.illusion namespaces opengl pseudo-slots sequences ui.gadgets +models.illusion namespaces opengl sequences ui.gadgets ui.gadgets.scrollers ui.gadgets.status-bar ui.gadgets.worlds ui.gestures ui.render ui.pens.solid ui.text ui.commands ui.images -ui.gadgets.menus ui.gadgets.line-support math.rectangles models -math.ranges sequences combinators combinators.short-circuit +ui.gadgets.menus ui.gadgets.line-support models +combinators combinators.short-circuit fonts locals strings vectors ; IN: ui.gadgets.tables @@ -52,7 +52,9 @@ multiple-selection? ; : in>out ( vector -- val/f ) [ f ] [ peek ] if-empty ; : out>in ( val/f -- vector ) [ 1vector ] [ V{ } clone ] if* ; IN: accessors -PSEUDO-SLOTS: selected-value selected-index selected-index* ; +SLOT: selected-value +SLOT: selected-index +SLOT: selected-index* M: table selected-value>> selected-values>> [ in>out ] ; M: table (>>selected-value) [ [ out>in ] ] dip (>>selected-values) ; M: table selected-index>> selected-indices>> in>out ; @@ -257,7 +259,7 @@ PRIVATE> : (selected-rows) ( table -- {row} ) [ selected-indices>> ] keep - [ nth-row [ 1vector ] [ drop V{ } clone ] if ] curry map concat ; + [ nth-row [ 1array ] [ drop { } ] if ] curry map concat >vector ; : selected-rows ( table -- {value} ) [ (selected-rows) ] [ renderer>> ] bi [ row-value ] curry map ;