Wrapper around MenuLayer, that uses static data to display a list menu.
Creates a new SimpleMenuLayer on the heap and initializes it. It also sets the internal click configuration provider onto given window.
The sections
array is not deep-copied and can therefore not be stack allocated, but needs to be backed by long-lived storage.
This function does not add the menu's layer to the window.
The frame at which to initialize the menu
The window onto which to set the click configuration provider
Array with sections that need to be displayed in the menu
The number of sections in the sections
array.
Pointer to application specific data, that is passed into the callbacks.
A pointer to the SimpleMenuLayer. NULL
if the SimpleMenuLayer could not be created
Destroys a SimpleMenuLayer previously created by simple_menu_layer_create.
Gets the "root" Layer of the simple menu layer, which is the parent for the sub-layers used for its implementation.
Pointer to the SimpleMenuLayer for which to get the "root" Layer
The "root" Layer of the menu layer.
Gets the row index of the currently selection menu item.
The SimpleMenuLayer for which to get the current selected row index.
Selects the item in the first section at given row index.
The SimpleMenuLayer for which to change the selection
The row index of the item to select
Supply true
to animate changing the selection, or false
to change the selection instantly.
Data structure containing the information of a menu item.
The title of the menu item. Required.
The subtitle of the menu item. Optional, leave NULL
if unused.
The icon of the menu item. Optional, leave NULL
if unused.
The callback that needs to be called upon a click on the SELECT button. Optional, leave NULL
if unused.
Data structure containing the information of a menu section.
Title of the section. Optional, leave NULL
if unused.
Array of items in the section.
Number of items in the .items
array.
Function signature for the callback to handle the event that a user hits the SELECT button.
The row index of the item
The callback context
Do you have questions about the Pebble SDK?
Do you need some help understanding something on this page?
You can either take advantage of our awesome developer community and check out the SDK Help forums, or you can send us a message through the website!