def config(self): """Configures the application at start-up. Controllers are responsible for initializing the application and creating all of the other objects. This method does just that. It loads the currently selected image file, creates an ImageArray for that file, creates an ImageProcessor to handle the array, and connects the ImageProcessor to the two ImagePanel objects.""" # Load the image into an array image_array = ImageArray.LoadFile(self.source) # Create the processor for the given ImageArray self.image_processor = ImageProcessor(image_array) # Set up the display panels self.original_image_panel = ImagePanel(self.original_image, self.image_processor.original) self.current_image_panel = ImagePanel(self.current_image, self.image_processor.current)
def _get_open_page(self): """ Returns the 'open' form of the notebook page. """ result = ImagePanel(theme=self.open_theme, text=self.name, controller=self, default_alignment='center', state='open') result.create_control(self.notebook.control) return result