Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import wx
- import wx.lib.dialogs
- import wx.stc as stc
- faces = {
- 'Times' : 'Times New Roman',
- 'Mono' : 'Courier New',
- 'Helv' : 'Arial',
- 'Comic' : 'Comic Sans MS',
- 'size': 10,
- 'size': 8,
- }
- class MainWindow(wx.Frame):
- def __init__(self, parent, title):
- super(MainWindow, self).__init__(parent, title=title, size=(800, 600))
- self.control = stc.StyledTextCtrl(self, style=wx.TE_MULTILINE | wx.TE_WORDWRAP)
- self.control.CmdKeyAssign(ord('='), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) # FOR ZOOMING IN
- self.control.CmdKeyAssign(ord('-'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
- self.control.SetViewWhiteSpace(False)
- self.control.SetMargins(5, 0)
- self.control.SetMarginType(1, stc.STC_MARGIN_NUMBER)
- self.control.SetMarginWidth(1, 25)
- def main():
- app = wx.App()
- frame = MainWindow(None, title="Text Editor")
- frame.Show()
- app.MainLoop()
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement