On 20 Mar 2009, at 16:21, Eoin wrote: > I've derived my own class from Fl_Gl_Window which is part of my > FLTK GUI. I'm taking information from the mouse so I've written a > MyFlGlWindow::handle() function that does stuff when the mouse is > moved over the window. > > I found that I had to include a call to show() in my handle() > function or the GL scene was never drawn. My first question is, is > this the correct way to override the handle() function? (I've not > been able to find example code where the handle() function is > overridden) > > Having done this I now get a segmentation fault when I close the > application. If I comment out the call to show() from my handle() > function I don't get the segmentation fault, but then the GL scene > never gets drawn. Can anyone help me prevent the segmentation fault?
It should not be necessary to call show() from within your handle() method - indeed it might even be Bad Thing. You do, however, have to be sure to call the base class handle method from within your derived handle method, or various bits of event propagation and so forth will fail. I'd guess that's what you need to so to get things up 'n running. I think Greg has examples on his fltk notes page: http:// www.seriss.com/people/erco/fltk/#GLCursor might be a good one to start with. -- Ian _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

