Page 1 of 1

Icon change for a built-in TB button?

Posted: 02 Oct 2013 16:11
by aurumdigitus
For some obscure reasons would like to change the icon for a built-in TB button. But since the Context menu exhibits no Edit function it seems impossible.

But that said, do you of the XY cognoscenti know of a path by which this can be accomplished?

Re: Icon change for a built-in TB button?

Posted: 02 Oct 2013 16:39
by TheQwerty
You could use a resource "hacker" to attempt to replace the icon stored in XYplorer.exe, but I definitely do NOT recommend this.

You could replace the built-in button with your own custom version. I just posted an example of this for another user.

You could do one better than that example and just call the original button's actions using the Button() SC, but it's difficult to get a true replacement if the button has a dropdown arrow and it's not extremely clear how to immediately show the context menu. The latter can be done by making the right-click script something like:

Code: Select all

"_Initialize" Button('visualfilter', 2);
However in doing this you make it difficult to then edit that button - though there exists another script for that. You might be able to handle the former by jumping through some hoops and using Get('Trigger'), but I haven't experimented with this.



If you don't mind my asking which button are you trying to change?

Re: Icon change for a built-in TB button?

Posted: 02 Oct 2013 16:49
by Nighted
XY uses a PNG to store its icons. This is difficult to replace with resource hacker alone.

Re: Icon change for a built-in TB button?

Posted: 02 Oct 2013 17:43
by aurumdigitus
TheQwerty wrote:If you don't mind my asking which button are you trying to change?
It is a circuitous little tale. Very much liked the Expandable drive button script by serendipity. Only later came to realize it did not display the two optical drives on the machine. Pondering the situation remembered reading Don's suggestion some place to just use the Computer button. That does the job but wanted the icon to show main purpose of drives per se not the computer.

So using you code suggestion modified to:
"_Initialize" Button('myco', 2);
in a CTB with :drives for the icon all is well.

Thank you for again solving the problem. :appl: