-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new index property. #34
Added new index property. #34
Conversation
Nice to have, when using an array of Button2 instances which share a callback function.
Hey Paulo, In your pull request you add an ID which you have to enter manually. Cheers |
Hello Lennart,
Thanks for your reply. The thing is, I need a button array, where each
button index is in sync with another array(s) of objects.
I did it before, with the button parameter, as you pointed out, but it is
much nicer to add a property where I have control of the value, than to do
a massive case switch later on.
Anyway, my use case may not be that relevant to others and as an optional
parameter, your code will still work perfectly fine without it, furthermore
it fits perfectly my needs.
Thanks for your well crafted code
…On Sat, Mar 26, 2022 at 6:29 AM Lennart Hennigs ***@***.***> wrote:
Hey Paulo,
you want to differentiate buttons in a single handler, correct?
When you take a look at MultipleButtons.ino
<https://github.com/LennartHennigs/Button2/blob/master/examples/MultipleButtons/MultipleButtons.ino>
there I differentiate the buttons via the provided button parameter. Is
this not sufficient?
In your pull request you add an ID which you have to enter manually.
If you need an ID wouldn't it be nicer if it were to be auto generated?
But then again, is that different from the *button* parameter provided
for the button handler as you could use it, too?
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALDMPY7NPQ6DATFLD53S43VB2VEXANCNFSM5RMHEHMQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hey,
Ah. I see. Well, I‘ll then add an optional ID parameter (but further down in the constructor to keep other peoples code intact).
Happy coding :-)
… Am 26.03.2022 um 10:38 schrieb Paulo Oliveira ***@***.***>:
Hello Lennart,
Thanks for your reply. The thing is, I need a button array, where each
button index is in sync with another array(s) of objects.
I did it before, with the button parameter, as you pointed out, but it is
much nicer to add a property where I have control of the value, than to do
a massive case switch later on.
Anyway, my use case may not be that relevant to others and as an optional
parameter, your code will still work perfectly fine without it, furthermore
it fits perfectly my needs.
Thanks for your well crafted code
On Sat, Mar 26, 2022 at 6:29 AM Lennart Hennigs ***@***.***>
wrote:
> Hey Paulo,
> you want to differentiate buttons in a single handler, correct?
> When you take a look at MultipleButtons.ino
> <https://github.com/LennartHennigs/Button2/blob/master/examples/MultipleButtons/MultipleButtons.ino>
> there I differentiate the buttons via the provided button parameter. Is
> this not sufficient?
>
> In your pull request you add an ID which you have to enter manually.
> If you need an ID wouldn't it be nicer if it were to be auto generated?
> But then again, is that different from the *button* parameter provided
> for the button handler as you could use it, too?
>
> —
> Reply to this email directly, view it on GitHub
> <#34 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AALDMPY7NPQ6DATFLD53S43VB2VEXANCNFSM5RMHEHMQ>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.
|
Just pushed changed. there is now a |
Thanks for the update.
…On Mon, Apr 4, 2022 at 1:29 PM Lennart Hennigs ***@***.***> wrote:
Just pushed changed. there is now a getID() and setID()function. Will
release it as a new version after some more changes.
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALDMP4MZBGRH4XB6M7YMNTVDLOBHANCNFSM5RMHEHMQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Nice to have, when using an array of Button2 instances which share a callback function.