added buttons for book navigation
parent
4d453923ae
commit
895b1339f8
|
@ -0,0 +1,11 @@
|
|||
USING: accessors kernel fry math models ui.gadgets ui.gadgets.books ui.gadgets.buttons ;
|
||||
IN: ui.gadgets.book-extras
|
||||
: <book*> ( pages -- book ) 0 <model> <book> ;
|
||||
: |<< ( 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 @ ] ;
|
||||
: <book-btn> ( label quot -- button ) (book-t) <button> ;
|
||||
: <book-bevel-btn> ( label quot -- button ) (book-t) <bevel-button> ;
|
||||
: >>> ( label -- button ) [ next ] <book-btn> ;
|
||||
: <<< ( label -- button ) [ prev ] <book-btn> ;
|
Loading…
Reference in New Issue