|
|
On 8/4/21 2:02 PM Dave Jordan wrote:
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.
Note: I can't tell if your assumption is correct, but if it is
something like the code above should help.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/d5a5b77f-3d72-a769-c490-17d7bf1491c7%40online.de.
[ Direct Link to Message ] | |
|
| |