def on_photo(self, event): # wxGlade: student_profie.<event_handler>
#wcd="Image Files(*.jpeg)|*.jpeg| JPG Files(*.jpg)|*.jpg| PNG Files(*.png)|*.png"
#return 0
print "on photo"
wcd="Image Files(*.jpeg,*.jpg,*.png)|*.jpeg;*.jpg;*.png"
dir = "/home"
open_dlg = wx.FileDialog(self, message='Select Photo', defaultDir=dir, defaultFile= '', wildcard=wcd, style=wx.OPEN)
if open_dlg.ShowModal() == wx.ID_OK:
path = open_dlg.GetPath()
result=self.VALID.validate_photo(path)
if result[0]:
self.bitmap_photo = wx.BitmapButton(self.panel_1, wx.ID_ANY,wx.Bitmap(path, wx.BITMAP_TYPE_ANY))
self.__set_properties()
self.__do_layout()
self.button_save.Enable(True)
self.prof_pic_path=path
open_dlg.Destroy
self.combo_box_adno.SetValue(str(self.current_admission_no))
else:
open_dlg.Destroy
msg=result[1]
icon=wx.ICON_ERROR
dlg = wx.MessageDialog(self, msg, 'Size Error',wx.OK | wx.ICON_ERROR)
dlg.ShowModal()
dlg.Destroy()
else:
open_dlg.Destroy()
event.Skip()
评论列表
文章目录