Page 1 of 1

setting the items of LemurMenu not working?

Posted: 09 Dec 2011 22:58
by misal
i tried to set the content of a LemurMenu as follows:

Code: Select all

setattribute(Menu, 'content', {'asdf', 'asdf', 'fads', 'asdf'});
but nothing happens...
am i doing something wrong?

Re: setting the items of LemurMenu not working?

Posted: 10 Dec 2011 03:15
by Macciza
High
I think there may be an error in the manual (if you were using that for reference)
Whilst the LemurMenu page lists 'content' as the attribute it's actually 'items'

So the scripting would be - setattribute(Menu, 'items', {'opt1', 'opt2'});
And sent via OSC it is - /Menu @items Opt1 Opt2

There is a handy internal function called 'getattributelist' that can report an objects attributes . . .

Cheers
MM

Re: setting the items of LemurMenu not working?

Posted: 10 Dec 2011 16:20
by misal
Thank you. Now it works!

Re: setting the items of LemurMenu not working?

Posted: 23 Mar 2012 14:43
by Xenophile
The manual does indeed have an error. I spent about half an hour puzzling over this last night. A search of the forums turned up an example of the correct attribute name, "items." Kind of frustrating when you dutifully RTFM, but get the wrong answers there.