Skip to main content
Known Participant
April 10, 2019
Answered

Close Modal CEP window from C++

  • April 10, 2019
  • 1 reply
  • 1709 views

I have a AI C++ plugin where I create the UI with a CEP extension.

In there I have (amongst some panels) also a modal dialog/window.

Opening that window by loading the extension works well, and everything inside the window works.

I can close the window from Javascript by using window.close(), but there are reasons why it would be better for me that I could close the window from the C++ side.

Unloading the extension will not close the window. (at least not for me). but it does 'end' the underlying CEPEngine

How can I close the window also?

Or can I specify in the manifest LifeCycle section some command that will trigger the closure of the window on unload?

Thanks

Frank

This topic has been closed for replies.
Correct answer nick moody

Ok, it's a little bit hard to understand the problem out of context. Is csInterface.closeExtension() method also doesn't suit you? And btw why you didn't use it in the first place? It closes an extension and kills the CEPEngine process in one step.

 

Honestly, I don't think there's a way to close modal dialog right from the plugin.

1 reply

nick moody
Inspiring
April 14, 2019

Probably, you can simply set arbitrary event listener in CEP extension (callback should invoke window.close() method) and before unloading of the extension just dispatch the corresponding event from the plugin.

Known Participant
April 15, 2019

That setup still requires the page to be modified to handle the close, and that is exactly what I want to keep outside of the window javascript.

Second, if you handle the close like this, you still have to wait in some way for the window.close() to be handled, before you can unload the extension... which means you need yet another callback from the CEP extension to the C++...

nick moody
nick moodyCorrect answer
Inspiring
April 15, 2019

Ok, it's a little bit hard to understand the problem out of context. Is csInterface.closeExtension() method also doesn't suit you? And btw why you didn't use it in the first place? It closes an extension and kills the CEPEngine process in one step.

 

Honestly, I don't think there's a way to close modal dialog right from the plugin.