Fixed GdkImlib problem with XPM data for some versions of python 2.X

svn: r566
This commit is contained in:
Don Allingham 2001-11-13 18:28:59 +00:00
parent 857c294647
commit 0ee5d8eaa3
3 changed files with 5 additions and 12 deletions

View File

@ -619,7 +619,7 @@ class EditPerson:
"""loads, scales, and displays the person's main photo"""
self.load_obj = photo
if photo == None:
self.get_widget("personPix").load_imlib(const.empty_image)
self.get_widget("personPix").hide()
else:
try:
i = GdkImlib.Image(photo)
@ -628,8 +628,9 @@ class EditPerson:
y = int(scale*(i.rgb_height))
i = i.clone_scaled_image(x,y)
self.get_widget("personPix").load_imlib(i)
self.get_widget("personPix").show()
except:
self.get_widget("personPix").load_imlib(const.empty_image)
self.get_widget("personPix").hide()
def update_lists(self):
"""Updates the person's lists if anything has changed"""

View File

@ -181,13 +181,14 @@ class MediaView:
if index > 0:
self.media_list.select_row(current_row,0)
self.media_list.moveto(current_row)
self.preview.show()
else:
self.mid.set_text("")
self.mtype.set_text("")
self.mdesc.set_text("")
self.mpath.set_text("")
self.mdetails.set_text("")
self.preview.load_imlib(const.empty_image)
self.preview.hide()
if current_row < self.media_list.rows:
self.media_list.moveto(current_row)

View File

@ -518,12 +518,3 @@ familyAttributes = initialize_family_attribute_list()
familyRelations = initialize_family_relation_list()
places = []
surnames = []
xpm_data = [
'/* XPM */',
'static char * foo_xpm[] = {',
'"1 1 1 1"',
'" c None"',
'" "};']
empty_image = create_image_from_xpm(xpm_data)