def _handle_set_tile(data: dict) -> None:
    payload = data['payload']
    title = payload.get('title')
    page = _to_page(data['context'])
    if title != deck_api.get_button_text(
            _deck_id, page, _to_button_index(data['context'], page)):
        deck_api.set_button_text(_deck_id, page,
                                 _to_button_index(data['context'], page),
                                 title)
Exemple #2
0
def update_button_text(ui, text: str) -> None:
    deck_id = _deck_id(ui)
    api.set_button_text(deck_id, _page(ui), selected_button.index, text)
    redraw_buttons(ui)
def _reset_button(button_index: int, image_path: str, page: int) -> None:
    deck_api.set_button_text(_deck_id, page, button_index, '')
    deck_api.set_button_command(_deck_id, page, button_index, '')
    deck_api.set_button_icon(_deck_id, page, button_index, image_path)