deluxnate 0 Newbie Poster

Small introduction; been using C++ for two years at college level, and now I've outgrown the console. Having a little trouble in wxWidgets though, since I apparently don't understand how wxButtons work. What I want to do is have a dialog come up with text entry, and an ok button to run some code when it's pressed.

BEGIN_EVENT_TABLE(MainFrame, wxFrame)
    EVT_MENU(ID_CULTURE_CHOICE, MainFrame::Culture_Choice)
END_EVENT_TABLE()
void MainFrame::Culture_Choice(wxCommandEvent & WXUNUSED(event))
{
    // Dialog for culture choice
    prompt = new wxDialog(this, 0, wxT("Search Culture Counts"), wxPoint(140,140), wxSize(163,126));

    // Throw up the controls 
    wxStaticText *sometext = new wxStaticText(prompt, -1, _("Enter a drug to search for:"), wxPoint(5,5));
    wxTextCtrl *controlbox = new wxTextCtrl(prompt, -1, _("DRUG"), wxPoint(7,25), wxSize(120,20));
    wxButton *okButton = new wxButton(prompt, wxID_OK, wxT("Ok"), wxPoint(42,55), wxSize(70, 30));    
    okButton->SetDefault();

    if(prompt->Show() == wxID_OK)
    {
        wxMessageDialog dialog(prompt, wxT("I should see this!"), _T("Debugging"), wxOK );
    }
}

When it runs, the OK button works and returns back to the parent frame, but doesn't execute code in the if statement. What I would like is for it to run another event inside the if, but if I can't even get this then there has to be something fundamentally wrong with what I'm doing.

I've spent days puzzling over this, so if I need to paste more info to get an answer I'll be glad to. Thanks in advance.