in reply to Strange behavior in -validatecommand; Win32 Perl/Tk version 804.027

I think it's asking for trouble to be doing your main work in a validatecommand routine, but you are... and that's probably why you have forgotten that it is, after all, a validatecommand, and is expected to return a boolean indicating whether the "new value" is valid. Simply add  return(1) at the end of new_shape and you should be good to go.

A word spoken in Mind will reach its own level, in the objective world, by its own weight

Replies are listed 'Best First'.
Re^2: Strange behavior in -validatecommand; Win32 Perl/Tk version 804.027
by liverpole (Monsignor) on Aug 27, 2007 at 03:04 UTC
    Thank you Master++,

    Your solution was precisely right!

    Furthermore, I was indeed forgetting "that it is, after all, a validatecommand", which was my downfall.

    Your answer also illuminates the reason that the printf was causing a successful outcome, namely that the return of printf, like that of print, is "true if successful".  Hence, a successful printf was the equivalent of returning 1, without doing so intentionally.

    Thanks for helping me to get past that obstacle!


    s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
Re^2: Strange behavior in -validatecommand; Win32 Perl/Tk version 804.027
by Anonymous Monk on Feb 12, 2008 at 10:03 UTC
    I had similar problem with -validatecommand. Your solution is as simple as genial. Thanks for submitting this.