1

I'm trying to retrieve the current selected/saved index of my AutoConnectSelect Right now i'm creating a type that reads the saved json:

 AutoConnectSelect& bright = settingsAux["scr_brightness"].as<AutoConnectSelect>();

How can i get the index of the element selected in bright as an integer?

bright.value and bright.value() are both invalid in this context.

Any help or insight into how these types work would be appreciated.

asked Jun 25, 2021 at 20:53
2
  • 1
    After hunting through the source, I have come to the conclusion you should try bright.selected and see what that does. Commented Jun 25, 2021 at 21:49
  • Thank you! .selected works. Commented Jun 26, 2021 at 1:02

1 Answer 1

1

The member i was looking for is AutoConnectSelect.selected I just subtract the value by one to get the index, as .selected starts from 1.

answered Jun 26, 2021 at 1:04

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.