Wimp_WhichIcon on Iconbar
Julie Stamp (8365) 474 posts |
Hi, I’m trying to enumerate the icons on the iconbar. I tried
but the list is empty ( |
Rick Murray (539) 13840 posts |
Hmm… Just had a quick rummage in the Wimp and spotted this: CMP R0,#nullptr2 ; if iconbar, BNE %FT01 ; check that the task owns this icon So it may be that you cannot interrogate other icons on the iconbar using Wimp_WhichIcon. |
Rick Murray (539) 13840 posts |
There is, of course, more than one way to flay a feline… DIM x% 1023 x%!0 = -2 SYS "Wimp_GetWindowInfo",, x% SYS "XOS_CLI", "Memory "+STR$~(x% + 88) It’s the iconbar window definition, with its icons following as of +88 in the block. |
Steve Pampling (1551) 8170 posts |
That would be the bit that Nemo was re-arranging to shuffle icons on the bar. |
David J. Ruck (33) 1635 posts |
In my WindOpen module, I enumerate the icon bar modules by looping through icon numbers 0 to 255 (hopefully enough), sending wimp message user ack (19) to the icon number on the task bar (window -2), this returns the owning task handle if valid. You can then read the icon infomation Wimp_GetIconState, and get any indirected strings from task memory using Wimp_TransferBlock (if thats used in iconbar icons, I can’t remember). |
Andrew Conroy (370) 740 posts |
When I’ve had to do it before, I’ve done exactly the same as druck, iterated through the icons and done a Wimp_GetIconState on them once I know who they belong to. |
Julie Stamp (8365) 474 posts |
Great stuff :-)
|
Steve Fryatt (216) 2105 posts |
Usually you’d call it twice: first with bit 0 of R1 set, so that it returns everything apart from the icon definitions, then again with bit 0 clear after you’d allocated a suitably sized block of memory for the data. |