Re: Help about VteTerminal



On Mon, 2004-12-06 at 17:52 +0800, Shixin Zeng wrote:

 

Sorry, if I didn't express myself well in the last e-mail.
Now let me elaborate on it.

my code segment is like:

typedef struct{
  glong row;
  glong col;
}cursor_position;

void
cursor_moved(VteTerminal *vte, gpointer original_position)
{
  cursor_position *orig_pos = (cursor_position*)original_position;
  /* get the cursor position */
  glong col=0, row=0;
  vte_terminal_get_cursor_position(vte, &col, &row);
  gchar *content = vte_terminal_get_text_range(vte,
                           orig_pos->row,
                           orig_pos->col,
                           row,
                           col,
                           is_selected,
                           NULL,
                           NULL);
 printf("Received from the Child %s\n", content); */* here,
                                                                        
* @content contains both the output from the child
                                                                        
* AND the input from the user.
                                                                        
* What I want is just the output from the child.
                                                                         */*
 g_free(content);
}

cursor_position *init_pos = g_new0(cursor_position, 1);
g_signal_connect(G_OBJECT(terminal), "cursor-moved",  
G_CALLBACK(cursor_moved), init_pos);
g_free(init_pos);


No, I understood.  If you read thru the docs at the link I previously
sent, you should have seen that there is no way to tell vte to send only
the child's output.  So, the only way is to connect to the commit signal
to get the input text, then:

desired_text = total_text - input_text


have fun implementing it.

-- 
Brian <dol-sen telus net>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]