]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/wxEditor.py
Don't create a bitmap with dimensions <= 0...
[wxWidgets.git] / wxPython / demo / wxEditor.py
CommitLineData
1b55cabf
RD
1
2from wxPython.wx import *
3from wxPython.lib.editor import wxEditor, wxPyEditor
4
5#----------------------------------------------------------------------
6
7def runTest(frame, nb, log):
8 win = wxPanel(nb, -1)
f2a497dc
RD
9 ed = wxEditor(win, -1, style=wxSUNKEN_BORDER)
10 pyed = wxPyEditor(win, -1, style=wxSUNKEN_BORDER)
1b55cabf
RD
11 box = wxBoxSizer(wxVERTICAL)
12 box.Add(ed, 1, wxALL|wxGROW, 5)
13 box.Add(pyed, 1, wxALL|wxGROW, 5)
14 win.SetSizer(box)
15 win.SetAutoLayout(true)
16
17 ed.SetText(["",
18 "This is a simple text editor, the class name is",
f0b0b7d4
RD
19 "wxEditor. Type a few lines and try it out.",
20 ""])
1b55cabf
RD
21
22 pyed.SetText(["# This one is a derived class named wxPyEditor.",
23 "# It adds syntax highlighting, folding (press",
24 "# F12 on the \"def\" line below) and other stuff.",
25 "import sys",
26 "def hello():",
27 " print 'hello'",
28 " for x in sys.path:",
29 " print x",
30 ""])
31 return win
32
33#----------------------------------------------------------------------
34
35
36
37
38
39overview = """\
40"""
41
42
43