Author Topic: ShowModal() not working  (Read 5008 times)

Offline sachink

  • Single posting newcomer
  • *
  • Posts: 6
ShowModal() not working
« on: January 11, 2009, 09:01:48 pm »
Hi,
  I am new to code::blocks plugin development. I want to develop a plug-in which displays a dialog on clicking an editor context menu.
I have created a dialog using wxsmith plugin and want to instantiate it when the context menu on the editor is clicked.
Here is the code of menu click handler function:

void NewDlgOnMenu::OnUnrollForLoopMenu(wxCommandEvent& event)
{
    cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
    if (!ed)
        return;

    // display unrollforllop dialog
    UnrollLoopDialog dlg(Manager::Get()->GetAppWindow());
    PlaceWindow(&dlg);
    Manager::Get()->GetLogManager()->Log( _("here: before showmodal") );
    if (dlg.ShowModal() == wxID_OK)
    {
        Manager::Get()->GetLogManager()->Log( _("here: in showmodal if") );
        return;
    }
    Manager::Get()->GetLogManager()->Log( _("here: Done") );
    return;
}


I get "here:before showmodal" in the code::blocks log window. None of the next two messages are displayed in the log window. Also the dialog is not getting displayed. Can somebody tell me what could be the possible problem?

Thanks in advance,
Sachin