> > This would be better: > > >> if(strcmp(startBtn->label(), "Continue")=3D=3D0)
> yes point taken, i did not check anything in the docs for > that one, just wrote it in, i will change, but it does > compile and run without issue, compiled with gcc and all > warnings -w ? The code is correct in terms of syntax, so there's nothing for the compiler to spot there. Matt's point is that you are comparing the address of the const string "Continue" with the address pointer stored in the widget. Now, as it happens, most buttons just copy the pointer to the label string, rather than wasting memory by making a redundant copy of the label text, so the test you are doing *happens* by chance, to work. But if the button (for whatever reason) needs to modify its label, at that point it will make a local copy, and thereafter the comparison (of the addresses) will fail, even if the label content text is identical... And depending on the label simply copying the string pointer probably is not portable - e.g. just because gcc does it, does not mean that all compilers do! So you need to use strcmp() to compare the actual label content, rather than just testing the address of the string pointer... These are simple C-strings, so the equality test is only checking the pointers. (If you use a C++ string class, you can make the equality test check the content of the strings, but that's not what you have done...) SELEX Galileo Ltd Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL A company registered in England & Wales. Company no. 02426132 ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

