Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. import wx
  2. import wx.lib.dialogs
  3. import wx.stc as stc
  4.  
  5. faces = {
  6. 'Times' : 'Times New Roman',
  7. 'Mono' : 'Courier New',
  8. 'Helv' : 'Arial',
  9. 'Comic' : 'Comic Sans MS',
  10. 'size': 10,
  11. 'size': 8,
  12. }
  13.  
  14.  
  15. class MainWindow(wx.Frame):
  16. def __init__(self, parent, title):
  17. super(MainWindow, self).__init__(parent, title=title, size=(800, 600))
  18.  
  19. self.control = stc.StyledTextCtrl(self, style=wx.TE_MULTILINE | wx.TE_WORDWRAP)
  20.  
  21. self.control.CmdKeyAssign(ord('='), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) # FOR ZOOMING IN
  22. self.control.CmdKeyAssign(ord('-'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
  23.  
  24. self.control.SetViewWhiteSpace(False)
  25. self.control.SetMargins(5, 0)
  26. self.control.SetMarginType(1, stc.STC_MARGIN_NUMBER)
  27. self.control.SetMarginWidth(1, 25)
  28.  
  29.  
  30. def main():
  31. app = wx.App()
  32. frame = MainWindow(None, title="Text Editor")
  33. frame.Show()
  34. app.MainLoop()
  35.  
  36.  
  37. if __name__ == '__main__':
  38. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement