Skip to content
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

When using 2 RadioButtons it does not like the fact that addItems are the same #172

Open
Gerriko opened this issue Aug 20, 2021 · 0 comments

Comments

@Gerriko
Copy link

Gerriko commented Aug 20, 2021

I wanted to create 2 radio button objects which need to display the same information in two different locations.

Despite giving each addRadioButton different names (radioButton1 & radioButton2), the library gives an error for duplicate addItems found and only displays the 2nd option:

WARNING: Controller with name "/50" already exists. overwriting reference of existing controller.
Aug 20, 2021 11:01:06 AM controlP5.ControlP5 checkName

r1 = cp5.addRadioButton("radioButton1")
         .setPosition(100,180)
         .setSize(20,20)
         .setColorForeground(color(120))
         .setColorActive(color(255))
         .setColorLabel(color(255))
         .setItemsPerRow(5)
         .setSpacingColumn(50)
         .addItem("50",1)
         .addItem("100",2)
         .addItem("150",3)
         ;

  r2 = cp5.addRadioButton("radioButton2")
         .setPosition(200,180)
         .setSize(20,20)
         .setColorForeground(color(120))
         .setColorActive(color(255))
         .setColorLabel(color(255))
         .setItemsPerRow(5)
         .setSpacingColumn(50)
         .addItem("50",1)
         .addItem("100",2)
         .addItem("150",3)
         ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant