I'm using a hold browser and i
think its scrollbar is stealing a shortcut to a menu item i have
assigned to ctrl-end. How can I prevent this? subclass the
scrollbar? Or is it legit to have a handle and a callback for
the same widget i.e. the browser?
Yes, you can subclass and have a callback attached to the
widget. If you want to "filter" shortcuts (that can't be changed in
the base class you would subclass and define your handle() where
you'd test for the event in question and return 0 *before*
you call the handle() method of the base class, for instance
myclass::handle(int e) {
if (e == FL_SHORTCUT && Fl::key() == FL_END)
return 0;
return baseclass::handle();
}
In this case the FL_END keypress would be propagated to any other
widget that "wants" it.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.