From 2ac1f92cfe2a2b40df1b76a0c8c10c4d93113d07 Mon Sep 17 00:00:00 2001 From: mutantturkey Date: Mon, 26 Apr 2010 08:40:14 -0400 Subject: added prev/next page keybindings. cleaned up key_press_cb --- mt.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mt.c b/mt.c index 3e8d9ae..2bbe3e5 100644 --- a/mt.c +++ b/mt.c @@ -36,18 +36,16 @@ static void quit() { gboolean key_press_cb (GtkWidget *widget, GdkEventKey *event) { if (event->state == (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) { - if (gdk_keyval_to_lower(event->keyval) == GDK_t) { - tab_new(); - return TRUE; - } - if (gdk_keyval_to_lower(event->keyval) == GDK_x) { - tab_close(); - return TRUE; - } + if (gdk_keyval_to_lower(event->keyval) == GDK_t) { tab_new(); return TRUE; } + if (gdk_keyval_to_lower(event->keyval) == GDK_x) { tab_close(); return TRUE; } + if (gdk_keyval_to_lower(event->keyval) == GDK_Left) { gtk_notebook_prev_page(GTK_NOTEBOOK(mt.notebook)); return TRUE; } + if (gdk_keyval_to_lower(event->keyval) == GDK_Right) { gtk_notebook_next_page(GTK_NOTEBOOK(mt.notebook)); return TRUE; } } return FALSE; } + + static void tab_close() { @@ -85,6 +83,7 @@ static void tab_new() { g_signal_connect(t->vte, "child-exited", G_CALLBACK(tab_close), NULL); + /*barrowed from sakura*/ vte_terminal_set_scrollback_lines(VTE_TERMINAL(t->vte), scroll); // maybe i dont /REALLY NEED/ it. vte_terminal_match_add_gregex(VTE_TERMINAL(t->vte), httpregexp, 0); @@ -117,4 +116,6 @@ int main (int argc, char* argv[]) { config(); gtk_main(); + + return 0; }; -- cgit v1.2.3