[Glade-users] Problem with gtk_text_view and gtk_text_buffer...

   I got a problem while using Gtk Text View, I 'm trying to set the
text view's content according to a text buffer. And ONLY show the
content of the text buffer, thus I choose the function
"gtk_text_view_set_buffer." But somehow, while executing, the console
keep showing that :

Gtk-CRITICAL **: gtk_text_buffer_set_text: assertion
`GTK_IS_TEXT_BUFFER (buffer)' failed

and set text to text view failed, too. OOPS!!
Following is the code where shxt happened:

void refresh( char *memU, char *regU, GtkTextView *memView,
GtkTextView *regView )
  GtkTextBuffer *memBuffer=3DNULL;
  GtkTextBuffer *regBuffer=3DNULL;
  gtk_text_buffer_set_text( memBuffer, memU, -1 );
  gtk_text_buffer_set_text( regBuffer, regU, -1 );
  gtk_text_view_set_buffer( GTK_TEXT_VIEW(memView), memBuffer );
  gtk_text_view_set_buffer( GTK_TEXT_VIEW(regView), regBuffer );

I've checked the GTK+ Reference Manual for the prototype of
gtk_text_view_set_buffer for many times, But I just can't figure out
what's wrong. May anyone give a hand? Thanks a lot!!

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