Is it possible to dynamically set the icon of a three buttons menu button?
For a standard menu button we can use the code below, however a three buttons menu button there is no place to put instructions.
@icon:#default:smiley,$glob:myvar
If this is not possible I could switch from a three button to a single menu button. What is the best way to pass what mouse button was pressed to a custom function?
Not possible for the top-level icon of a three-button. A three-button always has a static icon until it is being clicked with the mouse, where the icon and label will change to reflect the LMB/RMB/MMB button inside it as appropriate.
What's meant by custom function in this context? A user command, script command, or something else?
There are a few ways you can do it with a script command, but for most flexibility you may not want to think in terms of mouse buttons but in terms of behaviours: Pass the script command different arguments when called in different ways (e.g. mouse buttons).
Currently i call the function from a three button, but as I cant make the icon dynamic I am thinking of making the button a standard button.
Could you point me to a sample of how you would code a standard button to pass different params to a function if the mouse is down?
Being able to set a three-button's icon to be dynamic would be a useful addition. I prefer the way a three button works compared to using command modifiers.
My plan here was to update the buttons used in External Compare and Merge Tools. The script stores the the path to the compare/merge tool in a global variables. I want to have the icon change based on the path being set. Setting the icon to colored if the path is set and black and white if not set.
The problem with this approach is I store the compare and merge paths in separate variables.
Having a single button will be miss leading, the icon will only be based on the compare status not the merge.
This brings me back to wanting to have the icon for a three buttons equal to the left button.
Would this be possible to add as a feature enhancement?
You are probably correct. I have updated the buttons for the compare script. I stayed using the three button. You see a gray icon if the path is not yet set when you hold down a button. I think it adds some value.