in reply to Perl Tk - 2 cursor position problems

I'm not sure what your calculations need to be, but would something like this give you any ideas?
#!/usr/bin/perl -w use strict; use Tk; my @entries; my $mw = MainWindow->new; my $frame = $mw->Frame()->pack(-padx => 10,-pady => 10); foreach my $i (0..2) { $entries[$i] = $frame->Entry(-relief => 'raised', -text => "Entry $i")->pack(-side => 'left' +); $entries[$i]->bind('<Enter>' => [\&sayHello,$i]); $entries[$i]->bind('<Leave>' => [\&sayGoodbye,$i]); } MainLoop; sub sayHello { my $w = shift; my $id = shift; $frame->grab; print "Hi, I am entry $id!\n"; } sub sayGoodbye { my $w = shift; my $id = shift; $frame->grab; print "Goodbye, I am entry $id!\n"; }

Replies are listed 'Best First'.
Re^2: Perl Tk - 2 cursor position problems
by merrymonk (Hermit) on Feb 24, 2015 at 16:25 UTC
    That seems a super start for the entry box problem as I have tried it and get 'good' messages when the cursor goes in and out of the entry boxes!
    I can see it probably can be used for the disabled entry box as well.
    I am thinking how I can use it for disabled widgets such as radio button etc.
    Many thanks