def __init__(self, parent, root, template_file=None): uiutils.BaseFrame.__init__(self, parent, root, 4, 5) tk.Button(self, text='Load First Image', command=self.load_first).grid(row=0, column=0, sticky=tk.W + tk.E) tk.Button(self, text='Load Second Image', command=self.load_second).grid(row=0, column=1, sticky=tk.W + tk.E) tk.Button(self, text='Undo', command=self.undo).grid(row=0, column=2, sticky=tk.W + tk.E) tk.Button(self, text='Redo', command=self.redo).grid(row=0, column=3, sticky=tk.W + tk.E) tk.Button(self, text='View Hybrid', command=self.process_compute).grid(row=0, column=4, sticky=tk.W + tk.E) tk.Button(self, text='Save Correspondances', command=self.save_corr).grid(row=1, column=0, sticky=tk.W + tk.E) tk.Button(self, text='Load Correspondances', command=self.load_corr).grid(row=1, column=1, sticky=tk.W + tk.E) self.left_image_widget = uiutils.ClickableImageWidget(self) self.left_image_widget.grid(row=2, column=0, columnspan=2, sticky=tk.NSEW) self.right_image_widget = uiutils.ClickableImageWidget(self) self.right_image_widget.grid(row=2, column=3, columnspan=2, sticky=tk.NSEW) self.left_image_name = None self.right_image_name = None self.left_redo_queue = [] self.right_redo_queue = [] self.grid_rowconfigure(2, weight=1) self.image_receiver = None self.template_file = template_file
def __init__(self, parent, root, template_file=None): uiutils.BaseFrame.__init__(self, parent, root, 4, 5) tk.Button(self, text='Load First Image', command=self.load_first).grid(row=0, column=0, sticky=tk.W + tk.E) tk.Button(self, text='Load Second Image', command=self.load_second).grid(row=0, column=1, sticky=tk.W + tk.E) tk.Button(self, text='Undo', command=self.undo).grid(row=0, column=2, sticky=tk.W + tk.E) tk.Button(self, text='Redo', command=self.redo).grid(row=0, column=3, sticky=tk.W + tk.E) tk.Button(self, text='View Hybrid', command=self.process_compute).grid(row=0, column=4, sticky=tk.W + tk.E) tk.Button(self, text='Save Correspondances', command=self.save_corr).grid(row=1, column=0, sticky=tk.W + tk.E) tk.Button(self, text='Load Correspondances', command=self.load_corr).grid(row=1, column=1, sticky=tk.W + tk.E) self.left_image_widget = uiutils.ClickableImageWidget(self) self.left_image_widget.grid(row=2, column=0, columnspan=2, sticky=tk.NSEW) self.right_image_widget = uiutils.ClickableImageWidget(self) self.right_image_widget.grid(row=2, column=3, columnspan=2, sticky=tk.NSEW) self.left_image_name = None self.right_image_name = None self.left_redo_queue = [] self.right_redo_queue = [] self.grid_rowconfigure(2, weight=1) self.image_receiver = None if template_file is not None: def load_template_and_compute(): self.load_corr(template_file) self.process_compute() def load_template_local(): #self.wait_visibility() self.after(0, load_template_and_compute) threading.Thread(target=load_template_local).start()