On 17.05.2011 20:18, Francesco wrote: >> Override your widget s draw() function. In there, set the clipping = >> to your widget size. Then call parent()->draw(). Then draw you widget.
Be careful with this! Although Matt should know, maybe he was in a hurry, or I may be wrong... Calling parent->draw() in your widget's draw() method would IMO result in a recursive and endless loop of calling your widget's draw() method! ( Matt? ) Instead you should consider calling parent()->redraw() when you call your_widget->redraw() to schedule both draw() methods for the next FLTK drawing cycle - if your widget has a *transparent* background (e.g. a frame box type). If your widget draws its own solid background you should simply draw it before you draw other parts on top of it. In this case you could use a frame box type as well. If you use a "normal" box type, you can simply call Fl_Widget::draw_box() or draw the box (and background) yourself. Albrecht P.S. These questions should go to fltk.general, since fltk.development is used for developement of the FLTK library only. _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
