From 895b1339f8c70d157fe12f0291aa647d24d07488 Mon Sep 17 00:00:00 2001 From: Sam Anklesaria Date: Mon, 9 Mar 2009 20:35:49 -0500 Subject: [PATCH] added buttons for book navigation --- basis/ui/gadgets/book-extras/book-extras.factor | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 basis/ui/gadgets/book-extras/book-extras.factor 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)