First you have to make active the group (or a window) where to place the 
widget by calling begin() on that group and then just make the widget 
using new operator. After that you might need to call redraw() upon that 
widget. The parent group will be responsible for that widget an it will 
destroy this widget when the group will be destroyed itself.
You can place all the code within the Callback field in fluid widget 
attributes (in c++ tab) and fluid will create callback wrapper for you 
:-), like

my_group->begin();
(new Fl_Button(20, 30 ,50, 20, "My button"))->redraw();

!!!!!!!HOWEWEWER!!!!!!

Be aware that completely new widget will be created with every call to 
the callback, which would obscure the old one and this is usually not 
good approach. Also for that reason you might consider to create the 
widget from the start and make it invisible. Then you just call show() 
and hide() uppon that widget (in your callbacks) for the widget to 
appear/disappear. In the callback you usually create only new instances 
of top-level windows (like for many documents) which then create all 
comprising widgets in its constructor.

R.

> Inside button callback handler  I want to  add some more widget . How to do
> it by using fluid
> 
> 
> Regards
> Pushparaj
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to