CODE
alias testhash if !$dialog(testhash) { dialog -m testhash testhash }
dialog testhash {
option dbu
title Test
size -1 -1 150 100
box "Bullshet",1, 5 3 140 70
list 2, 10 12 60 55, sort size
text "Napishi neshto:",3, 92 12 50 8
edit "",4, 85 20 50 10, autohs
edit "",5, 85 32 50 10, autohs
button "&Add",10, 85 45 50 10
button "&Del",11, 85 55 50 10
button "&Okay",100, 85 80 50 15, ok
}
on *:dialog:testhash:init:*:{
hmake testhash
hload testhash testhash.hsh
var %x = 1
while $hget(testhash,%x).item {
did -a $dname 2 $hget(testhash,%x).item
inc %x
}
}
on *:dialog:testhash:sclick:*:{
if $did = 10 {
if $did(4).text != $null && $did(5).text != $null && !$hget(testhash,$did(4)) {
hadd testhash $did(4) $did(5)
did -a $dname 2 $did(4)
did -r $dname 4,5
}
}
if $did = 11 {
if $did(2).seltext != $null {
hdel testhash $did(2).seltext
did -d $dname 2 $did(2).sel
}
}
if $did = 100 {
hsave testhash testhash.hsh
}
}
on *:dialog:testhash:close:*:{ hfree testhash }
/testhash