Lua Menu Question

Started by garry23, July 11, 2016, 06:43:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

garry23

@David

I've convinced myself that the Lua set.menu only works with numbers. Thus this is OK:

menu.set("Auto Bracketing","Focus bracketing?",0)

But this is not:

menu.set("Auto Bracketing","Focus bracketing?","No")

Because when I use the second format, the script freezes.

Am I correct?

BTW that menu is set up with a choices call and if I use 0 or, say, 2, it works but always goes to the first entry in choices.

Cheers

Garry

dmilligan

It should work, but I suppose there could be issues if you are trying to use menu.set() to set the value of your own script's menu items. Instead of doing it like that, just set the "value" property of the menu object your script created.

If that's not it, can you be more specific than "the script freezes"? What sort of stuff is printed to the console?

garry23

David

You are a star.

That was it, I was menu.set in a warning function in a menu. Just changing to this.value approach solved the issue.

The freeze BTW occurred after I had gone into a sub menu, the freeze was that the Q button failed to return the sub menu to the parent.

Thanks, once again, for your prompt support. :)

Cheers

Garry