|
Post by lightcalamar on Nov 24, 2016 0:55:01 GMT -8
Hello.
I have one problem. Not change label button after touch. My code;
GD.Tag(105); GD.cmd_fgcolor(0x000000); GD.ColorRGB(0xff8000); GD.cmd_button(280, 180, 110, 30, 28, 0, "STEREO"); if (GD.inputs.tag==105){ radio.setMono(true); GD.cmd_fgcolor(0x000000); GD.cmd_bgcolor(0x300030); GD.ColorRGB(0x00ff00); GD.ClearTag(105); GD.cmd_button(280, 180, 110, 30, 28, 0, "MONO"); } When you press MONO but exit STEREO again, how do you exit MONO when you press? Regards
|
|
|
Post by jamesbowman on Nov 24, 2016 9:42:54 GMT -8
You need some kind of state variable in your program.
Maybe something like this:
static int ismono = 1;
if (GD.inputs.tag != 105) GD.Tag(105); GD.cmd_fgcolor(0x000000); GD.cmd_bgcolor(0x300030); char *label; if (ismono) { GD.ColorRGB(0x00ff00); label = "MONO"; } else { GD.ColorRGB(0xff8000); label = "STEREO"; } GD.cmd_button(280, 180, 110, 30, 28, 0, label);
if (GD.inputs.tag == 105) { ismono = !ismono; radio.setMono(ismono); }
|
|
|
Post by lightcalamar on Nov 25, 2016 10:47:14 GMT -8
Thanks James. Works fine! Regards.
|
|
|
Post by jamesbowman on Nov 25, 2016 13:34:56 GMT -8
You're welcome - looking good!
|
|