-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcolor.m
More file actions
executable file
·61 lines (55 loc) · 1.77 KB
/
color.m
File metadata and controls
executable file
·61 lines (55 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#! xbigforth
\ automatic generated code
\ do not edit
also editor also minos also forth
component class color
public:
button ptr color-ok
( [varstart] ) cell var color ( [varend] )
how:
: params DF[ 0 ]DF X" Color" ;
class;
component class result
public:
infotextfield ptr choice
button ptr choice-ok
( [varstart] ) cell var color ( [varend] )
how:
: params DF[ 0 ]DF X" Your Choice" ;
class;
result implements
( [methodstart] ) : assign ( addr u -- ) color $! ;
: show color $@ choice assign super show ; ( [methodend] )
: widget ( [dumpstart] )
T" " ^^ ST[ ]ST ( MINOS ) X" Choice" infotextfield new ^^bind choice
^^ S[ bye ]S ( MINOS ) X" OK" button new ^^bind choice-ok
^^ S[ close ]S ( MINOS ) X" Cancel" button new
#2 hatbox new #1 hskips
#2 hatbox new panel
( [dumpend] ) ;
class;
color implements
( [methodstart] ) ( [methodend] )
: widget ( [dumpstart] )
^^ TN[ 0 color ]T[ ( MINOS ) ]TN ( MINOS ) X" Red" rbutton new
^^ TN[ 1 color ]T[ ( MINOS ) ]TN ( MINOS ) X" Green" rbutton new
^^ TN[ 2 color ]T[ ( MINOS ) ]TN ( MINOS ) X" Blue" rbutton new
^^ TN[ 3 color ]T[ ( MINOS ) ]TN ( MINOS ) X" Alpha" rbutton new
#4 varbox new
$10 $1 *hfill $0 $1 *vfill glue new
^^ S[ drop color @ 0 = IF s" Red" THEN
color @ 1 = IF s" Green" THEN
color @ 2 = IF s" Blue" THEN
color @ 3 u>= IF s" Alpha" THEN
result open-app ]S ( MINOS ) X" OK" button new ^^bind color-ok
^^ S[ close ]S ( MINOS ) X" Cancel" button new
$10 $1 *hfill $0 $1 *vfill glue new
#4 vabox new #1 vskips
#2 habox new panel
( [dumpend] ) ;
class;
: main
color open-app
event-loop bye ;
script? [IF] main [THEN]
previous previous previous