Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The "cutting edge" is getting rather dull. -- Andy Purshottam


devel / comp.sys.acorn.programmer / Re: Wimp_RedrawWindow protocols

SubjectAuthor
* Wimp_RedrawWindow protocolsPaul Sprangers
`* Re: Wimp_RedrawWindow protocolsSteve Fryatt
 `* Re: Wimp_RedrawWindow protocolsPaul Sprangers
  +* Re: Wimp_RedrawWindow protocolsHarriet Bazley
  |`- Re: Wimp_RedrawWindow protocolsPaul Sprangers
  `- Re: Wimp_RedrawWindow protocolsMartin

1
Wimp_RedrawWindow protocols

<59da004dcaPaul@sprie.nl>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=132&group=comp.sys.acorn.programmer#132

  copy link   Newsgroups: comp.sys.acorn.programmer
From: Pau...@sprie.nl (Paul Sprangers)
Subject: Wimp_RedrawWindow protocols
Newsgroups: comp.sys.acorn.programmer
Date: Sat, 16 Apr 2022 12:57:03 +0200 (Custom)
Message-ID: <59da004dcaPaul@sprie.nl>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.52-32
Organization: None
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe004.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 43
Injection-Date: Sat, 16 Apr 2022 12:59:31 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2180
 by: Paul Sprangers - Sat, 16 Apr 2022 10:57 UTC

[This topic is a spin off from elsewhere]

In article <mpro.rafg4d01cbkc603j7.news@stevefryatt.org.uk>,
Steve Fryatt <news@stevefryatt.org.uk> wrote:

> > > When a Wimp_Poll returns reason code 1 (RedrawWindow), then
> > > Wimp_RedrawWindow must be the first Wimp call made, and it should
> > > not be called at any other time.

> > Ah, now I understand what you mean - and I sin against that rule
> > indeed. Before calling Wimp_RedrawWindow, I do a Wimp_GetWindowInfo
> > call. Should I really move that one after the redraw call?

> What details do you need to find from Wimp_GetWindowInfo to perform the
> redraw, that you don't get in the block returned by Wimp_RedrawWindow and
> Wimp_GetRectangle?

> > If I do, things go horribly wrong.

> Define "horribly wrong"... which might help us help you. :-)

Horribly wrong in this case means that I get a 'Number too big' error in
another subroutine when opening the application window.

The details that I get from Wimp_GetWindowInfo is the x and y origins of
the window in question:

SYS "Wimp_GetWindowInfo",,block%
ox% = block%!4 - block%!20
oy% = block%!16 - block%!24

However, I noticed that I can move the latter two lines to within the WHILE
more% - ENDWHILE loop and delete the Wimp_GetWindowInfo call, so that the
RedrawWindow call is the first one in the redraw routine. Unfortunately, it
doesn't change anything about some other glitches, that probably have
nothing to do with the redraw routine, but the more so with my general and
ubiquitous flaws.

Paul

--
http://riscos.sprie.nl

Re: Wimp_RedrawWindow protocols

<mpro.rafl8502cchs903j7.news@stevefryatt.org.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=133&group=comp.sys.acorn.programmer#133

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!aioe.org!wUBOHGVSkkz9PTvSBH1HKg.user.46.165.242.75.POSTED!not-for-mail
From: new...@stevefryatt.org.uk (Steve Fryatt)
Newsgroups: comp.sys.acorn.programmer
Subject: Re: Wimp_RedrawWindow protocols
Date: Sat, 16 Apr 2022 12:57:47 +0100
Organization: Aioe.org NNTP Server
Lines: 28
Message-ID: <mpro.rafl8502cchs903j7.news@stevefryatt.org.uk>
References: <59da004dcaPaul@sprie.nl>
Content-Type: text/plain; charset=us-ascii
Injection-Info: gioia.aioe.org; logging-data="8150"; posting-host="wUBOHGVSkkz9PTvSBH1HKg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Messenger-Pro/2.73.6.4252 (Qt/5.12.8) (Linux-x86_64)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Steve Fryatt - Sat, 16 Apr 2022 11:57 UTC

On 16 Apr, Paul Sprangers wrote in message
<59da004dcaPaul@sprie.nl>:

> The details that I get from Wimp_GetWindowInfo is the x and y origins of
> the window in question:
>
> SYS "Wimp_GetWindowInfo",,block%
> ox% = block%!4 - block%!20
> oy% = block%!16 - block%!24

You should probably be calling

SYS "Wimp_GetWindowInfo",,block% OR 1

unless you know that you have space for all of the icon definitions in
block%, otherwise memory corruption will be a risk. With bit 0 set, the Wimp
will only return the main window data and omit the icon blocks at the end --
so you know how big the returned block will be.

Unless you need the entire window definition, which you don't above,
Wimp_GetWindowState is a better bet, too. Although often, as in this case,
the Wimp includes the information in the return from the call that you've
just made -- so there's no need for any additional call at all.

--
Steve Fryatt - Leeds, England

http://www.stevefryatt.org.uk/

Re: Wimp_RedrawWindow protocols

<59da0a93c2Paul@sprie.nl>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=134&group=comp.sys.acorn.programmer#134

  copy link   Newsgroups: comp.sys.acorn.programmer
From: Pau...@sprie.nl (Paul Sprangers)
Subject: Re: Wimp_RedrawWindow protocols
Newsgroups: comp.sys.acorn.programmer
Date: Sat, 16 Apr 2022 14:49:16 +0200 (Custom)
Message-ID: <59da0a93c2Paul@sprie.nl>
References: <59da004dcaPaul@sprie.nl> <mpro.rafl8502cchs903j7.news@stevefryatt.org.uk>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.52-32
Organization: None
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.roellig-ltd.de!open-news-network.org!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!abe006.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 47
Injection-Date: Sat, 16 Apr 2022 14:49:25 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1872
 by: Paul Sprangers - Sat, 16 Apr 2022 12:49 UTC

In article <mpro.rafl8502cchs903j7.news@stevefryatt.org.uk>,
Steve Fryatt <news@stevefryatt.org.uk> wrote:

> You should probably be calling

> SYS "Wimp_GetWindowInfo",,block% OR 1

> unless you know that you have space for all of the icon definitions in
> block%

The window in question doesn't have any icons at all, but the point was
that I shouldn't call Wimp_GetWindowInfo in the first place. At least, not
before calling Wimp_RedrawWindow.

The start of the redraw routine was originally:

DEF PROCredraw(wh%)
!block% = wh%
SYS "Wimp_GetWindowInfo",,block%
ox% = block%!4 - block%!20
oy% = block%!16 - block%!24
SYS "Wimp_RedrawWindow",,block% TO more%
WHILE more%
etc...

Following Martin A.'s suggestion, I now have:

DEF PROCredraw(wh%)
!block% = wh%
SYS "Wimp_RedrawWindow",,block% TO more%
WHILE more%
ox% = block%!4 - block%!20
oy% = block%!16 - block%!24
etc...

There's no noticeable difference in behaviour between the two versions,
although I would think that the first one might be a microscopic bit
faster, since it has to calculate the ox% and oy% only once.

So, actually my question is: how compulsory is the alledged rule that no
other call should precede the Wimp_RedrawWindow call?

Paul

--
http://riscos.sprie.nl

Re: Wimp_RedrawWindow protocols

<845f0dda59.harriet@bazleyfamily.co.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=135&group=comp.sys.acorn.programmer#135

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: harr...@bazleyfamily.co.uk (Harriet Bazley)
Newsgroups: comp.sys.acorn.programmer
Subject: Re: Wimp_RedrawWindow protocols
Date: Sat, 16 Apr 2022 14:19:48 +0100
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <845f0dda59.harriet@bazleyfamily.co.uk>
References: <59da004dcaPaul@sprie.nl> <mpro.rafl8502cchs903j7.news@stevefryatt.org.uk> <59da0a93c2Paul@sprie.nl>
Injection-Info: reader02.eternal-september.org; posting-host="4572e14c4538f7e8f2855c751eecfd6a";
logging-data="4639"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18J6ZsX3MImfKhF29C7hwmgA3gM1XasojU="
User-Agent: Messenger-Pro/8.04 (MsgServe/8.04) (RISC-OS/5.29) NewsHound/v1.53-32 RC1
Cancel-Lock: sha1:ycV6phCk1xtwS93Vd+JD9BqFYK8=
X-Clacks-Overhead: GNU Terry Pratchett
 by: Harriet Bazley - Sat, 16 Apr 2022 13:19 UTC

On 16 Apr 2022 as I do recall,
Paul Sprangers wrote:

> The window in question doesn't have any icons at all, but the point was
> that I shouldn't call Wimp_GetWindowInfo in the first place. At least, not
> before calling Wimp_RedrawWindow.

[snip]

> So, actually my question is: how compulsory is the alledged rule that no
> other call should precede the Wimp_RedrawWindow call?
>
I think what Martin Avison was saying in message
<59d9b91b68News03@avisoft.f9.co.uk> was that Wimp_RedrawWindow should
not be called by your program *at all* save in response to a Wimp_Poll
redraw window request (reason code 1):

> > When a Wimp_Poll returns reason code 1 (RedrawWindow), then
> > Wimp_RedrawWindow must be the first Wimp call made, and it should not
> > be called at any other time.
> >
> > Does that help?

Looking through the StrongHelp manuals (I've never done any window
updating outside the poll loop), I think you may be intended to call
Wimp_ForceRedraw (which will cause your window to receive the above
mentioned Wimp_Poll request) or Wimp_UpdateWindow, which does the same
thing, only not via the poll loop but immediately.

https://www.riscosopen.org/wiki/documentation/show/Wimp_UpdateWindow

--
Harriet Bazley == Loyaulte me lie ==

You /really/ don't want to know.

Re: Wimp_RedrawWindow protocols

<59da10121dNews03@avisoft.f9.co.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=136&group=comp.sys.acorn.programmer#136

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 16 Apr 2022 08:49:28 -0500
From: New...@avisoft.f9.co.uk (Martin)
Subject: Re: Wimp_RedrawWindow protocols
Newsgroups: comp.sys.acorn.programmer
Date: Sat, 16 Apr 2022 14:49:16 +0100
Message-ID: <59da10121dNews03@avisoft.f9.co.uk>
References: <59da004dcaPaul@sprie.nl> <mpro.rafl8502cchs903j7.news@stevefryatt.org.uk> <59da0a93c2Paul@sprie.nl>
User-Agent: Pluto/3.19a (RISC OS/5.29) NewsHound/v1.54
Organization: None
Lines: 26
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-3sdD/U2Up+vppiLPAWkkEHAUoLB0OwKuG+5RmRBZtnzj8+1OXgrkk5T28HylRoOgVbOKTV3bnzNNk08!UN3MFNRvHeXumvkV6/p/S/cDfrOqUDxYf14q9r+frqnsmGRMhVAsFx7NJaoMWQoQD4T1X0H4XWY1!9Vc=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1852
 by: Martin - Sat, 16 Apr 2022 13:49 UTC

In article <59da0a93c2Paul@sprie.nl>,
Paul Sprangers <Paul@sprie.nl> wrote:
> Following Martin A.'s suggestion, I now have:

> DEF PROCredraw(wh%)
> !block% = wh%
> SYS "Wimp_RedrawWindow",,block% TO more%
> WHILE more%
> ox% = block%!4 - block%!20
> oy% = block%!16 - block%!24
> etc...

> There's no noticeable difference in behaviour between the two
> versions, although I would think that the first one might be a
> microscopic bit faster, since it has to calculate the ox% and oy%
> only once.

If that is a concern, how about moving the ox% & oy% calculations from
within the WHILE to just before it? I do not think that the visible
area will change between redraws - although obviously the redraw
rectangle will.

--
Martin Avison
Note that unfortunately this email address will become invalid
without notice if (when) any spam is received.

Re: Wimp_RedrawWindow protocols

<59da1846b2Paul@sprie.nl>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=137&group=comp.sys.acorn.programmer#137

  copy link   Newsgroups: comp.sys.acorn.programmer
From: Pau...@sprie.nl (Paul Sprangers)
Subject: Re: Wimp_RedrawWindow protocols
Newsgroups: comp.sys.acorn.programmer
Date: Sat, 16 Apr 2022 17:18:53 +0200 (Custom)
Message-ID: <59da1846b2Paul@sprie.nl>
References: <59da004dcaPaul@sprie.nl> <mpro.rafl8502cchs903j7.news@stevefryatt.org.uk> <59da0a93c2Paul@sprie.nl> <845f0dda59.harriet@bazleyfamily.co.uk>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.52-32
Organization: None
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!abe006.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 60
Injection-Date: Sat, 16 Apr 2022 17:19:00 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2828
 by: Paul Sprangers - Sat, 16 Apr 2022 15:18 UTC

In article <845f0dda59.harriet@bazleyfamily.co.uk>,
Harriet Bazley <harriet@bazleyfamily.co.uk> wrote:

> I think what Martin Avison was saying in message
> <59d9b91b68News03@avisoft.f9.co.uk> was that Wimp_RedrawWindow should
> not be called by your program *at all* save in response to a Wimp_Poll
> redraw window request (reason code 1):

Ah, I see. And that's what I do. Wimp_RedrawWindow occurs only once in the
entire program, as a response to reason code 1.

> Looking through the StrongHelp manuals (I've never done any window
> updating outside the poll loop), I think you may be intended to call
> Wimp_ForceRedraw (which will cause your window to receive the above
> mentioned Wimp_Poll request) or Wimp_UpdateWindow, which does the same
> thing, only not via the poll loop but immediately.

I already use the Wimp_UpdateWindow call for direct update of distinct
parts of the window. So, I think I've done this part of the redraw
protocols right.

> > DEF PROCredraw(wh%)
> > !block% = wh%
> > SYS "Wimp_RedrawWindow",,block% TO more%
> > WHILE more%
> > ox% = block%!4 - block%!20
> > oy% = block%!16 - block%!24
> > etc...

> If that is a concern, how about moving the ox% & oy% calculations from
> within the WHILE to just before it? I do not think that the visible
> area will change between redraws - although obviously the redraw
> rectangle will.

Moving those calculations to just before the WHILE works indeed, but only
after the RedrawWindow call. Moving them before that call generates an
error, unless it is preceded by the GetWindowInfo call. This may be obvious
for the better informed, but not for me. The redraw routine now looks like
this:

DEF PROCredraw(wh%)
!block% = wh%
SYS "Wimp_RedrawWindow",,block% TO more%
ox% = block%!4 - block%!20
oy% = block%!16 - block%!24
WHILE more%
etc...

To me those calculations between the call and WHILE look a bit silly, but
well... it works, and I no longer need the GetWindowInfo call.

Many thanks for your thoughts!

Paul

--
http://riscos.sprie.nl

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor