Windows events queue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Windows events queue

Ingo Blank
Hi,

while running long loops, Dolphin doesn't process any queued Windows events.
This is sometimes very annoying. Is there a possibility to force a polling
of the events queue  (Like 'DoEvents' in VB) ?

Thanks
Ingo


Reply | Threaded
Open this post in threaded view
|

Re: Windows events queue

Bill Schwab
Ingo,

> while running long loops, Dolphin doesn't process any queued Windows
events.
> This is sometimes very annoying. Is there a possibility to force a polling
> of the events queue  (Like 'DoEvents' in VB) ?

There are at least two alternatives.

The preferred method is probably to fork another process, with the preferred
priority (usually) being Processor userBackgroundPriority.  Updates to the
GUI from such a thread are often happiest when "synchronized" with it using
#queueDeferredAction:.

In rare circumstances in which you really need to explicitly run a message
loop, you can follow the example of MouseTracker>>startTracking:.

If you are spending a lot of time in external calls, then you might need to
overlap them to get the results you want, but, be careful to respect the
(very few actually) rules if venture into it.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Windows events queue

Blair McGlashan
In reply to this post by Ingo Blank
Ingo

You wrote in message news:3b008518$0$2117$[hidden email]...
>
> while running long loops, Dolphin doesn't process any queued Windows
events.
> This is sometimes very annoying. Is there a possibility to force a polling
> of the events queue  (Like 'DoEvents' in VB) ?

The direct equivalent would be:

    SessionManager inputState pumpMessages.

There is also #loopWhile:, which gives more control.

However there are alternatives to polling not available in VB, as Bill
mentions, since Dolphin can run background threads.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Windows events queue

Ingo Blank
In reply to this post by Bill Schwab
Thank you Bill !

BTW, I recently posted you via [hidden email].
Is it possible, that my mail got junked by a spam filter ?

Bye
Ingo


Reply | Threaded
Open this post in threaded view
|

Re: Windows events queue

Joey Gibson-2
In reply to this post by Blair McGlashan
In article <9dr12n$jkadf$[hidden email]>, blair@object-
arts.com says...

>
> The direct equivalent would be:
>
>     SessionManager inputState pumpMessages.
>
> There is also #loopWhile:, which gives more control.
>
> However there are alternatives to polling not available in VB, as Bill
> mentions, since Dolphin can run background threads.

   DSDN (great tool!) blocks the whole of Dolphin during a search. I've
often thought of changing it so that I could do something else while the
search is progressing (I like to multitask my time...). For something
like that, which of these suggestions would best fit? I thought of
forking the search into another thread, but then you have to deal with
the cancel button differently and I haven't made any attempts to
actually do it beyond some experimenting with sample objects. Where
would one include the SessionManager inputState pumpMessasges call, for
example?

Joey


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


Reply | Threaded
Open this post in threaded view
|

Re: Windows events queue

Ian Bartholomew
Joey,

>    DSDN (great tool!) blocks the whole of Dolphin during a search. I've
> often thought of changing it so that I could do something else while the
> search is progressing (I like to multitask my time...).

Go to DsdnShell>>search and edit the last half of the method to read ...

found := OrderedCollection new.
[elapsed := Time millisecondsToRun: [
    search searchAndCollectIn: found.
    classes searchAndCollectIn: found.
    methods searchAndCollectIn: found.
    packages searchAndCollectIn: found.
    archive searchAndCollectIn: found.
    ec searchAndCollectIn: found.
    wiki searchAndCollectIn: found.
    info searchAndCollectIn: found].
    search setDocuments: found.
    Sound bell.

    status value: ' ', elapsed printString, ' milliseconds'.
    Processor sleep: 1500.
    self updateStatus] forkAt: Processor userBackgroundPriority

... and you should be able to continue working while the search progresses,
albeit a little sluggishly. It might be better to avoid shutting down DSDN
while a background search is in progress though - he says, just in case <g>

I did spend some time trying to speed up the DSDN search, it was the main
reason for the inclusion of the caching mechanism for all data loaded from
files. On my box a full search, with an empty cache, takes about 20 seconds
and subsequent searches about 2 seconds, which I thought reasonable. On
slower machines (mine's a 750 P3) a background search would probably make
more sense.

Ian