def button_process(root): #create message box messagebox.askokcancel('Python Tkinter', 'Are you sure to create a window?') messagebox.askquestion('Python Tkinter', "Are you sure to create a window?") messagebox.askyesno('Python Tkinter', 'Are you sure to create a window?') messagebox.showerror('Python Tkinter', 'Unknown Error') messagebox.showinfo('Python Tkinter', 'hello world') messagebox.showwarning('Python Tkinter', 'Leave now') root1 = Toplevel(root)
def confset(): res = messagebox.askyesno( "Program Restart", "Değişikliklerin Kaydedilmesi için programın tekrar başlatılması gerekiyor \n Onaylıyorsun Değil mi ?" ) if res: xm1en = m1en.get() xm2en = m2en.get() xm3en = m3en.get() xm4en = m4en.get() xm5en = m5en.get() xm6en = m6en.get() xm1in1 = m1in1.get() xm2in1 = m2in1.get() xm3in1 = m3in1.get() xm4in1 = m4in1.get() xm5in1 = m5in1.get() xm6in1 = m6in1.get() xm1in2 = m1in2.get() xm2in2 = m2in2.get() xm3in2 = m3in2.get() xm4in2 = m4in2.get() xm5in2 = m5in2.get() xm6in2 = m6in2.get() xs1 = s1.get() xs2 = s2.get() config.set('MOTORS', 'm1en', str(xm1en)) config.set('MOTORS', 'm2en', str(xm2en)) config.set('MOTORS', 'm3en', str(xm3en)) config.set('MOTORS', 'm4en', str(xm4en)) config.set('MOTORS', 'm5en', str(xm5en)) config.set('MOTORS', 'm6en', str(xm6en)) config.set('MOTORS', 'm1in1', str(xm1in1)) config.set('MOTORS', 'm2in1', str(xm2in1)) config.set('MOTORS', 'm3in1', str(xm3in1)) config.set('MOTORS', 'm4in1', str(xm4in1)) config.set('MOTORS', 'm5in1', str(xm5in1)) config.set('MOTORS', 'm6in1', str(xm6in1)) config.set('MOTORS', 'm1in2', str(xm1in2)) config.set('MOTORS', 'm2in2', str(xm2in2)) config.set('MOTORS', 'm3in2', str(xm3in2)) config.set('MOTORS', 'm4in2', str(xm4in2)) config.set('MOTORS', 'm5in2', str(xm5in2)) config.set('MOTORS', 'm6in2', str(xm6in2)) config.set("MOTORS", "s1", str(xs1)) config.set("MOTORS", "s2", str(xs2)) with open('config.ini', 'w') as configfile: config.write(configfile) restart_program() else: messagebox.showinfo("İptal", "Değişiklikler Kaydedilmedi !") confi.destroy()
def butterworth_sharpen(): global image, extension, image_count, log_path, max_image_count, lab_5_data, lab_6_data, lab_7_data, error_flag_1, error_flag_2, error_flag_3, butter_width, butter_order, butter_a, popup_true if (image.max() != 0): #ask the user if he wishes to use the default parameter values answer = messagebox.askyesno( "Settings", "Do you want to use default settings?\n" + "width=3, order=2, a=0.5") if (answer == True): image = fun.butterworth_highpass_filter(image, 3, 2, 0.5) #general steps fig.clf() fig.add_subplot(111) im = plt.imshow(image, vmin=0, vmax=255) plt.set_cmap('gray') canvas.draw() max_image_count = image_count + 1 image_count = image_count + 1 var.set(image_count) #store the image in log_folder current_file = log_path + "\\" + str(image_count) + "." + str( extension) cv2.imwrite(current_file, image) remove_files() else: ###initialize the variables before calling popup lab_5_data.set("") lab_6_data.set("") lab_7_data.set("") error_flag_1 = 0 error_flag_2 = 0 error_flag_3 = 0 butter_width = "" butter_order = "" butter_a = "" popup_true = 0 ### popupmsg() else: messagebox.showerror("Error", "Please load an image first.")
def decryptor(self): key = self.Entry1.get() if len(key) == 32: ask = messagebox.askyesno( 'ATTENTION : Are You Sure?', 'Is this Key Correct?\n\nDecryption From Invalid Key Just\nGoing to Destroy your Data!!' ) if ask == True: reverse = reverse_attack.Reverse( key) #Making object of Reverse Class reverse.start() #Starts Decryption Process messagebox.showinfo( 'Decryption Process Completed : )', 'Decryption/Recovery of File is Completed Successfully!') else: messagebox.showerror( 'Invalid Key', 'You Entered Invalid Decryption Key.\nDecrytion from Invalid Key Will,\nJust Destroy Whole Data : (' )
def quit(self): # redef me to change if askyesno(self.__app, 'Verify Quit Window?'): # or call destroy self.destroy() # quit this window
def quit(self): if self.okayToQuit(): # threads running? if askyesno(self.__app, 'Verify Quit Program?'): self.destroy() # quit whole app else: showinfo(self.__app, 'Quit not allowed') # or in okayToQuit?
def exit(cls, root): answer = messagebox.askyesno("Exit", "Are you sure") if answer: root.quit()
def gaussian_blur(): global image, extension, image_count, log_path, max_image_count if (image.max() != 0): #ask the user if he wishes to use the default parameter values answer = messagebox.askyesno( "Settings", "Do you want to use default settings?\n" + "Kernel size = 3") if (answer == True): image = fun.gaussian_blur_im(image, 3) #general steps fig.clf() fig.add_subplot(111) im = plt.imshow(image, vmin=0, vmax=255) plt.set_cmap('gray') canvas.draw() max_image_count = image_count + 1 image_count = image_count + 1 var.set(image_count) #store the image in log_folder current_file = log_path + "\\" + str(image_count) + "." + str( extension) cv2.imwrite(current_file, image) remove_files() else: flag = 1 while (flag == 1): #take user input till he meets the conditions #ask user for a kernel size for the gaussian lowpass filter kernel_size = simpledialog.askinteger( "Input", "Enter Kernel size (Odd values and min value 3):", parent=root, minvalue=3, maxvalue=min(image.shape[0], image.shape[1])) if (kernel_size is None): #cancel was clicked so go out of while loop flag = 0 if (kernel_size is not None): if (kernel_size % 2 == 0): messagebox.showinfo( "Invalid kernel size", "Please enter an odd kernel size.") else: flag = 0 image = fun.gaussian_blur_im(image, kernel_size) #general steps fig.clf() fig.add_subplot(111) im = plt.imshow(image, vmin=0, vmax=255) plt.set_cmap('gray') canvas.draw() max_image_count = image_count + 1 image_count = image_count + 1 var.set(image_count) #store the image in log_folder current_file = log_path + "\\" + str( image_count) + "." + str(extension) cv2.imwrite(current_file, image) remove_files() else: messagebox.showerror("Error", "Please load an image first.")