On 08/21/11 09:22, asif saeed wrote: > Hi, > > Is there any way I could prevent my widgets from getting added to fltk > groups automatically and have the ability to add fltk widgets to fltk groups > myself - dynamically?
begin() and end() are the way to control this. If you end() the parent window, for instance, then widgets will be created but not attached to a parent, in which case to attach them, you can use the appropriate Fl_Group::add(Fl_Widget*) to parent them, which is something you should do quickly, otherwise the widget might pop up in a window of its own. When I want to add widgets, I usually call the parent's begin(), then create the widget, then call the parent's end(). If I don't want the widget to show up right away, I'd call hide() to hide it from being shown, then later call show() to show it. If you're trying to create a bunch of widgets that you want to be able to re-parent from one widget to another, you should be able to use Fl_Group::remove() and Fl_Group::add() to move the widgets around. Note that Fl_Window derives from Fl_Group, so the add()/remove() methods mentioned above applies to windows too. _______________________________________________ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk