var b1 = new button(text1,func2) var b2 = new button(text2,func2) var m = new menu() m.addButton(b1) m.addButton(b2)The "addButton()" method explicitly adds a button to a menu. Use it with buttons with an extensive definition, or when you want to add buttons to an already existing menu. The above example is equivalent to:
m = new menu(text1,func1,text2,func2)which should be adequate for most situations.