WxFileDialog

From WxPerl wiki

Jump to: navigation, search

You can use the Wx::FileDialog to show a native FileDialog to open or save a file like this:

    # Open a filedialog where a file can be opened
    my $filedlg = Wx::FileDialog->new(  $self,         # parent
                                        'Open File',   # Caption
                                        '',            # Default directory
                                        '',            # Default file
                                        "pVoice datafiles (*.pv)|*.pv", # wildcard
                                        wxOPEN|wxHIDE_READONLY);        # style
    # If the user really selected one
    if ($filedlg->ShowModal==wxID_OK)
    {
        my $filename = $filedlg->GetPath;
        # do something useful
    }
Personal tools
Google AdSense