]> gitweb.factorcode.org Git - factor.git/commitdiff
frp templating sizes bug fixed
authorSam Anklesaria <sam@Tintin.local>
Sun, 7 Jun 2009 23:42:20 +0000 (18:42 -0500)
committerSam Anklesaria <sam@Tintin.local>
Sun, 7 Jun 2009 23:42:20 +0000 (18:42 -0500)
extra/persistency/persistency.factor
extra/ui/frp/layout/layout.factor

index 683318f98bd47c8ae0aa43cdce36202045d08d4e..d8bf0e98066fc237f808397c211a91b8584fb631 100644 (file)
@@ -28,7 +28,8 @@ SYNTAX: STORED-TUPLE: parse-tuple-definition [ drop persistent ] dip [ define-tu
 
 : define-db ( database class -- ) swap [ [ recreate-table ] with-db ] [ "database" set-word-prop ] 2bi ;
 
-: w/db ( query quot -- ) [ dup class "database" word-prop ] dip with-db ; inline
+: query>tuple ( tuple/query -- tuple ) dup query? [ tuple>> ] when ;
+: w/db ( query quot -- ) [ dup query>tuple class "database" word-prop ] dip with-db ; inline
 : get-tuples ( query -- tuples ) [ select-tuples ] w/db ;
 : get-tuple ( query -- tuple ) [ select-tuple ] w/db ;
 : store-tuple ( tuple -- ) [ insert-tuple ] w/db ;
index a4f0b094094c53ddec23ac7e20bf56f2c5d03dd2..b5893c7aa34279002e1e802acedc66c1873d242c 100644 (file)
@@ -34,16 +34,19 @@ SYMBOL: wordnames
 
 : <frp-book> ( quot: ( -- model ) -- book ) f make-layout roll dup activate-model <book> handle-words
    swap [ no-models ] unless-empty ; inline
+: <frp-book*> ( quot -- book ) f make-layout f <book> handle-words
+   swap [ no-models ] unless-empty ; inline
 
 SYNTAX: $ CREATE-WORD dup [ , ] curry (( -- )) define-declared "$" expect
    word [ [ building get length swap wordnames get set-at ] [ , ] bi ] curry over push-all ;
 
 : insert-gadget ( number parent gadget -- ) -rot [ but-last insert-nth ] change-children drop ;
+: insert-size ( number parent size -- ) -rot [ but-last insert-nth ] change-sizes drop ;
 
 GENERIC# insert-item 1 ( item location -- )
 M: gadget insert-item dup first book? [ first2 spin [ add-gadget ] keep insert-gadget ]
    [ [ f <layout> ] dip insert-item ] if ;
-M: layout insert-item first2 spin [ insert-layout ] keep gadget>> insert-gadget ;
+M: layout insert-item first2 spin [ insert-layout ] keep [ gadget>> insert-gadget ] [ size>> insert-size ] 3bi ;
 M: model insert-item dup first book? [ no-models ]
    [ first model>> swap add-connection ] if ;
 
@@ -54,3 +57,5 @@ M: model insert-item dup first book? [ no-models ]
 
 : with-interface ( quot: ( -- gadget ) -- gadget ) H{ } clone wordnames
    [ { } make insert-items ] with-variable ; inline
+
+! while children are changed, sizes aren't
\ No newline at end of file