I am trying to create a simple invoice program for a school project. I have the basic layout of my program. The large text boxes on the left are for the invoice, and the ones on the right are for the price of that input.
I want the text boxes to return the input into them, and assign it to say JobOne. The next step is that I need these values to be send to a file in Notepad when the 'Send To Invoice' button is clicked. I am really stuck here, I've tried so many different combinations of things, and I'm forever getting "TextCtrl" object is not callable. Any help would be greatly appreciated. I've taken out my messy attempts to get the problem working and stripped it down to its barebones.
import wx class windowClass(wx.Frame): def __init__(self, *args, **kwargs): super(windowClass, self).__init__(*args, **kwargs) self.basicGUI() def basicGUI(self): panel = wx.Panel(self) self.SetSizeWH(1200, 800) menuBar = wx.MenuBar() fileButton = wx.Menu() exitItem = fileButton.Append(wx.ID_EXIT, 'Exit', 'status msg...') menuBar.Append(fileButton, 'File') self.SetMenuBar(menuBar) self.Bind(wx.EVT_MENU, self.Quit, exitItem) yesNoBox = wx.MessageDialog(None, 'Do you wish to create a new invoice?', 'Create New Invoice?', wx.YES_NO) yesNoAnswer = yesNoBox.ShowModal() yesNoBox.Destroy() nameBox = wx.TextEntryDialog(None, 'What is the name of the customer?', 'Customer Name' , 'Customer Name') if nameBox.ShowModal() ==wx.ID_OK: CustomerName = nameBox.GetValue() wx.TextCtrl(panel, pos=(10, 10), size=(500,100)) wx.TextCtrl(panel, pos=(550, 10), size=(60,20)) wx.TextCtrl(panel, pos=(10, 200), size=(500,100)) wx.TextCtrl(panel, pos=(550, 200), size=(60,20)) wx.TextCtrl(panel, pos=(10, 400), size=(500,100)) wx.TextCtrl(panel, pos=(550, 400), size=(60,20)) self.SetTitle('Invoice For ' +CustomerName) SendToNotepadButton = wx.Button(panel, label='Convert to invoice',pos=(650, 600), size=(120, 80)) def SendToNotepad(e): f = open("Notepad.exe", 'w') f.write(()) call(["Notepad.exe", "CustomerInvoice"]) self.Bind(wx.EVT_BUTTON, SendToNotepad) self.Show(True) def Quit(self, e): self.Close() def main(): app = wx.App() windowClass(None) app.MainLoop() main()
If you manage to help me, I thank you!