Change pressed/unpressed state of custom button
Posted: 25 Aug 2018 13:19
Here is a script (intended for custom button on toolbar) to switch between "Details" view and "Small Icons" view:
Here are the buttons, as they are located on my toolbar:
The issue here is that I can't properly control pressed/unpressed button state. Try it yourself:
Make sure that custom button is unpressed. Then press 1st button, 2nd button, again 1st button, again 2nd button. You will see that they are properly toggled. When 1st button is pressed, the 2nd is automatically released. So, everything works correct.
Now press custom button and then press 1st or 2nd button. You will see that despite you pressed 1st or 2nd button, the 3rd is still pressed. Obviously, I want to fix it. Is it possible?
Cheers, John.
Code: Select all
"Toggle Details/Small Icons View"
// Details - 0 - #302;
// Small Icons - 3 - #305;
$path = get("Path");
$mode = get("View");
if ($path != "Computer") {
if ($mode != 3) {
#305;
ctbstate(1);
}
else {
#302;
ctbstate(0);
}
}
The issue here is that I can't properly control pressed/unpressed button state. Try it yourself:
Make sure that custom button is unpressed. Then press 1st button, 2nd button, again 1st button, again 2nd button. You will see that they are properly toggled. When 1st button is pressed, the 2nd is automatically released. So, everything works correct.
Now press custom button and then press 1st or 2nd button. You will see that despite you pressed 1st or 2nd button, the 3rd is still pressed. Obviously, I want to fix it. Is it possible?
Cheers, John.