factor/libs/slate/slate.factor

33 lines
836 B
Factor
Raw Permalink Normal View History

2006-11-28 21:57:29 -05:00
REQUIRES: libs/vars ;
USING: kernel namespaces gadgets vars ;
IN: slate
2006-10-04 00:38:54 -04:00
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
TUPLE: slate action ns ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
C: slate ( -- slate )
dup delegate>gadget
[ ] over set-slate-action
H{ } clone over set-slate-ns ;
M: slate pref-dim* ( slate -- ) drop { 100 100 0 } ;
M: slate draw-gadget* ( slate -- ) dup slate-ns swap slate-action bind ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
VAR: slate
2006-11-14 01:34:21 -05:00
: action> ( -- quot ) slate> slate-action ;
2006-10-04 00:38:54 -04:00
: >action ( quot -- ) slate> set-slate-action ;
: .slate ( -- ) slate> relayout-1 ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: slate-window ( -- ) <slate> dup >slate "Slate" open-titled-window ;