Trying to use a rollout to toggle between mouse tools

I'm trying to set up a rollout with buttons for several different mouse tools. I want to be able to toggle between them without having to right-click them off first.

I can't start a new mouse tool while the old one is still running, and I'm having very strange results with using the stopTool method from within the rollout. A button can apparently stop a tool from running, but NOT stop a tool AND start a different one. (Actually, and even more oddly, it can be toggled exactly one time. In other words, you can switch from one tool to another, but then can never switch back short of a right-click.)

Try out the below script to see what I mean.

tool toolOne
(
on freeMove do format "1\n"
)

tool toolTwo
(
on freeMove do format "2\n"
)

rollout RO_Tools "Mouse Tools"
(
button btn1 "Tool 1"
button btn2 "Tool 2"
button btn_Quit "Quit"

on btn1 pressed do
(
stopTool toolTwo
startTool toolOne
)

on btn2 pressed do
(
stopTool toolOne
startTool toolTwo
)

on btn_Quit pressed do
(
stopTool toolOne
stopTool toolTwo
)
)
createDialog RO_Tools

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Malkalypse's picture

Bump...

Bump...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.