> > I call drawline() draw some lines in the window, but I found that > > if I call redraw() function to redraw the whole window, the lines > > I drawed before will be cleared. Why? > > The redraw() call simply tells the system to call the widgets' draw() > functions at some convenient point in the event loop in the future. > The redraw() call does not do the actual drawing. > > Do you call drawline() directly, or indirectly from the widget's > draw() member function? If you are calling drawline() outside draw() > it will never be called again unless you add special logic to do so. > > The usual way to handle this is to derive your own class from an > existing FLTK class, and override the draw() member function to call > drawline() etc. as needed. > > D. >
Thanks for your reply. Yes, I called drawline outside draw() function, now I know if I put the drawline() into override draw() function will has no such issue. But I still has question, because I use drawline() function to implement a painter application, so if I put the drawline() into draw() function, then it will call lots of drawline() at each redarw(). So does fltk has a better solution to implement a painter application? Thanks. Best regards, Leo Wang _______________________________________________ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk