How to present open folder open dialog in Perl?

How to open the folder selection dialog in Perl?

+3
source share
3 answers

Depends on the GUI system used and, possibly, the platform. For example, on Windows and with, Win32::GUIyou can use GetOpenFileName:

# $main is your main window...
$my_file = $main->GetOpenFileName(
    -title => 'Select a file...',
    -file => 'default.file',
);
+7
source

Most portable (at least compared to ot he rs ):

use Tk;
my $dir = Tk::MainWindow->new->chooseDirectory;

Of course, if you are actually using Tk in the rest of your program, you should call chooseDirectoryin the appropriate parent widgets instead of creating and destroying here.

+7

GUI wxPerl.

+3

Source: https://habr.com/ru/post/1725116/


All Articles