Public Scratchpad | Download, Select Code To D/L |
A better solution was to create a closure that held some info about the piece of XML involved.
sub renderAttribute { my ($self, $xml) = @_; ... # code to create the entry widget for this piece of XML my $entry = $parentFrame->Entry(-textvariable => \$attributeText, -validatecommand => $self->createVal +idateCallback($attributeXML))->pack(); ... } sub createValidateCallback { my ($self, $xmlObj) = @_; return sub { # these params are how Tk will call this callback my ($newValue, $deltaText, $origValue, $deltaIndex, $deltaType) = +@_; return $self->updateXML($xmlObj, $newValue); }; }
Your challenge is that in the closure you have to yield to thread A, and I have no experience in how to do that.
I'll look at that link as soon as I can.
I haven't posted the talk anywhere because it contains a diagram I ripped off verbatim from MJD's new HOP book. I think I'm OK doing a talk with this as a supporting diagram, but a web page is probably just wrong. But I am willing to email it to you, if your willing.
Leif