Skip to content

Commit

Permalink
Merge pull request #29 from tabacha/pagination_main_menu
Browse files Browse the repository at this point in the history
Extended Pagination Example with an Main Menu
  • Loading branch information
fvanroie authored Oct 2, 2023
2 parents ac2b244 + 19ec816 commit 6e861ed
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docs/examples/pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"`)


0 comments on commit 6e861ed

Please sign in to comment.