|
|
Hi
On Monday, September 26, 2022 at 2:08:54 PM UTC+2 proul...@gmail.com wrote:
On Monday, September 26, 2022 at 4:14:25 AM UTC-4 Manolo wrote:
Hi Pierre,
Hi Manolo, thanks for the answer. One key information is that the destructor of an Fl_Group also deletes all the group's children :
Now, because FLTK widgets are placed in Fl_Window's and Fl_Window's are Fl_Group's, when a window is deleted, all the widgets it contains are deleted too.
Ok, but if you have code that creates a pointer to a FL_button with new, like the following, don't you have to register that FL_Button somewhere so that it is know as a member? Is the new operator overridden by FLTK? Usually you add widgets to somekind of group (Fl_Group, Fl_Window, Fl_Pack, ...). You can add a widget to a group several ways, one way is to use the group's begin() (can be omitted sometimes) and end() functions. I have seen how it works internally, but already forgotten :) If you're interested you can check the Fl_Group::array() function as a starting point. See documentation: https://www.fltk.org/doc-1.3/classFl__Group.html#ab5a03e490bb0dc19f8da7e3e4acdca17
Fl_Button *fluidButton = new Fl_Button(25, 80, 70, 50, "button2");
--
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/65ba116e-a8cb-48c4-9f53-d26bd17b16c7n%40googlegroups.com.
[ Direct Link to Message ] | |
|
| |