public
Description: deepblue's thoughts
Homepage: http://myruby.net/
Clone URL: git://github.com/deepblue/snippets.git
snippets / chalenge / hello_ui / hello.factor
100644 18 lines (13 sloc) 0.444 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
USING: ui ui.gadgets ui.gadgets.labels ui.gadgets.borders ui.gadgets.buttons ui.gadgets.packs accessors ;
IN: hello
 
: open-label-window ( -- )
  <pile> 1 >>fill
  "Factor Gadget" <label> 20 <border> add-gadget
  "OK" [ close-window ] <bevel-button> add-gadget
  "Alert" open-window ;
 
: open-hello-window ( -- )
  "Hello!" [ open-label-window ] <bevel-button>
  "Factor" open-window ;
 
: hello ( -- )
  [ open-hello-window ] with-ui ;
 
hello