def __init__(self, *args, **kwargs): self._app = Scripting.root_node self.__gui_images = [] self.__topwin = kwargs.pop('topwin') super().__init__(*args, **kwargs) imageMLbl = ImageTk.PhotoImage( file=Scripting.root_node.get_gui_image_path('Pattern_M_Label.png') ) self.__gui_images.append(imageMLbl) self.__M = LabeledEntry(self) self.__M.label.config(text='M', image=imageMLbl, compound='left') self.__M.entry_width = 6 self.__M.entry_text = 10 self.__M.entry.bind( '<Return>', lambda dumb: self._on_solve_button_click()) self.__M.checker_function = self._app.gui.value_checker.check_int self.__M.pack() self._app.gui.balloon.bind_widget( self.__M, balloonmsg='The number of the array elements.') image_solve = ImageTk.PhotoImage( file=Scripting.root_node.get_gui_image_path('Pattern_Solve_Button.png')) self.__gui_images.append(image_solve) self.__btnSolve = Button( self, text='Solve', image=image_solve, compound='left', command=self._on_solve_button_click) self.__btnSolve.pack(side='top', fill='x') self._app.gui.balloon.bind_widget( self.__btnSolve, balloonmsg='Launch the solver to synthesize the correlation matrix.') image_display = ImageTk.PhotoImage( file=Scripting.root_node.get_gui_image_path('Pattern_Display_Button.png')) self.__gui_images.append(image_display) self.__bDisplay = IntVar(0) chk_display = Checkbutton( self, text="Display", image=image_display, compound='left', variable=self.__bDisplay) chk_display.pack(side='top') self._app.gui.balloon.bind_widget( chk_display, balloonmsg='Display solver output.') chk_display_width = chk_display.winfo_width() self.__btnSolve['width'] = chk_display_width self.name = 'Optimize'
def __init__(self, *args, **kwargs): self._app = Scripting.root_node self.__gui_images = [] self.__topwin = kwargs.pop('topwin') super().__init__(*args, **kwargs) imageMLbl = ImageTk.PhotoImage( file=Scripting.root_node.get_gui_image_path( 'arrayelemnum20x20.png')) self.__gui_images.append(imageMLbl) self.__M = LabeledEntry(self) self.__M.label.config(text='M', image=imageMLbl, compound='left') self.__M.entry_width = 6 self.__M.entry_text = 10 self.__M.entry.bind('<Return>', lambda dumb: self._on_solve_button_click()) self.__M.checker_function = self._app.gui.value_checker.check_int self.__M.pack() self._app.gui.balloon.bind_widget( self.__M, balloonmsg='The number of the array elements.') image_solve = ImageTk.PhotoImage( file=Scripting.root_node.get_gui_image_path('run20x20.png')) self.__gui_images.append(image_solve) self.__btnSolve = Button(self, text='Solve', image=image_solve, compound='left', command=self._on_solve_button_click) self.__btnSolve.pack(side='top', fill='x') self._app.gui.balloon.bind_widget( self.__btnSolve, balloonmsg='Launch the solver to synthesize the correlation matrix.' ) image_display = ImageTk.PhotoImage( file=Scripting.root_node.get_gui_image_path( 'Pattern_Display_Button.png')) self.__gui_images.append(image_display) self.__bDisplay = IntVar(0) chk_display = Checkbutton(self, text="Verbose", image=image_display, compound='left', variable=self.__bDisplay) chk_display.pack(side='top') self._app.gui.balloon.bind_widget(chk_display, balloonmsg='Display solver output.') chk_display_width = chk_display.winfo_width() self.__btnSolve['width'] = chk_display_width self.name = 'Optimize'