why it can't get text buffer?



Hi!
I had tried many times to get text buffer (the thing that I want to do is to receive text from the first pane widget and send it to the second pane widget and display that text on this second pane widget,which both pane widgets are on the same window)
    but it can't get text buffer!I don't know why.........
    I had created function like this,

    void send_recieve_text (GtkWidget *widget,GtkWidget *text)
   {
inbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)); /*Get text from input pane*/
      gtk_text_buffer_get_start_iter  (inbuffer,&iterstart);
      gtk_text_buffer_get_end_iter    (inbuffer,&iterend);

data_from_input = gtk_text_buffer_get_text (inbuffer,&iterstart,&iterend,TRUE);
     incount = gtk_text_buffer_get_char_count  (inbuffer);

outbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));/*To show on output pane*/
     gtk_text_buffer_get_iter_at_offset (outbuffer, &iterout, -1);

gtk_text_buffer_insert(outbuffer,&iterout,data_from_input ,incount); /*Show Output*/

   }

I had tried,and it seems that this line won't work ......
data_from_input = gtk_text_buffer_get_text (inbuffer,&iterstart,&iterend,TRUE); that I really don't understand about the reason why it can't change buffer to text?,

could anybody give me some advice,please?or some example about how to send buffer and to be show text?

(In the GTK2.0 tutorial only has example about to show some constant like this......
gtk_text_buffer_set_text (outbuffer,"Hello",-1);
but it can't work if I change "Hello" to any of variable.

Thanks lot for all of your advices,
Regards,

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus




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