GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Nov 27, 2014 9:53 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Adding Text moves scrollbar to top
PostPosted: Sun Jan 19, 2014 8:55 pm 
Offline

Joined: Sun Jan 19, 2014 3:20 pm
Posts: 1
I am using Gtk+3 in C.

I have a GtkTextView that is inside of a GtkScrolledWindow. The GtkTextView gets updated from a GtkTextBuffer every 5 seconds, it reads from a file that is getting updated. Every time the text is updated, the scroll position automatically scrolls all the way up. What is the best way to tell the GtkScrolledWindow not to change the scrolling position when the text is re loaded?

If you need a code example let me know, I just thought this was a pretty general question that might be to answered without a snippet of code.


Top
 Profile  
 
 Post subject: Re: Adding Text moves scrollbar to top
PostPosted: Sun Jan 19, 2014 9:59 pm 
Offline
Familiar Face

Joined: Tue Jan 01, 2013 4:57 pm
Posts: 6
Simplest would be to preserve the position of the scrollbar before the update (yourwidget.vadjustment.value) and then set it again afterward.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group