Notifications
Clear all

[Closed] how to uncheck checkd button on toolbars

The macroscript I´m working on includes a rollout floater that opens when the script button is pressed. It also uses the “on isChecked” event to make the button on the toolbar a checkbutton. However if the user closes the floater by hitting the X on the top, then the button on the toolbar remains checked, wich results on the user havign to double-click the button in order to open it again.

This, of course, is not a big deal, but the script would look a lot more “profesional” if the button on the toolbar would uncheck when hitting the X. I can use a “on <rollout> close” event on the first rollout inside the folater to call a function to un-check the button. However I have so far been unable to find wich sed function could be…

Any tips??

Thanks.

2 Replies

There you go

macroscript CkeckTest
category:"Test"
buttonText:"T"
(
global Ro_Test
local UIopen= false
on isChecked return UIopen
on execute do
(
if UIopen then -- close UI
(
destroyDialog Ro_Test
)
else
(
rollout Ro_Test "Check Test"
(
	label l1 "on isChecked Test rollout"
 
	on Ro_Test open do UIopen=true
	on Ro_Test close do
	(
	 UIopen=false
	 updateToolbarButtons()
	)
)
createdialog Ro_Test
)
)
)

So, updatetoolbarbuttons eh? Makes sense…

Thanks!