Load all the coords from the file into an array in ram, so that the draw() function doesn't have to load the file each time (as that's what it sounds like you're doing)
The lines should draw quickly, similar to the 'scroll' test program. See that program (fltk-1.x.x/test/scroll.cxx) for example code. Also, for a simpler line drawing example, see: http://seriss.com/people/erco/fltk/#FltkX Line drawing should be fast, and if you use an Fl_Double_Window instead of a plain Fl_Window, there should be no flicker. (Double == Double Buffered) Manoj wrote: > Hi, > I did not get any reply for this query. > Let me again explain the problem. > > Suppose i have a file which contains coordinates of a line like (xy,y1) and > (x2,y2) for each line. There are thousands of line in this file. > I want to display all these lines on view window. > > For that i create a new window (derived from fl_window or fl_double_window) > and display lines in its draw function. Now i am facing following problems. > > 1. If file size is big i.e. there are so many lines then program is hang > because draw function is called internally for everytime. and i get > flickering also. > > 2. if i don't use draw function and display lines in any user made function > then lines don't appear on screen because user made function called only one > time. > > 3. So i tried to use a timer function and set the time. But in this sometimes > line display contineously and sometime screen become blank for a moment then > lines display after some time. > > > So i want to display these lines without any problem i.e. program should not > be hang and there should not be any flickering. > > Please either give any sample or suggest a solution. > > > > _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

