Cambridge10
Programmer
Hi,
I've created a file dialog where an user can choose a txt file.
There is also a cancel button which I need to configure but I don't know how to approach it?
Disabling the cancel button will also be fine.
I've created a file dialog where an user can choose a txt file.
There is also a cancel button which I need to configure but I don't know how to approach it?
Disabling the cancel button will also be fine.
Code:
sub Load_file
{
$file_path_entry -> delete('0.0', 'end');
my $file;
my @types = (["Text files", '.txt', 'TEXT'],[""] );
$file = $mw->getOpenFile(-filetypes => \@types);
open IN,$file;
my @tfile = <IN>;
chop @tfile;
close (IN);
#convert / to \ filepath
$file =~ s/\//\\/g;
$file_path_entry -> insert(0,"$file");
$file_path = $file;
$passing_path = $file_path;
}