> if(o->value == "white"){ blabla} 
> my if condition is never verified. why's that ?

  because o->value is a char* pointer to some area of memory
  containing the characters "white\0" and you are trying to
  compare it to a different char* pointer to a different area
  of memory containing the characters "white\0" ?

  try using
  if (strcmp(o->value, "white") == 0) { blabla}


> and while trying to get around this problem i tried:
> 
> const char *p = o->value();
> if(p="white"){
> o->value("black");
> }  //notice the only equal sign !
> 
> and, very strangely, the if condition is always satisfied!
> even when the value of the widget has changed ! (and it has
> changed, i made it appear in a window...)

  because if (p="white") assigns the char* pointer to an area
  of memory containing the characters "white\0" to p, and then
  tests whether p is true (ie non-zero). this will be true for
  any string on the left hand side, and false for 0 or NULL.

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to