I am creating a terminal application in gtk+ using vte. When I create a tab and add it to the notebook using the ctrl+t key combination it adds the tab with a new terminal in the tab as expected. However, the keypress signal also makes it through to the terminal and shows up as a "^T" before the command prompt along with a system beep. How do I use the keypress signal at the window level, so I can add the tab, but then block this specific keypress signal at the terminal level? Here is a block of code which shows how it is all assembled:
window_main = gtk_window_new (GTK_WINDOW_TOPLEVEL);
vte = vte_terminal_new();
terminal = VTE_TERMINAL (vte);
notebook = gtk_notebook_new ();
vbox = gtk_vbox_new(FALSE,0);
gtk_container_add (GTK_CONTAINER (window_main), vbox);
gtk_box_pack_start (GTK_BOX (vbox), notebook, TRUE, TRUE, 0);
scrollwin[0] = gtk_scrolled_window_new (NULL, terminal->adjustment);
gtk_container_add(GTK_CONTAINER(scrollwin[0]),vte);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollwin[0]), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
label = gtk_label_new ("term1");
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), scrollwin[0], label);
Thanks.
g_signal_handler_block
but that seems like overkill. Which signal handler would I return true from? At which level to only block the signal from reaching the terminal, not the window? An example would be really helpful. I've been looking, but I can't find one. Thanks. – nomadicME