[softwarelist] Re: OPro script Icon question (RISC OS)

  • From: Alan Adams <alan@xxxxxxxxxxxxxxxx>
  • To: davidpilling@xxxxxxxxxxxxx
  • Date: Mon, 12 Sep 2016 11:23:14 +0100

In message <e1c962be55.Dentrassis@mail>
          Gavin Crawford <gav@xxxxxxxxxxxxxx> wrote:

In message <249a52be55.Alan.Adams@xxxxxxxxxxxxxxxxxxxxxx>
          Alan Adams <alan@xxxxxxxxxxxxxxxx> wrote:

In message <9be516be55.Dentrassis@mail>
          Gavin Crawford <gav@xxxxxxxxxxxxxx> wrote:

would seem that when I delete icon number 10 and re-create a new one,
it also is created as icon number 10. Which was a surprise and has
worked nicely regarding mouse click events - whether it works that way
on all versions of the wimp I'm not sure.

What seems to happen is that the "deleted" bit is set in the icon flag
word. If it was actually deleted all subsequent icons would be
renumbered.

When you create a new icon the first "deleted" icon is replaced.

Thus as you have observed if you delete one icon then create one the
same icon number is re-used. However if you delete multiple icons then
create new ones te new numbers will be in ascending order as they are
created.

Thanks Alan for that clarification. That's good, as I can be sure that
it should work like that every time. I'm only deleting one icon and
remaking it.

Gavin

My information is based on observation, not internals knowledge, but 
is logical.

To be safe, use a variable to hold the icon number (I use 
ic<nameoficon>% for mine), and when recreating the icon update the 
variable.

Using variables I find makes the code more readable when going back to 
it.

To unsubscribe or subscribe goto: //www.freelists.org/list/davidpilling


-- 
Alan Adams, from Northamptonshire
alan@xxxxxxxxxxxxxxxx
http://www.nckc.org.uk/
To unsubscribe or subscribe goto: //www.freelists.org/list/davidpilling

Other related posts: