[SOLVED] Gui notifiers questions

Hello,
stupid question,
but I’m looking for a bug in the script where I wrote my debugging prints.
Of course, I have a lot of notifiers in my gui.
Until now I thought that the code was triggered after every change in value
but these prints convinced me that this is probably not the case.

The function is performed only if it is different from the previous one.
Is that right ?

> vb:popup{
>           midi_mapping="MX:OP1_selector",
>           id="op1",
>           width=70,
>           items=OPERATIONS,
>           value=tmp.OP1,
>           notifier=function(value)
>             tmp.OP1=tonumber(value)
>             print("OP1 changed to " .. tostring(OPERATIONS[value]))
>             redraw_sample()
>           end
>         },

If the value was 5 before and I enter 5 again, the function will not be executed, if I enter 6 then yes.

1 Like

The “value” is the index of the OPERATIONS table.
The “notifier” only work when the popup change the value.

If the OPERATIONS table only contains a item, the popup won’t be able to change.

How many items does the OPERATIONS table have?

in this case 5.
But same is for valuefield.
If you enter same value again nothing is triggered.

this was just an example

That’s how it is. These objects need another value than the current one to change (to run their notifier). What do you need to do exactly?

I debugged the source code using print, but the only notifier reported to me only occasionally. now it’s clear. That explains everything.
Thanks for the consultation.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.