button_panel_add_item

Function button_panel_add_item 

Source
pub unsafe extern "C" fn button_panel_add_item(
    button_panel: *mut ButtonPanel,
    index: u32,
    matrix_place_x: u16,
    matrix_place_y: u16,
    x: u16,
    y: u16,
    icon_name: *const Icon,
    icon_name_selected: *const Icon,
    callback: ButtonItemCallback,
    callback_context: *mut c_void,
)
Expand description

Add item to button_panel module.

Have to set element in bounds of allocated size by X and by Y.

ยงArguments

  • button_panel - ButtonPanel instance
  • index - value to pass to callback
  • matrix_place_x - coordinates by x-axis on virtual grid, it is only used for navigation
  • matrix_place_y - coordinates by y-axis on virtual grid, it is only used for naviagation
  • x - x-coordinate to draw icon on
  • y - y-coordinate to draw icon on
  • icon_name - name of the icon to draw
  • icon_name_selected - name of the icon to draw when current element is selected
  • callback - function to call when specific element is selected (pressed Ok on selected item)
  • callback_context - context to pass to callback