does your menu consist of items which are always buttons?
If so, you can create an xml-file describing the menu and
its widget-template that includes a button.

Then you can create new items with:

Code:

MMSWidget *item = menu->newItem();

Afterwards you can change the behaviour of the button
inside this item (i.e. setting images, colors).
You can find some examples at:
http://wiki.morphine.tv/tiki-index.php?page=gui-examples
We'll integrate more examples and the description of the
GUI elements at diskohq.org as well. But for now you can take a look
at the documentation of Morphine.
Best regards,
Matthias

Basically you cannot add just any widget you create to a menu widget. You have to create an item template and pass it to the menu. Then you can use the newItem() method to add a new entry to that menu.

I Hope that illustrates it a bit. The menu is our most sophisticated widget, so there are lots of options for the menu layout and how the selection works. This is just one simple way of using it.

The functions button_clicked and button_return prints a simple message on the console with the address of the widget. When the options of the menu are pressed, in the log message appears that a button has been pressed and released, but not text is shown on the screen.

The text of functions is shown if a button is added to the vertical box and the same slots are set to it.

you have to connect your onReturn() method to the top-level-menu,
not the items itself. The reason is, because the surrounding menu
will catch all Inputs and they will never get to the child-widgets
(the items).

Btw. you should only use either onClick() or onReturn() in most
cases. If you're using the mouse or the keyboard to navigate
there is not a big difference. It's more important for touchscreen
based input. As an explanation, onClick() is called if you press
the button, onReturn() after releasing.