def addCharacter(self, event): title = self.sTitle.GetValue() body = self.sBody.GetValue() paragraph = self.sParagraph.GetValue() footer = self.sFooter.GetValue() # Checking if variables have a value if (title == '') or (body == '') or (paragraph == '') or (footer == ''): # Alert user that a variable is empty dlg = wx.MessageDialog(None, \ 'Some HTML details are missing. Enter values in each text box.', \ 'Missing Details', wx.OK) dlg.ShowModal() dlg.Destroy() return False # Adding character to database db_program.newHTML(title, body, paragraph, footer) print db_program.viewAll() # Empty text boxes when finished. self.sTitle.Clear() self.sBody.Clear() self.sParagraph.Clear() self.sFooter.Clear() # Update list control self.fillListCtrl()
def submit(self): title = self.entry_title.get() body = self.entry_body.get() paragraph = self.entry_paragraph.get() footer = self.entry_footer.get() # Adding character to database db_program.newHTML(title, body, paragraph, footer) # Empty text boxes when finished. self.entry_title.delete(0, END) self.entry_body.delete(0, END) self.entry_paragraph.delete(0, END) self.entry_footer.delete(0, END) # Update tree view self.updateTreeView() messagebox.showinfo(title = 'Process HTML', message = 'HTML Submitted!')