menu tutorial

Warning:
This tutorial covers only Tiny Mobile Widgets versions.
On Mobile Widgets, use Menu prototype.


This chapter presents the Tiny Mobile Widgets Menu.
Tiny Mobile Widgets provides a menu component. Developer can display this menu into widgets.

example

Note:
We use the softkeys tutorial code to start this tutorial.


Tiny Mobile Widgets menu is displayed via a Message on the "Board" channel.


Note:
List of items is ended by a empty string.
Use internationalization functions to define menu labels.


We create a menu with 3 items: 'Item 1', 'Item 2' and 'Item 3'. Menu can display 5 items maximum (since SDK V2.2.0).
When menu is closed :

When menu is opened:


Current widget code (see softkeys tutorial for more information about this code):


We can create a menu, but menu do nothing when user select an item...
This part explains how to get selected item on the menu.

Manager send message on "Board" channel when user selects an item.
The process of reading messages on "Board" channel is already defined (see softkeys tutorial).

We extend data_changed(...) function to process a new message: "ANSWER".
See "Board" channel chapter for more information about "ANSWER" message.

New data_changed(...) function code: