#!/usr/local/bin/wish -f

button .button -command incrementLabel -text 1
pack .button -side left

proc incrementLabel {} {
  set text [.button configure -text]
  set value [lindex $text 4]
  incr value
  puts "** incrementing Tk value to $value"
  .button configure -text $value
  if {$value < 20} {
    send xmSend3 incrementLabel
  }
}

