Ejemplo n.º 1
0
    def addConfigBtn(self, login):
        # configured buttons
        # btnList = (addBtn, listBtn, getBtn)

        # Creating temp references to images using temp1,2,3 so as to disallow
        # garbage collection problems
        btnList = ["Add", "List", "Search"]
        btnCmdList = [
            lambda: Add.AddWindow(self), lambda: List.ListWindow(self),
            lambda: Search.SearchWindow(self)
        ]
        f = []  # Frames array
        img = []  # image array
        self.temp = []  # temp array

        for i in xrange(3):
            f.append(Frame(login, padx=2, width=50, height=50))
            f[i].grid(row=3, column=i)
            img.append(
                PhotoImage(file=btnList[i] + ".gif", width=48, height=48))
            self.temp.append(img[i])
            ttk.Button(f[i],
                       image=img[i],
                       text=btnList[i],
                       compound="top",
                       style="Submit.TButton",
                       command=btnCmdList[i]).grid(sticky="NWSE")