def choose_file(): chooser = ui.ASEFileChooser(self.win.win) filename = chooser.go() if filename is None: # No file selected return self.entry.value = filename # Load the file immediately, so we can warn now in case of error self.readfile(filename, format=chooser.format)
def open(self, button=None, filename=None): chooser = ui.ASEFileChooser(self.window.win) filename = filename or chooser.go() format = chooser.format if filename: try: self.images.read([filename], slice(None), format) except Exception as err: ui.show_io_error(filename, err) return # Hmm. Is self.images in a consistent state? self.set_frame(len(self.images) - 1, focus=True)