in reply to Re^2: Can't call method "curselection" on an undefined value
in thread Can't call method "curselection" on an undefined value

The warning I highlighted is the only issue of that sort that the OP's sample code generates. My suspicion is that what we've been shown is a cleaned up version of the OP's real code and that the actual bug has been cleaned up in the process. Most likely that bug is related to using $lst as a global and is a result of it being altered somewhere in the code we're not shown. There is a reasonable chance that using the call back technique I demonstrated may solve the OP's problem.

Quite likely the curselection undefined warning is a red herring, but avoiding globals may well fix the actual problem regardless.

True laziness is hard work
  • Comment on Re^3: Can't call method "curselection" on an undefined value