2005-03-03 22:24:51 -05:00
|
|
|
! Copyright (C) 2005 Slava Pestov.
|
|
|
|
! See http://factor.sf.net/license.txt for BSD license.
|
|
|
|
IN: gadgets
|
2005-07-14 00:32:52 -04:00
|
|
|
USING: generic io kernel listener math namespaces prettyprint
|
|
|
|
sequences styles threads ;
|
2005-03-22 21:20:58 -05:00
|
|
|
|
2005-07-13 21:28:23 -04:00
|
|
|
SYMBOL: stack-display
|
|
|
|
|
2005-07-14 00:32:52 -04:00
|
|
|
: ui.s ( -- )
|
|
|
|
stack-display get dup pane-clear [
|
|
|
|
datastack reverse [ unparse. terpri ] each
|
|
|
|
] with-stream* ;
|
|
|
|
|
2005-07-11 22:47:38 -04:00
|
|
|
: init-world
|
|
|
|
global [
|
|
|
|
<world> world set
|
|
|
|
|
|
|
|
{{
|
|
|
|
[[ background [ 255 255 255 ] ]]
|
2005-07-18 18:14:13 -04:00
|
|
|
[[ rollover-bg [ 216 216 255 ] ]]
|
|
|
|
[[ bevel-1 [ 160 160 160 ] ]]
|
|
|
|
[[ bevel-2 [ 216 216 216 ] ]]
|
2005-07-11 22:47:38 -04:00
|
|
|
[[ foreground [ 0 0 0 ] ]]
|
|
|
|
[[ reverse-video f ]]
|
|
|
|
[[ font "Sans Serif" ]]
|
|
|
|
[[ font-size 12 ]]
|
|
|
|
[[ font-style plain ]]
|
|
|
|
}} world get set-gadget-paint
|
|
|
|
|
|
|
|
{ 1024 768 0 } world get set-gadget-dim
|
|
|
|
|
|
|
|
<plain-gadget> add-layer
|
2005-03-22 21:20:58 -05:00
|
|
|
|
2005-07-13 21:28:23 -04:00
|
|
|
<pane> dup pane set <scroller>
|
|
|
|
<pane> dup stack-display set <scroller>
|
|
|
|
3/4 <y-splitter> add-layer
|
2005-07-11 22:47:38 -04:00
|
|
|
|
2005-07-14 00:32:52 -04:00
|
|
|
[
|
|
|
|
pane get [
|
|
|
|
[ ui.s ] listener-hook set
|
|
|
|
clear print-banner listener
|
|
|
|
] with-stream
|
|
|
|
] in-thread
|
2005-07-13 21:03:34 -04:00
|
|
|
|
2005-07-13 21:28:23 -04:00
|
|
|
pane get request-focus
|
2005-07-11 22:47:38 -04:00
|
|
|
] bind ;
|
2005-06-25 20:39:53 -04:00
|
|
|
|
2005-07-11 22:47:38 -04:00
|
|
|
SYMBOL: first-time
|
|
|
|
|
|
|
|
global [ first-time on ] bind
|
|
|
|
|
|
|
|
: ?init-world
|
|
|
|
first-time get [ init-world first-time off ] when ;
|