H�kan Waara wrote:

> Hey. I see that there has been a lot of work on the new nsIPrompt 
> interface lately. However, I'm wondering when I should use it.
> 
> Does it replace nsICommonDialogs? Is there any documentation or 
> something I could read to find out?


You should use nsIPromptService instead of nsICommonDialogs. 
nsICommonDialogs is dead - it should be removed from the tree. The 
interface you should use is nsIPromptService. It's pretty well 
commented. See:
 
http://lxr.mozilla.org/seamonkey/source/embedding/components/windowwatcher/public/nsIPromptService.idl

You can get the prompt service and use it to put up a dialog. For 
embedding, you can also create and register your own implementation of 
the prompt service. Then, any code in mozilla which uses the service to 
put up a dialog will use your implementation. Two embedding examples do 
this, each in a different way. See:

http://lxr.mozilla.org/seamonkey/source/embedding/browser/powerplant/source/CBrowserApp.cp#272

and

http://lxr.mozilla.org/seamonkey/source/embedding/tests/mfcembed/MfcEmbed.cpp#144

The nsIPrompt interface should never be seen or used from embedding. 
Before, the chrome object would implement nsIPrompt and the docshell 
tree owner would use GetInterface on the chrome in order to get a 
prompt. This is no longer the case. If your chrome is implementing 
nsIPrompt, it will never be called.


> 
> Thanks



Reply via email to