dialog com {
title "Com"
size -1 -1 64 116
option dbu
combo 1, 2 2 60 90, size
button "Add", 2, 11 94 15 8
button "Del", 3, 38 94 15 8
button "Close", 4, 4 106 55 8
}
On *:Dialog:com:init:0: {
if ($lines(com.txt) >= 1) { .play -s com.txt 10 }
}
On *:Dialog:com:sclick:2: {
if ($did(1)) {
if ($read(com.txt,w,did -a com 1 $did($dname,1))) { echo -a $did(1) already exists. | halt }
did -a $dname 1 $did(1)
write com.txt did -a com 1 $did($dname,1)
echo -a Added $+($did($dname,1),.)
}
}
On *:Dialog:com:sclick:3: {
if ($did(1).sel) {
did -d $dname 1 $did(1).sel
write -dw $+("*,$did(1).sel,*") com.txt
echo -a Deleted $+($did($dname,1),.)
}
}
On *:Dialog:com:sclick:4: {
dialog -x com com
}