Re: Textview not scrolling in Client



Just came across this at 
http://live.gnome.org/GTK2-Perl/FrequentlyAskedQuestions#head-ca3eac3d2016b4893bea39bcf1c1b3565ce450ad

This should make sure that every time you add text to the widget,it is scrolled to the bottom.

# create a mark at the end of the buffer, with right gravity,
# so that when you insert text, the mark always stays on
# the right (at the end).
my $end_mark = $buffer->create_mark ('end', $buffer->get_end_iter, FALSE);
# every time we insert text, scroll to that mark.
$buffer->signal_connect (insert_text => sub {
        $textview->scroll_to_mark ($end_mark, 0.0, TRUE, 0.0, 1.0);
});


On Apr 14, 2008, at 18:41, Jamie Lahowetz wrote:
I have been struggling with this and I just cant seem to figure what
the problem is. I have this IRC client that wont scroll far enough
down to show the full text. Its rather hard to explain but I'll give
it a try:
when you get down to the bottom on the textview and you go to enter
a message such as:
John(10:00:00) I have to go to the story today and get some fruit.
And this message is the last one to be entered before the bottom of
the window therefore causing it to have to scroll down, the program
only shows the first line:
John(10:00:00) I have to go to the story
Forcing the user to scroll down to view the rest:
today and get some fruit.
You can see that this would be a problem when users are chatting,
having to always take your attention off of the session just to
scroll down and view the whole message. Currently the program uses
the code $chat_textview->scroll_to_mark where mark is defined as the
end iter of the buffer. I cant figure how to get this to work and
show the whole text without the user having to manually scroll down.
I am wondering if the word wrapping is causing it since this
behavior is true for a single unwrapped line. I would appreciate any
help on this since it seems like such a simple thing and I cant
figure it.

snip



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