Cannot assign icon to xys-menu entry

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
Stef123

Cannot assign icon to xys-menu entry

Post by Stef123 »

With 15.60.0003, I cannot assign icons anymore, it shows the wrong ones. Say I run this in test.xys:

Code: Select all

"Open some file|<xyicons>\Myicon.ico" <xypath>\..\Test\test.txt
It won't show Myicon.ico, even though it exists, assigning it in favorite files does work, however.
What I get to see is some other icon instead, cannot say where XY pulls it from.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Cannot assign icon to xys-menu entry

Post by bdeshi »

I don't that was ever supported. [checked in 15.50.0003]
When you supply just a file path alone as the body of a script, it becomes a goto script. The menu item's icon is taken from the file/folder it points to.
Here's the relevant blurb from that helppage ::help 'idh_scripting.htm#idh_scripting_multi'; //under "The Goto-Shorthand" heading
In a multi-script resource you can now pass a plain path/file spec as a shorthand for a well-formed goto script. Such a line will be auto-converted to a valid goto command including the appropriate icon in the generated popup menu.

Long version using well-formed goto scripts with captions:

Code: Select all

"C:\|C:\" goto "C:\";
"C:\Windows|C:\Windows" goto "C:\Windows";
"C:\WINDOWS\SoundMan.exe|*" goto "C:\WINDOWS\SoundMan.exe";
Equivalent shorthand version:

Code: Select all

C:\
C:\Windows
C:\WINDOWS\SoundMan.exe
See the emphasis. The icon is always taken from the target item. Even the detailed script shows that the icon is not customized.

That being said, I'd also expect to see custom icons in such scripts when they're laboriously defined (even though I seldom use this "goto shorthand" scripting style)
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Cannot assign icon to xys-menu entry

Post by bdeshi »

assigning it in favorite files does work, however.
yes, I'd expect the same in regular goto scripts too. But,
What I get to see is some other icon instead, cannot say where XY pulls it from.
:?:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Cannot assign icon to xys-menu entry

Post by Stef123 »

Well, it definitely was supported, officially endorsed or not. I have been using it for many months and versions, can prove it any time with dozens of entries - which, and now it gets REALLY interesting, still works from within the very same xys. It looks like this:

Code: Select all

"AHK-Help|help3.ico" <xypath>\..\ahk\AutoHotkey.chm
"My Help|help4.ico" <xypath>\..\myHelp\Helpnotes.rtf
The first one still shows help3.ico, whereas the second line, which I added AFTER upgrading to 15.60.0003, does not show help4.ico, but some arbitrary icon - I don't know where it comes from.

I suspect it has to do with getting my color labels back to life - that's the only change that came with 15.60.0003. Gotta be related to icon cache, I guess - and I just realized I can take the long route via

Code: Select all

"My Help|help4.ico" open "<xypath>\..\myHelp\Helpnotes.rtf";
Will have to rewrite 50 entries or so, but that's ok, I rather do that than losing my color labels again.

I just want to point it out - in case it might become important some day.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Cannot assign icon to xys-menu entry

Post by bdeshi »

And my intricately constructed logic goes down the drain... :bug:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply