dialog t {
title ""
size -1 -1 300 300
option dbu
list 1, 0 0 300 270, vsbar
button "clear", 2, 270 270 20 20
button "add item", 3, 240 270 20 20
}
on *:dialog:t:mouse:*:{
if ($did(2).enabled) && (!$did(1).lines) did -b $dname 2
elseif ($did(1).lines) && (!$did(2).enabled) did -e $dname 2
}
on *:dialog:t:sclick:2: did -r $dname 1
on *:dialog:t:sclick:3: did -a $dname 1 test