Re: gtk_text_buffer_place_cursor



Philip Bunce <pjb carmel com> writes:

I have an application (using gtk2.0 on win32) that uses a TextView window. However, I want to force all 
text to be added
to the end of the buffer (like a terminal session). By using get_end_iter and buffer_insert I was able to 
make sure that
any new text goes at the end of the buffer, but the user can leave the cursor somewhere else and it looks 
weird. So I want
to move the cursor to the end of the buffer also. So I used 

gtk_text_buffer_get_end_iter(view->buffer, &iter);
gtk_text_buffer_place_cursor (view->buffer, &iter);
gtk_text_buffer_insert_at_cursor (view->buffer, msg, len);

But I get lots of error messages from Pango.

<unknown> (pid:2248): ** CRITICAL **: file pango-layout.c: line 1707 (pango_layout_get_cursor_pos): 
assertion `index >= 0 && index <= layout->length' failed

The message seems to suggest that the end iter is past the end of the buffer, but how can that be?

Oh yes. The code does actually work, despite the huge volume of error messages.


Some sort of bug - be sure it's in the tracker at
http://bugzilla.gnome.org

May be win32-only.

Havoc



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