[SOLVED] Defer your response, workarounds?
I’m trying to do the following;
When the selected track changes, change the colour of track 1 to yellow
Yes it’s just a test for now.
I’ve tried it several ways but I keep getting the error message
(nanoK Box) There's a problem with 'Action Block 1' in reaction 'Reaction Colour track' (from 'Song - selected track' listener) >>
>> Changes cannot be triggered by notifications. You will need to defer your response.
I’ve written the following Action block to try to work around it:
def set_song_track_color(song):
song().tracks[0].color = 1676960
self.schedule_message(1000, set_song_track_color(self.song))
But I still get the same error. Why isn’t self.schedule_message working?
Creating a reaction that sets a modifier and then a 2nd reaction that detects the changed modifier and sets the track colour results in the same error.
While making a note of your comments Phil,
I just found a note to myself from a while ago:
A workaround of the defer issue is also to update a modifier value, then in a separate reaction, add a listener which waits for a change to that modifier and then update the UI in someway.
So it would look like this:
Reaction 1: – update ‘modifier 1’
Reaction 2: – do another UI event.
Sign up
User registration is currently not allowed.