Toggle toolbar button pressed state


#1

Is there any way to toggle the toolbar button’s pressed state to ‘PRESSED’ or ‘UNPRESSED’.
When I do Sketchup.active_model.select_tool(tool) the button associated to ‘tool’ is not changing to ‘PRESSED’ state.


#2

Look up the “Command#set_validation_proc” method.


#3

I have used the “Command#set_validation_proc” to gray and check right click menu options for a tool that I developed.

I have noticed on Windows that when a toolbar button is configured to run a simple Ruby program, then the button pops up immediately. If the button has code that does:

`Sketchup.active_model.select_tool(my_tool)`

Where “my_tool” is a Tool class object that I defined, then the button stays down until I exit my tool.

@amruthrajv:
Are you on Mac or Windows?
What methods does your “tool” object support?