Author: bugman Date: Wed Aug 3 10:41:08 2011 New Revision: 14081 URL: http://svn.gna.org/viewcvs/relax?rev=14081&view=rev Log: Scrolling now follows the end, if at the end, in the relax controller log window. Modified: branches/gui_testing/gui/controller.py Modified: branches/gui_testing/gui/controller.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/controller.py?rev=14081&r1=14080&r2=14081&view=diff ============================================================================== --- branches/gui_testing/gui/controller.py (original) +++ branches/gui_testing/gui/controller.py Wed Aug 3 10:41:08 2011 @@ -554,6 +554,11 @@ # First freeze the element. self.Freeze() + # At the end? + at_end = False + if self.GetScrollPos(wx.VERTICAL) == self.GetScrollRange(wx.VERTICAL) - self.LinesOnScreen(): + at_end = True + # Add the text. sys.__stdout__.write(string) self.AppendText(string) @@ -561,6 +566,10 @@ # Limit the scroll back. self.limit_scrollback() + # Stay at the end. + if at_end: + self.ScrollToLine(self.GetLineCount()) + # Finally thaw. self.Thaw()