Big thanks you to all of you guys,

It works exactly like I wanted it to be. I had to tweak a bit ben's idea,
messed around for few hours, but got it working at the end (qlthough I am
not too sure on the exactly how I managed, but hey, who cares....).

I think I'll have to write  a 'how-to' on this. This is definitly worth it
!!!!

JM


"Benjamin D. Smedberg" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Jean-Marc Paulin wrote:
> > Wahoooo
> >
> > Fantastic... I'll have a go at it.... I believe this is the pointer I
> > needed.
> >
> > I guess the main catch will be:
> >
> >
> >>You will need to get the
> >>eventqueue from the main thread to pass to the getProxyForObject method.
> >
> > Althouh it seems that I could use the constant NS_UI_THREAD_EVENTQ.
>
> If you create your thread-proxy object in your implementation of
> doSomethingThatTakesForever (which is called on the main/UI thread) you
> can just use CURRENT_THREAD_EVENT_QUEUE.
>
> > The next question will then be: How do I get the IID of the Javascript
> > object ? Or does the Javascript object needs to be created and
registered
> > like any other XPCOM component? another area to investiguate I guess....
>
> IID = interface ID. You would pass Components.interfaces.myICallback.
>
> Your JS object does not need to be registered. It would just be an
> object that implemented two methods, like so:
>
> var myCallback = {
>    notifyProgress: function(progress) {
>      ... do something to update your UI
>    },
>
>    notifyDone: function() {
>      ... do something, now that you're all done
>    }
> }
>
> By the way, you will probably want at least one additional method on
> your myICallback interface, to deal with error conditions if the request
> could not complete successfully.
>
> --BDS


_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to