> 3. When the add menu item is clicked, a new button appears, but has garbage
> text.
Garbage text sounds like a well known problem:
> void set( string str ) { label(str.c_str()); }
label() doesn't copy the string (but there is a copy_label()), but just
saves the given const char*. But your string is local, so the content
vanishs fast. There are several solutions, most easy seems to be:
void set( string str)
{
delete[] label();
copy_label(str.c_str());
}
or a local string as class member:
void set( string str)
{
my_Label= str;
label(my_Label.c_str());
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk