factor/library/ui/presentations.factor

24 lines
672 B
Factor
Raw Normal View History

2005-03-01 22:11:08 -05:00
! Copyright (C) 2005 Slava Pestov.
! See http://factor.sf.net/license.txt for BSD license.
IN: gadgets
2005-03-02 21:26:11 -05:00
USING: kernel lists namespaces prettyprint stdio unparser ;
2005-03-01 22:11:08 -05:00
DEFER: inspect
: object-menu ( obj -- assoc )
[
[[ "Inspect" [ inspect ] ]]
] actionize ;
2005-03-02 21:26:11 -05:00
: press-presentation ( presentation obj -- )
#! Called when mouse is pressed over a presentation.
swap button-update object-menu <menu> show-menu ;
2005-03-01 22:11:08 -05:00
2005-03-02 21:26:11 -05:00
: presentation-actions ( presentation obj -- )
[ literal, \ press-presentation , ] make-list
2005-03-01 22:11:08 -05:00
[ button-down 1 ] set-action ;
2005-03-02 21:26:11 -05:00
: <presentation> ( obj -- gadget )
2005-05-03 19:00:52 -04:00
dup unparse f <roll-button>
2005-03-02 21:26:11 -05:00
[ swap presentation-actions ] keep ;