## fetch a single file using getOpenFile sub get_single_file { ## read from the command line? from the web? ## unless (($_[0] and -e $_[0]) or ($_[0] and $_[0] =~ /^http:/)) { require Cwd; #local $Tk::FBox::a; #local $Tk::FBox::b; my $path = $current_data_dir || Cwd::cwd; my $types = [['All Files', '*'], ['data files', ['.dat', '.xmu']], ['chi(k) files', '.chi'], ['Athena project files', '.prj'], ]; if ($Tk::VERSION > 804) { my $file = $top -> getOpenFile(-filetypes=>$types, #(not $is_windows) ? # (-sortcmd=>sub{$Tk::FBox::a cmp $Tk::FBox::b}) : () , -initialdir=>$path, -multiple => 1, -title => "Athena: Open one or more data files"); $file ||= []; return @$file; } else { my $file = $top -> getOpenFile(-filetypes=>$types, #(not $is_windows) ? # (-sortcmd=>sub{$Tk::FBox::a cmp $Tk::FBox::b}) : () , -initialdir=>$path, -title => "Athena: Open a SINGLE data file"); $file ||= q{}; return $file; }; };