def edit(self): """Create edition frame to edit current category name""" self.mainFrame.editState = self.mainFrame.EDITING self.label.grid_forget() message = 'Edit Category Name:' self.newName = tk.StringVar() self.editFrame = TextEditFrame(master=self, textVar=self.newName, labelText=message, buttonText='Edit', buttonAction=self.editCategory, cancelButtonAction=self.cancelEditCategory) self.editFrame.grid(columnspan=2) self.config(bd=2, relief=tk.SUNKEN)
def add_subcategory(self): """Create edition frame to add subcategory to current one""" self.mainFrame.editState = self.mainFrame.ADDING if self.id == -1: message = 'New category:' else: message = 'New Subcategory:' self.catName = tk.StringVar() self.editFrame = TextEditFrame(master=self, textVar=self.catName, labelText=message, buttonText='Add', buttonAction=self.addCategory, cancelButtonAction=self.cancelAddCategory) self.editFrame.grid(row=0, column=1, columnspan=2, rowspan=3) self.config(bd=2, relief=tk.SUNKEN)
def add_brandOrCompany(self): """Create edition frame to add a new brand or company""" self.mainFrame.editState = self.mainFrame.ADDING if self.id == -1: message = "New Company:" else: message = "New Brand:" self.newName = tk.StringVar() self.editFrame = TextEditFrame(master=self, textVar=self.newName, labelText=message, buttonText='Add', buttonAction=self.addNewBrandOrCompany, cancelButtonAction=self.cancelAdding) self.editFrame.grid(row=0, column=1, columnspan=2, rowspan=3) self.config(bd=2, relief=tk.SUNKEN)