You cannot use -1 for the length, at least according to the documentation.
void gtk_text_buffer_insert_at_cursor (GtkTextBuffer <cid:[EMAIL PROTECTED]> *buffer, const gchar *text, gint len);
/buffer/ : a GtkTextBuffer <cid:[EMAIL PROTECTED]>
/text/ : some text in UTF-8 format
/len/ : length of text, in bytes
Plus, why are you adding a NULL terminator? And yes, it inserted four newlines. I put four to make it more obvious.
Felix Kater wrote:
Paolo Costabel:
I just tried this:
gtk_text_buffer_insert_at_cursor(buffer, "\n\n\n\n", 4);
and works fine here (gtk 2.4.10).
What call are you using?
Hm.
a)
First I used gtk_text_buffer_insert_at_cursor(buffer, "\n\0", -1); This didn't work (maybe the 0 termination is not right this way?)
b)
then I just tried gtk_text_buffer_insert_at_cursor(buffer, "\n", -1); which is of course wrong for what I realize now (missing 0 termination).
c)
Why are you using 4 times "\n"? Is it creating 4 new lines or just one?
Felix
_______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list