in reply to [Solved:]Tk getOpenFile doubleClick problem

Hi, I don't notice the problem on linux, but a better hack than a 1 second delay timer, maybe be to recursively busy the mainwindow underneath, until the file is returned. It works well here. Ooops, update, I just noticed it only works the first time getOpenFile is called, after that the file dialog is busied too. There probably is a trick to fix that glitch, but it eludes as of yet. I still think busy unbusy is the way to go.

Update 2 Yeah , removing the recurse=>1 from the busy seems to do it.

sub select_file { #...; #$mw->Busy(-recurse => 1); #don't recurse here $mw->Busy(); my $file = $mw->getOpenFile( -title => 'select file', ); $file = File::Spec->canonpath( $file ); $mw->Unbusy(-recurse => 1); return $file; }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Replies are listed 'Best First'.
Re^2: Tk getOpenFile doubleClick problem
by wwe (Friar) on Sep 13, 2011 at 15:55 UTC

    Thank you zentara this helps!

    I tested the initial code and it works for me. Removing -recurse=>1 from ->Busy brings the problem back. Removing -recurse=>1 from ->Unbusy call is safe.