I don't think there is any other way than the above (or fetching/parsing renoise preferences) to build a toggle button with the correct active color. Or maybe that's what you meant?
I'm guessing that you use the checkbox notifier and then set "checkbox.value == true" as a trigger for this function? Kind of like an invisible relay to do other stuff?
If that's the case, I recommend using Document observables instead. Using GUI elements for this is not the 'clean way' of doing it
Something like the below can be very handy if you want to trigger the same function in several different ways (i e from several different places). Also note in the Documents API that there are other observable document types.
local do_something = renoise.Document.ObservableBang()
print("the do_something object was banged! anything can happen here.")
Edited by joule, 06 June 2017 - 18:23.