ui.frp.layout checks namespace only to 1 level

db4
Sam Anklesaria 2009-06-17 18:05:54 -05:00
parent 979d0c9d48
commit 4d2d9f86b4
1 changed files with 7 additions and 6 deletions

View File

@ -1,21 +1,22 @@
USING: accessors arrays fry kernel lexer make math.parser models
USING: accessors assocs arrays fry kernel lexer make math.parser models
models.product namespaces parser sequences ui.frp.gadgets
ui.gadgets ui.gadgets.books ui.gadgets.tracks vectors words
combinators ui.frp.signals ;
QUALIFIED: make
IN: ui.frp.layout
PREDICATE: true < word t = ;
SYMBOL: inserting
TUPLE: layout gadget size ; C: <layout> layout
TUPLE: placeholder < gadget ;
ERROR: no-models-in-books models ;
DEFER: insert-item
HOOK: , inserting ( uiitem -- )
M: f , make:, ;
M: placeholder , [ inserting get insert-item ] keep relayout ;
M: true , dup placeholder? [ inserting set ] [ "No location to add UI item" throw ] if ;
: , ( uiitem -- ) inserting namespace at {
{ f [ make:, ] }
{ t [ dup placeholder? [ inserting set ] [ "No location to add UI item" throw ] if ] }
[ placeholder? [ [ inserting get insert-item ] keep relayout ] [ drop ] if ]
} case ;
SYNTAX: UI[ parse-quotation '[ [ t inserting _ with-variable ] ] over push-all ;
SYNTAX: ,% scan string>number [ <layout> , ] curry over push-all ;