Replies: 3 comments 24 replies
-
So when working with lists, there's a couple of steps, first, once the menu item is generated it will put a "renderFn" into your INO sketch. This will be called whenever anything happens on the list. You can read about that here - https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/menu-item-types/list-menu-item/ But in short, during setup or when the number of items changes, you set the number of items on the list, then as the list is drawn, it will call the render function to get the name and value for each item. The name appears on the left, the value on the right. The title is a special row, it is the row numbered About the clearest example for how you intend to use it could be - https://github.com/davetcc/tcMenuLib/blob/master/examples/esp/esp32Amplifier/esp32Amplifier.ino#L187 |
Beta Was this translation helpful? Give feedback.
-
No, you always have access to all menu items, take a look at the file yourProjectName_menu.h in your project, it exports every menu item as a global. You can use them anywhere. For example a snippet from picoAdafruitDashboard_menu.h -
|
Beta Was this translation helpful? Give feedback.
-
it this relevant for runtimeMenuItem as well?
…On Sun, May 7, 2023 at 2:01 PM Dave Cherry ***@***.***> wrote:
If it is menu state, you can either use the built in tcMenu save and load
functions if they work for you -
https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/menu-eeprom-integrations/
There are a few possible strategies on how to save discussed on that page,
but never call save during the callback invoke method, you'll destroy the
ROM in days, they are measured in thousands of cycles.
Given that, once you've configured a ROM in code generator, it would be as
easy as menuMgr.save() in the right place.
If you wanted to save custom data, you could use the helper that is
available from menuMgr.getEepromAbstraction(), it is a pointer to the
EEPROM you configured from code generator -
https://www.thecoderscorner.com/products/arduino-libraries/io-abstraction/eeprom-impl-seamless-8-and-32-bit/
—
Reply to this email directly, view it on GitHub
<#335 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADGP5MGQTJTRNAR3QIVSVY3XE56I5ANCNFSM6AAAAAAXAK6CSM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
so i'm trying to create a timezone selection menu where one would selected a country then a city for timezone offset
i would do the same for GPS coordinates
the problems is i can't figure out how to actually create the lists.. i mean assume i have an array of struct i've generated from a pre-made list how would i attach it to the menu
i kept reading the docs, but they seem a little out of sync, like for example the initial raw field doesn't appear in the generator, i thought i would enter that number, and the callback woudl be used for each row to fill out it's name and value.
Beta Was this translation helpful? Give feedback.
All reactions