I have 2 questions
1.the lines I've commented out don't work and I don't see the probleme
2.I want to create a function so I can save what I typed in in a file I know how to write to a file but I don't know what
variable the wxTextCtrl uses in other words what var do I have to write to the file ?
here is the code:
import sys, os
from wxPython.wx import *
ID_OPEN = 101
ID_SAVE = 102
ID_EXIT = 103
class main_window(wxFrame):
def __init__(self, parent, id, title):
wxFrame.__init__(self, parent, -1, title, size = (500,500),style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
self.CreateStatusBar()
self.SetStatusText("small editor")
M_file = wxMenu()
M_file.Append(ID_OPEN,"&Open","Open a file")
M_file.Append(ID_SAVE,"&Save","Save a file")
M_file.Append(ID_EXIT,"&Quit","Quit this small editor")
menuBar = wxMenuBar()
menuBar.Append(M_file,"&File")
self.SetMenuBar(menuBar)
self.control = wxTextCtrl(self, -1, style=wxTE_MULTILINE)
self.Show(true)
# EVT_MENU(self, ID_EXIT, self.TimeToQuit)
···
#
# def TimeToQuit(self, event):
# self.Close(true)
class App(wxApp):
def OnInit(self):
frame = main_window(None, -1, "wxPython: (A Demonstration)")
frame.Show(true)
self.SetTopWindow(frame)
return true
app = App(0)
app.MainLoop()