def __init__(self): """Creates a GUI for the image trainer.""" GUI.__init__(self) self.__previous_time = datetime.datetime.now() self.__user = os.environ.get("USERNAME") self.__computer = os.environ.get("COMPUTERNAME") self.__database_filepath = DEFAULT_DATABASE_FILEPATH self.__application = ImageRecognition(self.__database_filepath) self.__init_assets() self.__init_config() self.__init_menu() self.__init_widgets() self.__init_shortcuts() self.load_image(self.__application.get_next_image()) # Assign Row Weights for i in range(5): if i == 2: continue else: self.grid_rowconfigure(i, weight=1) # Assign Column Weights for i in range(10): self.grid_columnconfigure(i, weight=1) self.show()
def __init__(self): GUI.__init__(self) self.create_widgets() self.refresh_QR(imgfile='blank.png') self.protocol("WM_DELETE_WINDOW", self.on_closing)
def __init__(self, root): root.wm_title("eBay Table") sizex = 800 sizey = 600 posx = 100 posy = 100 root.wm_geometry("%dx%d+%d+%d" % (sizex, sizey, posx, posy)) GUI.__init__(self, root, "ebay")
def __init__(self, display): GUI.__init__(self, display) self.onClose = None self.onSetLight = None self.lumWarm = 0 self.lumCold = 0 self.margin = 16 self.cellsX = 3 self.cellsY = 4 self.gridW = (self.width - self.margin * (self.cellsX + 1)) / self.cellsX self.gridH = (self.height - self.margin * (self.cellsY + 1)) / self.cellsY nextX = self.margin nextY = self.margin buttonQuit = Button(self, nextX, nextX, self.gridW, self.gridH, name="quit", label="Quit") nextX += self.gridW + self.margin buttonReboot = Button(self, nextX, nextY, self.gridW, self.gridH, name="reboot", label="Reboot") #nextX += self.gridW + self.margin #button3 = Button(self, nextX, nextY, self.gridW, self.gridH) nextX += self.gridW + self.margin buttonClose = Button(self, nextX, nextY, self.gridW, self.gridH, name="close", label="CLOSE") sliderWidth = self.gridW * self.cellsX + (self.cellsX-1) * self.margin nextX = self.margin nextY += self.gridH + self.margin sliderWarm = Slider(self, nextX, nextY, sliderWidth, self.gridH, name="warm", label="WARM") nextY += self.gridH + self.margin sliderCold = Slider(self, nextX, nextY, sliderWidth, self.gridH, name="cold", label="COLD") sliderWarm.onChange = self.changeLight sliderCold.onChange = self.changeLight buttonQuit.onClick = self.clickButton buttonReboot.onClick = self.clickButton #button3.onClick = self.clickButton buttonClose.onClick = self.clickButton self.addWidget(buttonQuit) self.addWidget(buttonReboot) #self.addWidget(button3) self.addWidget(buttonClose) self.addWidget(sliderWarm) self.addWidget(sliderCold) self.drawBG()