imacarthur  wrote
> Things that occur to me, in no particular order;
>
> - make sure the all strings are null terminated correctly, in case
> the string handling is running off the ends of the buffers.
>
> - many fltk widgets assume that the string you pass them is in static
> storage, and refer directly to the pointer you pass. So you must make
> sure the char array you pass in is not modified elsewhere, and is not
> declared on stack local storage. If you must pass a string in a
> temporary array, then you can use the widget->copy_label() methods
> rather then the widget->label() methods. This will cause the widget
> to explicitly copy the string rather than referring to your original
> string...
>
> It sounds, from your description, as if the strings are maybe being
> created on the stack or heap in temporary storage and are then
> getting corrupted as the program runs - that would account for why
> the observed corruption varies from run to run. Try modifying your
> code to ensure the strings have correct persistence and see if that
> helps or not.
>
> Hope that helps,
> --
> Ian
>
>

I had try in different way. First i wrote the string as static string, it 
display wrong , and vary from run to run. So, i suspect writing it in statict 
string is not properly deal with by compiler. Second I write the string in a 
resource file, read it from file to a globle array.But it still display wrong.

thanks



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

Reply via email to