Skip to content

Commit 126ce28

Browse files
committed
Small tidy up of scroll choice doc
1 parent e22f9fd commit 126ce28

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

content/arduino-libraries/tc-menu/menu-item-types/scrollchoice-menu-item.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ Where choice mode is one of:
117117

118118
## Manually creating a ScrollChoice item
119119

120+
Firstly, you can use an info block, that defines the name, ID and EEPROM location. Then create the scroll choice to use the info block:
121+
122+
[const] [PROGMEM] AnyMenuInfo minfoScroll = { "Scroll", myId, myEepromLocation, 0, NO_CALLBACK };
123+
ScrollChoiceMenuItem(minfoScroll, myRuntimeCallback, currentSel, numberOfItems,
124+
&nextMenuItem, isPgm);
125+
126+
Secondly, you can use the callback method for everything:
127+
120128
RENDERING_CALLBACK_NAME_INVOKE(fnScrollChoiceCb, enumItemRenderFn, "Choice",
121129
myEepromLocation, NO_CALLBACK)
122130
ScrollChoiceMenuItem menuScrollChoice(myId, fnScrollChoiceCb, 0,

0 commit comments

Comments
 (0)