diff --git a/basis/ui/gadgets/book-extras/book-extras.factor b/basis/ui/gadgets/book-extras/book-extras.factor new file mode 100644 index 0000000000..31ce8831be --- /dev/null +++ b/basis/ui/gadgets/book-extras/book-extras.factor @@ -0,0 +1,11 @@ +USING: accessors kernel fry math models ui.gadgets ui.gadgets.books ui.gadgets.buttons ; +IN: ui.gadgets.book-extras +: ( pages -- book ) 0 ; +: |<< ( book -- ) 0 swap set-control-value ; +: next ( book -- ) model>> [ 1 + ] change-model ; +: prev ( book -- ) model>> [ 1 - ] change-model ; +: (book-t) ( quot -- quot ) '[ : owner ( gadget -- book ) parent>> dup book? [ owner ] unless ; owner @ ] ; +: ( label quot -- button ) (book-t)