def initUI(self):
        
        photo = ImageTk.PhotoImage(file='icon/main_bg_4.jpg')
        w = Tkinter.Label(self,image=photo)
        w.photo = photo 
        w.place(x=0, y=0, relwidth=1, relheight=1)
        #ackground_label.pack()
        
        
        self.api = IntVar()
        self.parent.title("Face Recognition System")
        self.style = Style()
        self.style.theme_use("default")

        self.pack(fill=BOTH, expand=1)
        
        faceplus = Radiobutton(self, text="Face++", variable=self.api, value=1)
        faceplus.place(x=50, y=40)
        
        facer = Radiobutton(self, text="FaceR Animetrics", variable=self.api, value=2)
        facer.place(x=200, y=40)

        start = Button(self, text="Start Recognition",
            command=self.startRecognition)
        start.place(x=100, y=80)
        
        helpButton = Button(self, text="Help",
            command=self.giveHelp)
        helpButton.place(x=100, y=110)
    
        quitButton = Button(self, text="Quit",
            command=self.quitGUI)
        quitButton.place(x=100, y=140)
예제 #2
0
    def initUI(self):

        var = IntVar()

        #General stuff
        self.parent.title("I2C Command Manager")
        self.style = Style()
        self.style.theme_use("default")
        #self.pack(fill=BOTH, expand=1)
        self.parent.configure(background=Constants.BG_COL)

        s = Style()
        s.configure('C.TRadiobutton', background=Constants.BG_COL)

        #Quit button
        quitButton = Button(self.parent, text="Quit", command=self.quit)
        quitButton.place(x=Constants.QUIT_X, y=Constants.QUIT_Y)

        #Radiobuttons
        ledRadio = Radiobutton(
            self.parent,
            text="LED Strip",
            variable=var,
            value=1,
            command=lambda: self.instructor.setAddress(0x04),
            style='C.TRadiobutton')
        vertRadio = Radiobutton(
            self.parent,
            text="Vertical Motion",
            variable=var,
            value=2,
            command=lambda: self.instructor.setAddress(0x06),
            style='C.TRadiobutton')
        ledRadio.place(x=Constants.LED_X, y=Constants.LED_Y)
        vertRadio.place(x=Constants.VERT_X, y=Constants.VERT_Y)
        #ledRadio.configure(background = Constants.BG_COL)

        #Label
        sendLabel = Label(self.parent,
                          text="Enter command:",
                          background=Constants.BG_COL)
        sendLabel.place(x=Constants.SENDL_X, y=Constants.SENDL_Y)

        #Address label
        adLabel = Label(self.parent,
                        text="Select address:",
                        background=Constants.BG_COL)
        adLabel.place(x=Constants.ADL_X, y=Constants.ADL_Y)

        #Text entry box
        textBox = Entry(self.parent, bd=2, width=Constants.TEXT_W)
        textBox.place(x=Constants.TEXT_X, y=Constants.TEXT_Y)

        #Send command button
        sendButton = Button(self.parent,
                            text="Send",
                            command=lambda: self.assignCommand(textBox.get()))
        sendButton.place(x=Constants.SENDB_X, y=Constants.SENDB_Y)