I am working on a preferences dialog that makes use of a GtkNotebook for organizing categories of preferences.
It would make sense for usability if I could allow users to switch between tabs with the common Ctrl+Tab sequence, and I have actually gotten this to work.
after switching the active tab, the Tab key then also selects the next widget within the dialog. How can I prevent this from happening? How can I disable the Tab to next widget.
-Carl
Connection:
| Code: : |
$this->notebook->connect('key_press_event', array($this, nextTab));
|
Callback:
| Code: : |
function nextTab($widget, $event)
{
if ($event->state == Gdk::CONTROL_MASK && $event->keyval == Gdk::KEY_Tab) {
if ($widget->get_current_page() == $widget->get_n_pages()-1) {
$widget->set_current_page(0);
} else {
$widget->next_page();
}
}
}
|