Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #1587

Re: An easy way to let the WIMP update?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit3.readnews.com!s09-11.readnews.com!unm2.readnews.com.POSTED!not-for-mail
X-Trace DXC=9USPZa9gNanTo2hiV5cmhe@lWf8?fSK:ajS@R6]oDiIo[j;g`C24>Vko=iH@LQ<Yb`?R?Ym\Jf5QgjSTHRcOgQLcG[>==_@OGBf_6=D[]SgXGh
X-Complaints-To abuse@gradwell.net
Subject Re: An easy way to let the WIMP update?
Newsgroups comp.sys.acorn.programmer
From Gavin <gav@dentrassis.com>
X-Editor EmailEdit 1.50
Date Sat, 07 Apr 2012 13:57:52 +0100
Message-ID <a1ffaf7c52.Dentrassis@mail> (permalink)
References <2cdb947852.Dentrassis@mail> <527907d28cPaul@sprie.nl> <mpro.m1r1kn05pejpc01nm.news@stevefryatt.org.uk>
User-Agent Messenger-Pro/5.13 (MsgServe/3.43) (RISC-OS/5.18) NewsHound/v1.52-32
Lines 45
Organization readnews.com - News for Geeks and ISPs
NNTP-Posting-Host b5d789aa.newsreader.readnews.com
Xref csiph.com comp.sys.acorn.programmer:1587

Show key headers only | View raw


In message <mpro.m1r1kn05pejpc01nm.news@stevefryatt.org.uk>
          Steve Fryatt <news@stevefryatt.org.uk> wrote:

> On 31 Mar, Paul Sprangers wrote in message
>     <527907d28cPaul@sprie.nl>:

>> You probably don't need to thoroughly re-write your program, in order to
>> let it multi-task. Often, the only thing that should be added is SYS
>> "Wimp_Poll" call at a strategic position.
>> 
>> For example, if your program processes a file during a loop, say a FOR -
>> NEXT loop, you may want to try something like this:
>> 
>> FOR i%=1 TO 1000
>>    REM Do all sort of things
>>    IF i% MOD100 = 0, THEN SYS"Wimp_Poll",&xxxx,block%
>> NEXT i%
>> 
>> ... where &xxxx is the mask that you defined in your original poll call,
>> and block% is the memory block that you defined during setup.

> Not quite, because if you do this, you must make sure that you can handle
> all of the returned reason codes which require immediate attention: for
> example, fail to react to a redraw event with an immediate call to
> Wimp_RedrawWindow and watch things fall over into a messy heap.

> One way to do this, of course, is to wrap your Wimp_Poll call and event
> handler up into a suitable procedure and then do

>   FOR i%=1 TO 1000
>       REM Do all sort of things
>       IF i% MOD100 = 0, THEN PROCpoll_wimp
>   NEXT i%

I tried that, but it didn't work in my case. I wanted the Wimp to 
allow the Filer to update between each file I was processing (from a 
selection that had been dragged in). By calling my wimp poll 
procedure, I just received the next DataLoad message that had been 
queued up, so didn't allow the wimp to update other tasks.

> The other way (which is arguably nicer, but often more difficult to
> implement) is to make your processing code yield after a given time, and
> repeatedly call it from null events until it's done what it needs to do.

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

An easy way to let the WIMP update? Gavin <gc@dentrassis.com> - 2012-03-30 14:36 +0100
  Re: An easy way to let the WIMP update? "John Williams (News)" <UCEbin@tiscali.co.uk> - 2012-03-30 15:53 +0200
  Re: An easy way to let the WIMP update? Martin Wuerthner <spamtrap@mw-software.com> - 2012-03-30 17:18 +0200
    Re: An easy way to let the WIMP update? Gavin <gav@dentrassis.com> - 2012-04-07 13:51 +0100
  Re: An easy way to let the WIMP update? Paul Sprangers <Paul@sprie.nl> - 2012-03-31 12:32 +0200
    Re: An easy way to let the WIMP update? Steve Fryatt <news@stevefryatt.org.uk> - 2012-03-31 13:34 +0100
      Re: An easy way to let the WIMP update? Paul Sprangers <Paul@sprie.nl> - 2012-03-31 15:14 +0200
        Re: An easy way to let the WIMP update? Steve Fryatt <news@stevefryatt.org.uk> - 2012-03-31 16:04 +0100
          Re: An easy way to let the WIMP update? Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2012-03-31 23:31 +0200
            Re: An easy way to let the WIMP update? Steve Fryatt <news@stevefryatt.org.uk> - 2012-04-01 10:51 +0100
          Re: An easy way to let the WIMP update? Paul Sprangers <Paul@sprie.nl> - 2012-03-31 23:46 +0200
        Re: An easy way to let the WIMP update? Gerph <gerph@gerph.org> - 2012-03-31 07:32 -0700
      Re: An easy way to let the WIMP update? Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2012-03-31 23:19 +0200
      Re: An easy way to let the WIMP update? Bob Latham <bob@sick-of-spam.invalid> - 2012-04-01 14:25 +0100
        Re: An easy way to let the WIMP update? Steve Fryatt <news@stevefryatt.org.uk> - 2012-04-01 22:09 +0100
          Re: An easy way to let the WIMP update? Bob Latham <bob@sick-of-spam.invalid> - 2012-04-02 08:21 +0100
            Re: An easy way to let the WIMP update? Alan Wrigley <spamhater@keepyourfilthyspamtoyourself.co.uk> - 2012-04-02 09:54 +0100
        Re: An easy way to let the WIMP update? Gerph <gerph@gerph.org> - 2012-04-01 07:16 -0700
          Re: An easy way to let the WIMP update? Bob Latham <bob@sick-of-spam.invalid> - 2012-04-03 21:26 +0100
      Re: An easy way to let the WIMP update? Gavin <gav@dentrassis.com> - 2012-04-07 13:57 +0100
        Re: An easy way to let the WIMP update? Jeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk> - 2012-04-07 16:01 +0100
        Re: An easy way to let the WIMP update? Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2012-04-07 19:52 +0200

csiph-web