Giorgio C has asked for the wisdom of the Perl Monks concerning the following question:
I would like to print the content of the txt file opened in a window of the program. Could anybody help me ? Thank you$file->command ( -label => 'Open', -accelerator => 'Ctrl-o', -underline => 0, -command => \&open_file); $mw->bind('<Control-o>', [\ +&open_file]); #SUPPORTED FILES TO OPEN my $types_OPEN = [ ['text files', '.txt'], ['All Files', '*'],]; sub open_file { my $open = $mw->getOpenFile(-filetypes => $types_OPEN, + -defaultextension => '.txt'); print qq{You chose to open "$open"\n} if $open; my $open = $mw; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl tk - open file and print content
by zentara (Cardinal) on Jan 16, 2012 at 15:05 UTC | |
by Giorgio C (Novice) on Jan 18, 2012 at 16:03 UTC | |
by zentara (Cardinal) on Jan 19, 2012 at 10:42 UTC | |
by Giorgio C (Novice) on Jan 19, 2012 at 14:25 UTC | |
by Anonymous Monk on Jan 19, 2012 at 14:30 UTC | |
by zentara (Cardinal) on Jan 19, 2012 at 16:54 UTC | |
| |
by Anonymous Monk on Jan 16, 2012 at 15:13 UTC | |
by Giorgio C (Novice) on Jan 18, 2012 at 15:10 UTC | |
|
Re: Perl tk - open file and print content
by Anonymous Monk on Jan 16, 2012 at 12:24 UTC |