We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › controlP5 colorLabel doesn't work for all controls
Page Index Toggle Pages: 1
controlP5 colorLabel doesn't work for all controls (Read 358 times)
controlP5 colorLabel doesn't work for all controls
Jan 25th, 2009, 3:34am
 
using controlP5.setColorLabel works fine for sliders, but not for Toggles or Buttons or Radio.

controlP5.setColorActive, however, DOES work for all of them.  

how do i set color of labels for toggles, buttons, or radios?  i can post code if that would help, but it's pretty straightforward.  i thought i might have to hack it with the unofficial captionLabel() method but although there is a captionLabel().setColorBackground() there is no captionLabel().setColorLabel() function.  

maybe controlP5.setColorLabel is not an official feature yet, so I can't do it?
Re: controlP5 colorLabel doesn't work for all cont
Reply #1 - Jan 28th, 2009, 3:17pm
 
okay even though global setColorLabel for some reason doesn't work with toggle or buttons, they can be set individually.  this is  temp fix, but i don't get why global change doesn't work.  

also, the temp fix does not work for radio controllers.  perhaps i have to reference the individual radio buttons ("A","B"), but not sure how.  any ideas?

Code:

import controlP5.*;

ControlP5 controlP5;

void setup() {
size(400,400);
controlP5 = new ControlP5(this);
controlP5.setColorLabel( color(200,0,0) );

// this is the correct color
Slider s = controlP5.addSlider("s_test", 0,100, 0, 20,20,100,15);

// this is NOT the correct color
Toggle t = controlP5.addToggle("t_Test", false, 20, 60, 15, 15);

// but this is a temp fix (uncomment it to see it work) :
//t.setColorLabel( color(200,0,0) );

// this is NOT the correct color
Radio r = controlP5.addRadio("r_Test", 20,110, 15,15, 20);
r.add("A", 0);
r.add("B", 1);

// and this temp fix does NOT work:
r.setColorLabel( color(200,0,0) );
}

void draw() {
background(0);
}
Re: controlP5 colorLabel doesn't work for all cont
Reply #2 - Jan 28th, 2009, 3:48pm
 
Hi eric,
Sorry for all the struggle with the color setup. I am currently looking into it and will update you as soon as a new version is out.
Best,
Andreas
Re: controlP5 colorLabel doesn't work for all cont
Reply #3 - Jan 28th, 2009, 3:56pm
 
cool, thanks.  hey, while i have your attention - any ideas on snapping controllers to increments?  or simply rounding off?  

see:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=LibraryProblems;action=display;num=1232858782;start=0#0
Page Index Toggle Pages: 1