|
|
On 4 Jan 2022, at 20:56, david allen wrote:
>
> All children take the label of the last child. I've tried a few things like using "add" and specifying labels apart from the constructors to no avail.
David,
You’ve used the same char array “label” for all the labels, so that’s why they are the same...
If you are doing that, you need to use the copy_label() method rather than just the label() method.
Check the docs, but basically label() just retains a pointer to the array you use, so if it then changes or goes out of scope, bad things can happen. If you use copy_label() the widget will make a local copy and then it doesn’t matter what happens to the “label” array - but costs you more memory...
This is true of all fltk labels, I think, and is not peculiar to the Fl_Pack class.
--
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/DDCC6336-A625-4DDB-B7D9-10B8602EC950%40gmail.com.
[ Direct Link to Message ] | |
|
| |