On 06/30/12 12:05, Nick wrote:
> int Fl_Graphic::handle (int i)
> ///\Event handler
> {
> switch (i)
> {
> case FL_PUSH:
> pushes++;
> draw_point ();
> return (i);
> }
> return (0);
> }
This event handler looks wrong, and might be the problem.
It's eclipsing all events from the underlying widget.
Fix that problem by changing it to read:
int Fl_Graphic::handle (int e)
{
int ret = Fl_Box::handle(e);
switch (e)
{
case FL_PUSH:
pushes++;
draw_point ();
return(1);
}
return(ret);
}
I don't know if that will fix your problem, but either way
it needs to be fixed.
You have to pass events down to the class you're deriving from
so it can handle the events you don't. There are many events,
including stuff to do with window reveals and focus that have
to be passed down for things to work correctly.
Note too, the return value from handle() is supposed to be
0 or 1, not the event itself.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk