Fl_Check_Button*
o = new Fl_Check_Button(470, 60 + 15 * numbuttons, 1000,
15, name.c_str());
Here Fl_Check_Button's constructor
is saving the pointer to name.c_str()
and is not making a copy of the string. So the
string has gone out of scope by the
time the strings are being drawn.
Instead use:
Fl_Check_Button*
o = new Fl_Check_Button(470, 60 + 15 * numbuttons, 1000,
15);
o->copy_label(name.c_str());
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.