Carl Ding wrote:
> Thank you for your explanation. I have used Fl_Table::rows() to
> resize the table. Now, I add a remove() before calling
> delete_widget() in order to delete the embedded widget.
> It seems working. But I'm not sure whether it is the correct
> sequence to remove a widget.
Honestly, I can't remember either; I always have to look
at the docs and the code. The docs for Fl_Group::remove()
and Fl::delete_widget() don't really elaborate much on
the order of calling one or the other:
http://fltk.org/documentation.php/doc-1.1/Fl_Group.html#Fl_Group.remove
http://fltk.org/documentation.php/doc-1.1/Fl.html#Fl.delete_widget
I don't think the order matters, as long as they are
close together, one right after the other.
delete_widget() only *schedules* deletion, which is
actually handled by the FLTK app loop later on when it
thinks it's safe to do so, the widget doesn't get destroyed
immediately.
remove() just removes the pointer from the parent,
doesn't do any deleting.
So doing either one first probably doesn't matter,
as long as they're next to each other. (someone feel free
to correct me).
> I have another question regarding to Fl_Table. I embed some
> button widgets into Fl_Table. When I click those buttons,
> their callback functions can be triggered. Is it possible
> to pass these mouse click events to their parent, i.e., Fl_Table,
> so that its callback function can also be triggered?
Hmm, I'd suggest if there's code in your Fl_Table callback
that you want executed by the button's callback, put that
code in a separate method, and have both the Fl_Table
and button callbacks call that method separately.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk