Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 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. self.CreateStatusBar()
  29. self.StatusBar.SetBackgroundColour((220, 220, 220)
  30.  
  31. def main():
  32. app = wx.App()
  33. frame = MainWindow(None, title="Text Editor")
  34. frame.Show()
  35. app.MainLoop()
  36.  
  37.  
  38. if __name__ == '__main__':
  39. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement