|
|
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());
..so that the widget internally makes a copy of the string.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/1f8c2acb-07b8-0cc4-ec95-db6a930005b0%40seriss.com.
[ Direct Link to Message ] | |
|
| |