News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

FileDialog

Started by coeps, July 15, 2008, 06:12:25 PM

Previous topic - Next topic

coeps

Hello everybody,

How can i use a wxFileDialog with wxSmith?
I want it to open when a Button "Load" was clicked. When I create a FileDialog I see it as a tool, but how can link it to the Button.


thank you,

coeps

byo

In the handler procedure for the button write something like this:


void SomeDialog::OnButton1Click(wxCommandEvent& event)
{
    if ( FileDialog1->ShowModal() != wxID_OK ) return;

    wxString FileName = FileDialog1->GetFilename();
    if ( FileName.IsEmpty() ) return;

    // FileName points to selected file
    wxMessageBox( FileName );
}


Regards
   BYO