From 19ec816c563ca8ad325c22c0ed1cb7281e552a3d Mon Sep 17 00:00:00 2001 From: Sven Anders Date: Mon, 2 Oct 2023 08:26:10 +0200 Subject: [PATCH] Extended Pagination Example with an Main Menu --- docs/examples/pagination.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/examples/pagination.md b/docs/examples/pagination.md index 43432a251..6e1a7d3fb 100644 --- a/docs/examples/pagination.md +++ b/docs/examples/pagination.md @@ -6,7 +6,7 @@ hide: ![pagination](https://user-images.githubusercontent.com/1550668/115120975-aa96c480-9fb0-11eb-9bda-95abcc16ec8e.png) -Pagination can be executed locally using the `action` attribute of the objects. +Pagination can be executed locally using the `action` attribute of the objects. The `jsonl` lines below will setup 3 buttons to the bottom of a 240x320 screen which will navigate back and forth between the pages: ```json linenums="1" @@ -45,3 +45,13 @@ To limit page navigation only to page numbers between 1 and 6: {"page":6,"id":0,"next":1} ``` +You can create a main menu on page 1 like this: +```json linenums="1" +{"id":1,"obj":"btn","action": "p2","x":10,"y":5,"w":200,"h":40,"text":"Doors+Windows","text_font":32} +{"id":2,"obj":"btn","action": "p3","x":10,"y":65,"w":200,"h":40,"text":"Weather","text_font":32} +{"id":3,"obj":"btn","action": "p4","x":10,"y":140,"w":200,"h":40,"text":"Lights","text_font":32} +``` + +If you press on the Button Weather it jumps to page 3 (`"action": "p3"`) + +