I use this, so that the cursor position isn't reset. This makes it behave almost the same as a true numbers-only box, giving the effect that non-numeric keypresses are just halted. It also works if you paste text, triggering successive events smile
Code:
on *:dialog:<name>:edit:<id>: num-edit $dname $did
alias num-edit {
  var %a = $did($1,$2), %s = $did($1,$2,1).selstart
  if $mid(%a,%s,1) !isnum { did -ra $1-2 $remove(%a,$v1) | did -c $1-2 1 %s }
}


Oh and of course, I too would like this built-in.

Last edited by qwerty; 27/06/05 10:25 AM.