One-shot toolbar button on Mac
-
The following code ought to create a toolbar button that acts once when clicked and then returns control to the previously active Tool. Instead, on Mac, the button toggles between "unpressed" and "pressed" each time it is clicked. Dan Rathbun says this works as expected on a PC.
Tried this on SU 8 and SU 2013 with all other plugins disabled, with the toolbar floating, docked, and with the tool added to the top toolbar. Same results in all cases.
tb=UI;;Toolbar.new "Test" cmd = UI;;Command.new("clickme") {puts "click!"} cmd.set_validation_proc { MF_UNCHECKED } tb.add_item cmd tb.show
Advertisement