Scrolling to end of text window.



Hi,
 I am trying to set up a "terminal-emulator" style text window, where text is appended to the end, and the user can scroll back to view prior output, and may advance to the end of the text by pressing the "end" button.

To do this, I am setting up a text buffer within a scrolled window, and creating a mark at the end of the buffer. When the "end" key is detected, I call gtk_text_view_scroll_to_mark.

But this works only if the user has clicked anywhere on the existing text in the window, creating a vertical bar cursor. If the user has not yet done this, when the function gtk_text_view_scroll_to_mark is called, the following critical assertion error is emitted.
gtkmarshalers.c: line 102 (_gtk_marshal_BOOLEAN_ENUM): assertion `return_value != NULL` failed.
It appears to be failing a parameter check in the function mentioned in the error. 


I have tried to simulate the user initially clicking the text with calls to
gtk_text_buffer_place_cursor
and
gtk_text_view_place_cursor_onscreen
but neither works.

-- 
Get your free email from www.linuxmail.org 


Powered by Outblaze



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