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

Offline sachink

  • Single posting newcomer
  • *
  • Posts: 6
ShowModal() not working
« on: January 11, 2009, 09:01:48 pm »
  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)

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

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,