2012-01-15 17:10, Kjell Ahlstedt skrev:
I
think this is work trying:
Shall be "I think this is worth trying:"
bool
Toolbox::on_key_press_event(GdkEventKey* event)
{
Gtk::Widget* focused_widget = get_focus();
if (focused_widget_shall_override_accelerators(focused_widget))
return focused_widget->event((GdkEvent*)event);
return Gtk::Window::on_key_press_event(event);
}
Or like so, depending on what you want to do if the focused widget
does not handle the event:
bool
Toolbox::on_key_press_event(GdkEventKey* event)
{
Gtk::Widget* focused_widget = get_focus();
if (focused_widget_shall_override_accelerators(focused_widget))
{
if (focused_widget->event((GdkEvent*)event))
return true;
}
return Gtk::Window::on_key_press_event(event);
}
|