wwe has asked for the wisdom of the Perl Monks concerning the following question:
here is a code which reproduce a problem easily (cause of the huge button) it's easy to place the file picker window over this button and select a file using a double click. A message box opens after the huge button has been clicked to inform you.
Update: it seems to be allready known problem http://groups.google.com/group/comp.lang.perl.tk/browse_thread/thread/d18d09ac8cd1fff6/4262df12756a36bf?#4262df12756a36bf. Wonder if there is still no bug report about it.#!/usr/local/bin/perl -w use strict; use warnings; use Tk; use utf8; use v5.12; my $mw = Tk::MainWindow->new( -title => 'main window', ); #Exit when the escape key is pressed $mw -> bind('<Key-Escape>', sub { exit }); my $frame = $mw->Frame(-borderwidth => 3)->pack( -fill => 'both',); my $btn1 = $frame->Button( -text => 'button', -command => sub { buttonClicked() }, -width => 120, -height => 40, )->pack(-fill => 'both',); $frame->Button( -text => 'file selector', -command => sub { select_file() }, )->pack(-fill => 'both',); $frame->Button( -text => 'exit', -command => sub { exit }, )->pack(-fill => 'both',); MainLoop; sub select_file { #...; my $file = $mw->getOpenFile( -title => 'select file', ); $file = File::Spec->canonpath( $file ); return $file; } sub buttonClicked { $mw->messageBox(-message=>"you clicked a button!"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk getOpenFile doubleClick problem
by zentara (Cardinal) on Sep 13, 2011 at 15:30 UTC | |
by wwe (Friar) on Sep 13, 2011 at 15:55 UTC | |
|
Re: Tk getOpenFile doubleClick problem
by SuicideJunkie (Vicar) on Sep 13, 2011 at 14:58 UTC | |
|
Re: Tk getOpenFile doubleClick problem
by wwe (Friar) on Sep 13, 2011 at 14:35 UTC |