home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!acorn!aglover
- From: aglover@acorn.co.uk (Alan Glover)
- Newsgroups: comp.sys.acorn.tech
- Subject: Re: New Iconizer
- Message-ID: <20087@acorn.co.uk>
- Date: 12 Nov 92 10:19:08 GMT
- References: <1992Nov9.124617.28025@dcs.warwick.ac.uk>
- Sender: aglover@acorn.co.uk
- Organization: Acorn Computers Ltd, Cambridge, England
- Lines: 127
-
- In article <1992Nov9.124617.28025@dcs.warwick.ac.uk> ahersee@dcs.warwick.ac.uk (Andrew Hersee) writes:
-
- >> Below is an extract from my code which basically shows you what I am
- >> initialising the task with and the message I am broadcasting. Can
- >> anyone out there explain what I am doing wrong? Why won't Pinboard
- >> open all it's iconized windows and then let me claim any
- >> message_windowinfo messages?
-
- It is the the size of the message you send which Pinboard acts upon,
- and it should be 24 bytes only since there is no other data in the
- message.
-
- >> message_iconize=&400CA
- >> message_windowinfo=&400CB
- >> message_windowclosed=&400CC
-
- Wrong! The draft PRM's which were available at the BBC Acorn User show
- the correct numbers, ie:
-
- Message_Iconize &400CA
- Message_WindowClosed &400CB
- Message_WindowInfo &400CC
-
- They have been wrongly printed in some earlier drafts.
-
- >> mess%!0=17
- >> mess%!4=18
- >> mess%!8=&400C8
- >> mess%!12=&400C9
- >> mess%!16=&400CA
- >> mess%!20=&400CB
- >> mess%!24=&400CC
- >> mess%!32=0
-
- This is ok since this program is running on 3.00 or later. Be careful
- though, if you give the message list as 0 to the Wimp_Initialise in
- 3.00 this means "give me no messages", but in 3.10 it means "give me
- all messages".
-
- >> SYS "Wimp_Initialise",310,&4B534154,"Iconizer",mess% TO wimp,us%
-
- >> !bk%=56
-
- This will not work since you are not sending a message of 56 bytes, only
- 24 bytes! Pinboard assumes that messages greater that 24 bytes are responses
- to requests that it sent.
-
- >> bk%!12=0:bk%!16=message_windowinfo
- >> bk%!20=0:bk%!24=0
-
- This is okay.
-
- >> ignorewindowinfo=TRUE :So that we know not to quit when we receive it
- >> SYS "Wimp_SendMessage",17,bk%,0
- >> myref=bk%!8
- >>
-
- >> It looks as though I may have to write my own Pinboard which would be
- >> a real pain since Pinboard is quit fast at redrawing the background.
-
- When you broadcast this message the pinboard's iconizing will stop but pins
- on the backdrop will still be present.
-
- >> Thanks
-
- No Problem, glad to have helped, at least it's not a bug on Pinboard!!
-
- >> Andrew Hersee
-
- Rupert E.D. Johnson (rjohnson@acorn.co.uk)
-
- (Short program to illustrate getting the Pinboard to reopen windows
- follows. Note that this program is provided to demonstrate a specific
- point, rather than advocate any specific programming style.)
-
- REM >PinOpener
- :
- message_iconize =&400CA :REM These are the correct Message values
- message_windowinfo =&400CC :REM that appear in the Risc OS 3
- message_windowclosed=&400CB :REM PRM's.
- :
- REM Register a Risc OS 3.10 wimp task, given the message structure as 0
- REM ie. 'give me all messages'
- REM
- SYS "Wimp_Initialise",310,&4B534154,"Pinboard Opener",0 TO wimp_vsn%,taskid%
- :
- DIM bk% &100 :REM Scrap memory for Wimp, and building messages
- armed%=0 :REM Arming Sequence Counter
- shutdown%=FALSE :REM TRUE if task is shutting down
- :
- SYS "OS_ReadMonotonicTime" TO oldtime%:REM Read Monotonic Timer
- REPEAT
- SYS "OS_ReadMonotonicTime" TO newtime%
- WHILE (newtime% - oldtime%) > 0:oldtime%=oldtime%+100:ENDWHILE
- SYS "Wimp_PollIdle",0,bk%,oldtime% TO reason%:REM Return from Wimp every second
-
- CASE reason% OF
- WHEN 0: :REM Null
- CASE armed% OF
- WHEN 20: :REM Arming Sequence, 10 seconds until broadcast
- bk%!0=24 :REM >24 are assumed to be from pinboard itself
- bk%!12=0
- bk%!16=message_windowinfo
- bk%!20=0:bk%!24=0
- SYS "Wimp_SendMessage",17,bk%,0:REM Send Message Block
- armed%+=1
- VDU7
-
- WHEN 30: :REM Kill ourselves after 20 seconds
- shutdown%=TRUE
- armed%+=1
- VDU7
-
- OTHERWISE
- armed%+=1 :REM Increase Arming Sequence
- ENDCASE
-
- WHEN 17: :REM User_Message
- IF bk%!&10=0 THEN :REM Received a Message_CloseDown
- shutdown%=TRUE :REM Yes, shutdown flags set
- ENDIF
-
- ENDCASE
- UNTIL shutdown% :REM Have we been asked to shutdown?
- :
- SYS "Wimp_CloseDown" :REM Closedown this task.
- END
-