From cc58908d34f9429caa9fdeddbf4aa03ae86f8648 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Thu, 30 Aug 2012 20:34:42 +0000 Subject: [PATCH] GTK3: adjustment value via get and set svn: r20294 --- src/plugins/view/relview.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/plugins/view/relview.py b/src/plugins/view/relview.py index 7198b092e..7bb3aa988 100644 --- a/src/plugins/view/relview.py +++ b/src/plugins/view/relview.py @@ -33,6 +33,14 @@ from gen.ggettext import sgettext as _ from gen.ggettext import ngettext import cgi +#------------------------------------------------------------------------- +# +# Set up logging +# +#------------------------------------------------------------------------- +import logging +_LOG = logging.getLogger("plugin.relview") + #------------------------------------------------------------------------- # # GTK/Gnome modules @@ -474,6 +482,9 @@ class RelationshipView(NavigationView): try: return self._change_person(obj) except AttributeError, msg: + import traceback + exc = traceback.format_exc() + _LOG.error(str(msg) +"\n" + exc) from gui.dialog import RunDatabaseRepair RunDatabaseRepair(str(msg)) self.redrawing = False @@ -482,14 +493,14 @@ class RelationshipView(NavigationView): def _change_person(self, obj): if obj == self.old_handle: #same object, keep present scroll position - old_vadjust = self.scroll.get_vadjustment().value + old_vadjust = self.scroll.get_vadjustment().get_value() self.old_handle = obj else: #different object, scroll to top old_vadjust = self.scroll.get_vadjustment().get_lower() self.old_handle = obj - self.scroll.get_vadjustment().value = \ - self.scroll.get_vadjustment().get_lower() + self.scroll.get_vadjustment().set_value( + self.scroll.get_vadjustment().get_lower()) if self.redrawing: return False self.redrawing = True @@ -571,7 +582,7 @@ class RelationshipView(NavigationView): self.vbox.pack_start(self.child, False, True, 0) #reset scroll position as it was before - self.scroll.get_vadjustment().value = old_vadjust + self.scroll.get_vadjustment().set_value(old_vadjust) self.redrawing = False self.uistate.modify_statusbar(self.dbstate)