student_profile.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:smartschool 作者: asifkodur 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号