Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.acorn.programmer > #6418
| From | Sebastian Barthel <naitsabes@freenet.de> |
|---|---|
| Newsgroups | comp.sys.acorn.programmer |
| Subject | Re: Update iconbar icon |
| Date | 2022-12-15 14:55 +0000 |
| Message-ID | <tnfcge$13r25$1@solani.org> (permalink) |
| References | <5a1560a69erhemmings@rgvk.co.uk> |
Am Tue, 09 Aug 2022 19:05:22 +0100 schrieb Rob Hemmings:
> It is a long time since I've done any programming on RISC OS and I'd be
> very grateful for a quick bit of advice on something I've forgotten.
>
> Is it possible to change the state of an iconbar icon? I'm writing a
> very simple BASIC program to toggle the state of a system variable and
> I'd like a visual indication of which state it is in. It seems a waste
> to open a separate window just for that so it would be neater to just
> make an alteration to the iconbar icon but I can't remember if that is
> possible?
>
> Thanks in advance for any advice.
It is a long time since You've posted this question ...
but eventually its interesting to You and other folks how this can be done
in a BASIC fragment, which You should be usable in this form:
active% = TRUE
DIM bariconname% 12 : $bariconname% = "active"
baricon%=FNdefine_icon(bariconname%)
wimploop
SYS "Wimp_Poll",pollmask%,pollblock% TO pollevent%
CASE pollevent% OF
WHEN 6 : CASE pollblock%!8 OF
WHEN %100:
active%=NOT(active%) : barmenu%!52=barmenu%!52 EOR %1
IF active% THEN $bariconname%="active" ELSE $bariconname%="nonactive"
block%!0=-2 : block%!4=baricon%
block%!8=0 : block%!12=0
SYS "Wimp_SetIconState",,block%
WHEN %010:
SYS "Wimp_GetPointerInfo",,block%
SYS "Wimp_CreateMenu",,barmenu%,block%!0-60,230
ENDCASE
loopend
DEF FNdefine_icon(name%)
LOCAL width%,hight%,icon%
SYS"Wimp_SpriteOp",40,,$(name%) TO ,,,width%,hight%
block%!0=-1
block%!4=0
block%!8=0
block%!12=width%*2
block%!16=hight%*4
block%!20=%0011000100001010
block%!24=name% : block%!28=1 : block%!32=12
SYS "Wimp_CreateIcon",,block% TO icon%
=icon%
The only thing needed is a !Sprite File with at least two Icons in it
named "active" and "nonactive". This File has to known by the WIMP. The
easiest way to achieve this is by Running an "Iconsprites <Obey$Dir>.!
Sprites" Command in the !Run Obey File.
Back to comp.sys.acorn.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Update iconbar icon Rob Hemmings <rhemmings@rgvk.co.uk> - 2022-08-09 19:05 +0100
Re: Update iconbar icon Steve Fryatt <news@stevefryatt.org.uk> - 2022-08-09 19:28 +0100
Re: Update iconbar icon Rob Hemmings <rhemmings@rgvk.co.uk> - 2022-08-10 09:32 +0100
Re: Update iconbar icon Harriet Bazley <harriet@bazleyfamily.co.uk> - 2022-08-09 19:41 +0100
Re: Update iconbar icon Sebastian Barthel <naitsabes@freenet.de> - 2022-12-15 14:55 +0000
Re: Update iconbar icon Rob Hemmings <rhemmings@rgvk.co.uk> - 2022-12-19 13:15 +0000
csiph-web