Clear displays after a new database is created.

svn: r1305
This commit is contained in:
Don Allingham 2003-02-14 02:20:59 +00:00
parent a942d4c594
commit 8637d33501
3 changed files with 18 additions and 6 deletions

View File

@ -282,11 +282,18 @@ class FamilyView:
person = family.getMother()
self.parent.change_active_person(person)
self.load_family(family)
def clear(self):
self.spouse_model.clear()
self.child_model.clear()
self.sp_parents_model.clear()
self.ap_parents_model.clear()
self.ap_data.set_text('')
def load_family(self,family=None):
self.person = self.parent.active_person
if not self.person:
self.clear()
return
n = "%s\n\tb. %s\n\td. %s " % (GrampsCfg.nameof(self.person),

View File

@ -144,15 +144,18 @@ class PedigreeView:
self.load_person = lp
self.presel_descendants = []
def load_canvas(self, person):
"""Redraws the pedigree view window, using the passed person
as the root person of the tree."""
def clear(self):
for i in self.canvas_items:
i.destroy()
for i in self.boxes:
i.cleanup()
def load_canvas(self, person):
"""Redraws the pedigree view window, using the passed person
as the root person of the tree."""
self.clear()
if person is not self.active_person:
del self.presel_descendants[:]
self.active_person = person

View File

@ -601,7 +601,9 @@ class Gramps:
self.change_active_person(None)
for model in self.pl_page:
model.clear()
self.family_view.clear()
self.family_view.load_family()
self.pedigree_view.clear()
self.source_view.load_sources()
self.place_view.load_places()
self.media_view.load_media()