def reset_photo(self,default=False):
print "changing photo"
cur_dir=os.path.dirname(os.path.abspath((sys.argv[0])))
if default:
path=cur_dir+"/Resources/img/browse.jpg"
else:
path=cur_dir+"/Resources/profile_pic/"+str(self.current_admission_no)+".jpg"
if not os.path.isfile(path):
path=cur_dir+"/Resources/img/browse.jpg"
if self.path!=path:# changes only if it has changed
self.bitmap_photo = wx.BitmapButton(self.panel_1, wx.ID_ANY,wx.Bitmap(path, wx.BITMAP_TYPE_ANY))
#self.bitmap_photo.SetBitmapSelected( wx.Bitmap(path, wx.BITMAP_TYPE_ANY))
selected_index=0
print self.combo_box_adno.GetSelection()
if self.combo_box_adno.GetSelection()>0:
selected_index=self.combo_box_adno.GetItems().index(self.current_admission_no)
self.__set_properties()
self.__do_layout()
self.combo_box_adno.SetSelection(selected_index)
self.bitmap_photo.Enable(True)
self.path=path
评论列表
文章目录