Author: bugman Date: Wed Jun 13 21:11:44 2012 New Revision: 16903 URL: http://svn.gna.org/viewcvs/relax?rev=16903&view=rev Log: Bug fix for the model-free analysis tab about window - sometimes a grey region would appear at the bottom. This is a problem in at least GTK+ as scrolling is in increments of 20! Modified: trunk/gui/analyses/auto_model_free.py Modified: trunk/gui/analyses/auto_model_free.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/auto_model_free.py?rev=16903&r1=16902&r2=16903&view=diff ============================================================================== --- trunk/gui/analyses/auto_model_free.py (original) +++ trunk/gui/analyses/auto_model_free.py Wed Jun 13 21:11:44 2012 @@ -25,6 +25,7 @@ """Module for the automatic model-free protocol frame.""" # Python module imports. +from math import ceil from os import sep import sys import wx @@ -125,9 +126,18 @@ if i < len(dauvergne_protocol.doc) and dauvergne_protocol.doc[i+1][0] == PARAGRAPH: self.offset(10) + # Add space to the bottom. + self.offset(self.border) + + # Round the offset up to the nearest factor of 20 (needed for scrolling for at least GTK+). + y = self.offset() + self.offset(-y) + y = int(ceil(y/20.) * 20) + self.offset(y) + # Resize the window. dim_x = self.dim_x - virt_y = self.offset() + self.border + virt_y = self.offset() self.SetSize((dim_x, self.dim_y)) self.window.SetVirtualSize((dim_x, virt_y)) self.window.EnableScrolling(x_scrolling=False, y_scrolling=True)