Larry Navarro wrote:
> When I click the Button Widget, my derived class handles it!?
> How do I prevent this from happening?
When you override handle(), you take over that widget's
events completely. In most cases you want to pass events
down to the base class's handle(), but pick and choose
handling of vertain events.
Not sure if this is the problem, but be careful of how
you handle the return value.. you have it always returning 1
for all events, and you're not calling the base class's handle(),
so you're eclipsing all events from it.
Just about all handle() examples you'll ever see either
look more like this:
int handle(int e) {
switch(e) {
// do stuff here..
}
return(XXX::handle(e)); // <-- call base class *last*, return its value
}
..or..
int handle(int e) {
int ret = XXX::handle(e); // <-- call base class *first*, keep
its return value for later
switch(e) {
// do stuff here, change ret if needed
}
return(ret); // return base class's return value
(with your optional augmentations)
}
..where XXX is the base class (in your case, XXX=Widget).
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk