Page 1 of 1

Cannot assign icon to xys-menu entry

Posted: 21 Aug 2015 18:07
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.

Re: Cannot assign icon to xys-menu entry

Posted: 21 Aug 2015 18:25
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)

Re: Cannot assign icon to xys-menu entry

Posted: 21 Aug 2015 18:28
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.
:?:

Re: Cannot assign icon to xys-menu entry

Posted: 21 Aug 2015 20:32
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.

Re: Cannot assign icon to xys-menu entry

Posted: 21 Aug 2015 21:00
by bdeshi
And my intricately constructed logic goes down the drain... :bug: