3 import wx
.richtext
as rt
6 #----------------------------------------------------------------------
8 class RichTextFrame(wx
.Frame
):
9 def __init__(self
, *args
, **kw
):
10 wx
.Frame
.__init
__(self
, *args
, **kw
)
14 self
.CreateStatusBar()
15 self
.SetStatusText("Welcome to wx.richtext.RichTextCtrl!")
17 self
.rtc
= rt
.RichTextCtrl(self
, style
=wx
.VSCROLL|wx
.HSCROLL|wx
.NO_BORDER
);
18 wx
.CallAfter(self
.rtc
.SetFocus
)
21 self
.rtc
.BeginSuppressUndo()
23 self
.rtc
.BeginParagraphSpacing(0, 20)
25 self
.rtc
.BeginAlignment(rt
.TEXT_ALIGNMENT_CENTRE
)
28 self
.rtc
.BeginFontSize(14)
29 self
.rtc
.WriteText("Welcome to wxRichTextCtrl, a wxWidgets control for editing and presenting styled text and images")
30 self
.rtc
.EndFontSize()
33 self
.rtc
.BeginItalic()
34 self
.rtc
.WriteText("by Julian Smart")
40 self
.rtc
.WriteImage(images
.get_rt_zebraImage())
42 self
.rtc
.EndAlignment()
47 self
.rtc
.WriteText("What can you do with this thing? ")
48 self
.rtc
.WriteImage(images
.get_rt_smileyImage())
49 self
.rtc
.WriteText(" Well, you can change text ")
51 self
.rtc
.BeginTextColour((255, 0, 0))
52 self
.rtc
.WriteText("colour, like this red bit.")
53 self
.rtc
.EndTextColour()
55 self
.rtc
.BeginTextColour((0, 0, 255))
56 self
.rtc
.WriteText(" And this blue bit.")
57 self
.rtc
.EndTextColour()
59 self
.rtc
.WriteText(" Naturally you can make things ")
61 self
.rtc
.WriteText("bold ")
63 self
.rtc
.BeginItalic()
64 self
.rtc
.WriteText("or italic ")
66 self
.rtc
.BeginUnderline()
67 self
.rtc
.WriteText("or underlined.")
68 self
.rtc
.EndUnderline()
70 self
.rtc
.BeginFontSize(14)
71 self
.rtc
.WriteText(" Different font sizes on the same line is allowed, too.")
72 self
.rtc
.EndFontSize()
74 self
.rtc
.WriteText(" Next we'll show an indented paragraph.")
76 self
.rtc
.BeginLeftIndent(60)
79 self
.rtc
.WriteText("It was in January, the most down-trodden month of an Edinburgh winter. An attractive woman came into the cafe, which is nothing remarkable.")
80 self
.rtc
.EndLeftIndent()
84 self
.rtc
.WriteText("Next, we'll show a first-line indent, achieved using BeginLeftIndent(100, -40).")
86 self
.rtc
.BeginLeftIndent(100, -40)
89 self
.rtc
.WriteText("It was in January, the most down-trodden month of an Edinburgh winteself.rtc. An attractive woman came into the cafe, which is nothing remarkable.")
90 self
.rtc
.EndLeftIndent()
94 self
.rtc
.WriteText("Numbered bullets are possible, again using subindents:")
96 self
.rtc
.BeginNumberedBullet(1, 100, 60)
99 self
.rtc
.WriteText("This is my first item. Note that wxRichTextCtrl doesn't automatically do numbering, but this will be added later.")
100 self
.rtc
.EndNumberedBullet()
102 self
.rtc
.BeginNumberedBullet(2, 100, 60)
105 self
.rtc
.WriteText("This is my second item.")
106 self
.rtc
.EndNumberedBullet()
110 self
.rtc
.WriteText("The following paragraph is right-indented:")
112 self
.rtc
.BeginRightIndent(200)
115 self
.rtc
.WriteText("It was in January, the most down-trodden month of an Edinburgh winter. An attractive woman came into the cafe, which is nothing remarkable.")
116 self
.rtc
.EndRightIndent()
120 self
.rtc
.WriteText("The following paragraph is right-aligned with 1.5 line spacing:")
122 self
.rtc
.BeginAlignment(rt
.TEXT_ALIGNMENT_RIGHT
)
123 self
.rtc
.BeginLineSpacing(rt
.TEXT_ATTR_LINE_SPACING_HALF
)
126 self
.rtc
.WriteText("It was in January, the most down-trodden month of an Edinburgh winter. An attractive woman came into the cafe, which is nothing remarkable.")
127 self
.rtc
.EndLineSpacing()
128 self
.rtc
.EndAlignment()
131 self
.rtc
.WriteText("Other notable features of wxRichTextCtrl include:")
133 self
.rtc
.BeginSymbolBullet('*', 100, 60)
135 self
.rtc
.WriteText("Compatibility with wxTextCtrl API")
136 self
.rtc
.EndSymbolBullet()
138 self
.rtc
.BeginSymbolBullet('*', 100, 60)
140 self
.rtc
.WriteText("Easy stack-based BeginXXX()...EndXXX() style setting in addition to SetStyle()")
141 self
.rtc
.EndSymbolBullet()
143 self
.rtc
.BeginSymbolBullet('*', 100, 60)
145 self
.rtc
.WriteText("XML loading and saving")
146 self
.rtc
.EndSymbolBullet()
148 self
.rtc
.BeginSymbolBullet('*', 100, 60)
150 self
.rtc
.WriteText("Undo/Redo, with batching option and Undo suppressing")
151 self
.rtc
.EndSymbolBullet()
153 self
.rtc
.BeginSymbolBullet('*', 100, 60)
155 self
.rtc
.WriteText("Clipboard copy and paste")
156 self
.rtc
.EndSymbolBullet()
158 self
.rtc
.BeginSymbolBullet('*', 100, 60)
160 self
.rtc
.WriteText("wxRichTextStyleSheet with named character and paragraph styles, and control for applying named styles")
161 self
.rtc
.EndSymbolBullet()
163 self
.rtc
.BeginSymbolBullet('*', 100, 60)
165 self
.rtc
.WriteText("A design that can easily be extended to other content types, ultimately with text boxes, tables, controls, and so on")
166 self
.rtc
.EndSymbolBullet()
170 self
.rtc
.WriteText("Note: this sample content was generated programmatically from within the MyFrame constructor in the demo. The images were loaded from inline XPMs. Enjoy wxRichTextCtrl!")
172 self
.rtc
.EndParagraphSpacing()
174 self
.rtc
.EndSuppressUndo()
178 def OnFileOpen(self
, evt
):
179 # TODO: Use RichTextBuffer.GetExtWildcard to get the wildcard string
180 dlg
= wx
.FileDialog(self
, "Choose a filename",
181 wildcard
="All files (*.*)|*.*",
183 if dlg
.ShowModal() == wx
.ID_OK
:
186 # TODO: use the filter index to determine what file type to use
187 self
.rtc
.LoadFile(path
, rt
.RICHTEXT_TYPE_TEXT
)
191 def OnFileSave(self
, evt
):
192 if not self
.rtc
.GetFilename():
193 self
.OnFileSaveAs(evt
)
197 def OnFileSaveAs(self
, evt
):
198 # TODO: Use RichTextBuffer.GetExtWildcard to get the wildcard string
199 dlg
= wx
.FileDialog(self
, "Choose a filename",
200 wildcard
="All files (*.*)|*.*",
202 if dlg
.ShowModal() == wx
.ID_OK
:
205 self
.rtc
.SaveFile(path
)
209 def OnFileViewHTML(self
, evt
): pass
212 def OnFileExit(self
, evt
):
216 def OnBold(self
, evt
):
217 self
.rtc
.ApplyBoldToSelection()
219 def OnItalic(self
, evt
):
220 self
.rtc
.ApplyItalicToSelection()
222 def OnUnderline(self
, evt
):
223 self
.rtc
.ApplyUnderlineToSelection()
225 def OnAlignLeft(self
, evt
):
226 self
.rtc
.ApplyAlignmentToSelection(rt
.TEXT_ALIGNMENT_LEFT
)
228 def OnAlignRight(self
, evt
):
229 self
.rtc
.ApplyAlignmentToSelection(rt
.TEXT_ALIGNMENT_RIGHT
)
231 def OnAlignCenter(self
, evt
):
232 self
.rtc
.ApplyAlignmentToSelection(rt
.TEXT_ALIGNMENT_CENTRE
)
234 def OnIndentMore(self
, evt
):
235 attr
= rt
.RichTextAttr()
236 attr
.SetFlags(rt
.TEXT_ATTR_LEFT_INDENT
)
237 ip
= self
.rtc
.GetInsertionPoint()
238 if self
.rtc
.GetStyle(ip
, attr
):
239 r
= rt
.RichTextRange(ip
, ip
)
240 if self
.rtc
.HasSelection():
241 r
= self
.rtc
.GetSelectionRange()
243 attr
.SetLeftIndent(attr
.GetLeftIndent() + 100)
244 attr
.SetFlags(rt
.TEXT_ATTR_LEFT_INDENT
)
245 self
.rtc
.SetStyle(r
, attr
)
248 def OnIndentLess(self
, evt
):
249 attr
= rt
.RichTextAttr()
250 attr
.SetFlags(rt
.TEXT_ATTR_LEFT_INDENT
)
251 ip
= self
.rtc
.GetInsertionPoint()
252 if self
.rtc
.GetStyle(ip
, attr
):
253 r
= rt
.RichTextRange(ip
, ip
)
254 if self
.rtc
.HasSelection():
255 r
= self
.rtc
.GetSelectionRange()
257 if attr
.GetLeftIndent() >= 100:
258 attr
.SetLeftIndent(attr
.GetLeftIndent() - 100)
259 attr
.SetFlags(rt
.TEXT_ATTR_LEFT_INDENT
)
260 self
.rtc
.SetStyle(r
, attr
)
263 def OnParagraphSpacingMore(self
, evt
):
264 attr
= rt
.RichTextAttr()
265 attr
.SetFlags(rt
.TEXT_ATTR_PARA_SPACING_AFTER
)
266 ip
= self
.rtc
.GetInsertionPoint()
267 if self
.rtc
.GetStyle(ip
, attr
):
268 r
= rt
.RichTextRange(ip
, ip
)
269 if self
.rtc
.HasSelection():
270 r
= self
.rtc
.GetSelectionRange()
272 attr
.SetParagraphSpacingAfter(attr
.GetParagraphSpacingAfter() + 20);
273 attr
.SetFlags(rt
.TEXT_ATTR_PARA_SPACING_AFTER
)
274 self
.rtc
.SetStyle(r
, attr
)
277 def OnParagraphSpacingLess(self
, evt
):
278 attr
= rt
.RichTextAttr()
279 attr
.SetFlags(rt
.TEXT_ATTR_PARA_SPACING_AFTER
)
280 ip
= self
.rtc
.GetInsertionPoint()
281 if self
.rtc
.GetStyle(ip
, attr
):
282 r
= rt
.RichTextRange(ip
, ip
)
283 if self
.rtc
.HasSelection():
284 r
= self
.rtc
.GetSelectionRange()
286 if attr
.GetParagraphSpacingAfter() >= 20:
287 attr
.SetParagraphSpacingAfter(attr
.GetParagraphSpacingAfter() - 20);
288 attr
.SetFlags(rt
.TEXT_ATTR_PARA_SPACING_AFTER
)
289 self
.rtc
.SetStyle(r
, attr
)
292 def OnLineSpacingSingle(self
, evt
):
293 attr
= rt
.RichTextAttr()
294 attr
.SetFlags(rt
.TEXT_ATTR_LINE_SPACING
)
295 ip
= self
.rtc
.GetInsertionPoint()
296 if self
.rtc
.GetStyle(ip
, attr
):
297 r
= rt
.RichTextRange(ip
, ip
)
298 if self
.rtc
.HasSelection():
299 r
= self
.rtc
.GetSelectionRange()
301 attr
.SetFlags(rt
.TEXT_ATTR_LINE_SPACING
)
302 attr
.SetLineSpacing(10)
303 self
.rtc
.SetStyle(r
, attr
)
306 def OnLineSpacingHalf(self
, evt
):
307 attr
= rt
.RichTextAttr()
308 attr
.SetFlags(rt
.TEXT_ATTR_LINE_SPACING
)
309 ip
= self
.rtc
.GetInsertionPoint()
310 if self
.rtc
.GetStyle(ip
, attr
):
311 r
= rt
.RichTextRange(ip
, ip
)
312 if self
.rtc
.HasSelection():
313 r
= self
.rtc
.GetSelectionRange()
315 attr
.SetFlags(rt
.TEXT_ATTR_LINE_SPACING
)
316 attr
.SetLineSpacing(15)
317 self
.rtc
.SetStyle(r
, attr
)
320 def OnLineSpacingDouble(self
, evt
):
321 attr
= rt
.RichTextAttr()
322 attr
.SetFlags(rt
.TEXT_ATTR_LINE_SPACING
)
323 ip
= self
.rtc
.GetInsertionPoint()
324 if self
.rtc
.GetStyle(ip
, attr
):
325 r
= rt
.RichTextRange(ip
, ip
)
326 if self
.rtc
.HasSelection():
327 r
= self
.rtc
.GetSelectionRange()
329 attr
.SetFlags(rt
.TEXT_ATTR_LINE_SPACING
)
330 attr
.SetLineSpacing(20)
331 self
.rtc
.SetStyle(r
, attr
)
334 def OnFont(self
, evt
):
335 if not self
.rtc
.HasSelection():
338 r
= self
.rtc
.GetSelectionRange()
339 fontData
= wx
.FontData()
340 fontData
.EnableEffects(False)
341 attr
= rt
.RichTextAttr()
342 attr
.SetFlags(rt
.TEXT_ATTR_FONT
)
343 if self
.rtc
.GetStyle(self
.rtc
.GetInsertionPoint(), attr
):
344 fontData
.SetInitialFont(attr
.CreateFont())
346 dlg
= wx
.FontDialog(self
, fontData
)
347 if dlg
.ShowModal() == wx
.ID_OK
:
348 fontData
= dlg
.GetFontData()
349 font
= fontData
.GetChosenFont()
351 attr
.SetFlags(rt
.TEXT_ATTR_FONT
)
353 self
.rtc
.SetStyle(r
, attr
)
357 def OnColour(self
, evt
):
358 colourData
= wx
.ColourData()
359 attr
= rt
.RichTextAttr()
360 attr
.SetFlags(rt
.TEXT_ATTR_TEXT_COLOUR
)
361 if self
.rtc
.GetStyle(self
.rtc
.GetInsertionPoint(), attr
):
362 colourData
.SetColour(attr
.GetTextColour())
364 dlg
= wx
.ColourDialog(self
, colourData
)
365 if dlg
.ShowModal() == wx
.ID_OK
:
366 colourData
= dlg
.GetColourData()
367 colour
= colourData
.GetColour()
369 if not self
.rtc
.HasSelection():
370 self
.rtc
.BeginTextColour(colour
)
372 r
= self
.rtc
.GetSelectionRange()
373 attr
.SetFlags(rt
.TEXT_ATTR_TEXT_COLOUR
)
374 attr
.SetTextColour(colour
)
375 self
.rtc
.SetStyle(r
, attr
)
380 def OnUpdateBold(self
, evt
):
381 evt
.Check(self
.rtc
.IsSelectionBold())
383 def OnUpdateItalic(self
, evt
):
384 evt
.Check(self
.rtc
.IsSelectionItalics())
386 def OnUpdateUnderline(self
, evt
):
387 evt
.Check(self
.rtc
.IsSelectionUnderlined())
389 def OnUpdateAlignLeft(self
, evt
):
390 evt
.Check(self
.rtc
.IsSelectionAligned(rt
.TEXT_ALIGNMENT_LEFT
))
392 def OnUpdateAlignCenter(self
, evt
):
393 evt
.Check(self
.rtc
.IsSelectionAligned(rt
.TEXT_ALIGNMENT_CENTRE
))
395 def OnUpdateAlignRight(self
, evt
):
396 evt
.Check(self
.rtc
.IsSelectionAligned(rt
.TEXT_ALIGNMENT_RIGHT
))
399 def ForwardEvent(self
, evt
):
400 # The RichTextCtrl can handle menu and update events for undo,
401 # redo, cut, copy, paste, delete, and select all, so just
402 # forward the event to it.
403 self
.rtc
.ProcessEvent(evt
)
406 def MakeMenuBar(self
):
407 def doBind(item
, handler
, updateUI
=None):
408 self
.Bind(wx
.EVT_MENU
, handler
, item
)
409 if updateUI
is not None:
410 self
.Bind(wx
.EVT_UPDATE_UI
, updateUI
, item
)
413 doBind( fileMenu
.Append(-1, "&Open\tCtrl+O", "Open a file"),
415 doBind( fileMenu
.Append(-1, "&Save\tCtrl+S", "Save a file"),
417 doBind( fileMenu
.Append(-1, "&Save As...\tF12", "Save to a new file"),
419 fileMenu
.AppendSeparator()
420 doBind( fileMenu
.Append(-1, "&View as HTML", "View HTML"),
422 fileMenu
.AppendSeparator()
423 doBind( fileMenu
.Append(-1, "E&xit\tCtrl+Q", "Quit this program"),
427 doBind( editMenu
.Append(wx
.ID_UNDO
, "&Undo\tCtrl+Z"),
428 self
.ForwardEvent
, self
.ForwardEvent
)
429 doBind( editMenu
.Append(wx
.ID_REDO
, "&Redo\tCtrl+Y"),
430 self
.ForwardEvent
, self
.ForwardEvent
)
431 editMenu
.AppendSeparator()
432 doBind( editMenu
.Append(wx
.ID_CUT
, "Cu&t\tCtrl+X"),
433 self
.ForwardEvent
, self
.ForwardEvent
)
434 doBind( editMenu
.Append(wx
.ID_COPY
, "&Copy\tCtrl+C"),
435 self
.ForwardEvent
, self
.ForwardEvent
)
436 doBind( editMenu
.Append(wx
.ID_PASTE
, "&Paste\tCtrl+V"),
437 self
.ForwardEvent
, self
.ForwardEvent
)
438 doBind( editMenu
.Append(wx
.ID_CLEAR
, "&Delete\tDel"),
439 self
.ForwardEvent
, self
.ForwardEvent
)
440 editMenu
.AppendSeparator()
441 doBind( editMenu
.Append(wx
.ID_SELECTALL
, "Select A&ll\tCtrl+A"),
442 self
.ForwardEvent
, self
.ForwardEvent
)
444 #doBind( editMenu.AppendSeparator(), )
445 #doBind( editMenu.Append(-1, "&Find...\tCtrl+F"), )
446 #doBind( editMenu.Append(-1, "&Replace...\tCtrl+R"), )
448 formatMenu
= wx
.Menu()
449 doBind( formatMenu
.AppendCheckItem(-1, "&Bold\tCtrl+B"),
450 self
.OnBold
, self
.OnUpdateBold
)
451 doBind( formatMenu
.AppendCheckItem(-1, "&Italic\tCtrl+I"),
452 self
.OnItalic
, self
.OnUpdateItalic
)
453 doBind( formatMenu
.AppendCheckItem(-1, "&Underline\tCtrl+U"),
454 self
.OnUnderline
, self
.OnUpdateUnderline
)
455 formatMenu
.AppendSeparator()
456 doBind( formatMenu
.AppendCheckItem(-1, "L&eft Align"),
457 self
.OnAlignLeft
, self
.OnUpdateAlignLeft
)
458 doBind( formatMenu
.AppendCheckItem(-1, "&Centre"),
459 self
.OnAlignCenter
, self
.OnUpdateAlignCenter
)
460 doBind( formatMenu
.AppendCheckItem(-1, "&Right Align"),
461 self
.OnAlignRight
, self
.OnUpdateAlignRight
)
462 formatMenu
.AppendSeparator()
463 doBind( formatMenu
.Append(-1, "Indent &More"), self
.OnIndentMore
)
464 doBind( formatMenu
.Append(-1, "Indent &Less"), self
.OnIndentLess
)
465 formatMenu
.AppendSeparator()
466 doBind( formatMenu
.Append(-1, "Increase Paragraph &Spacing"), self
.OnParagraphSpacingMore
)
467 doBind( formatMenu
.Append(-1, "Decrease &Paragraph Spacing"), self
.OnParagraphSpacingLess
)
468 formatMenu
.AppendSeparator()
469 doBind( formatMenu
.Append(-1, "Normal Line Spacing"), self
.OnLineSpacingSingle
)
470 doBind( formatMenu
.Append(-1, "1.5 Line Spacing"), self
.OnLineSpacingHalf
)
471 doBind( formatMenu
.Append(-1, "Double Line Spacing"), self
.OnLineSpacingDouble
)
472 formatMenu
.AppendSeparator()
473 doBind( formatMenu
.Append(-1, "&Font..."), self
.OnFont
)
476 mb
.Append(fileMenu
, "&File")
477 mb
.Append(editMenu
, "&Edit")
478 mb
.Append(formatMenu
, "F&ormat")
482 def MakeToolBar(self
):
483 def doBind(item
, handler
, updateUI
=None):
484 self
.Bind(wx
.EVT_TOOL
, handler
, item
)
485 if updateUI
is not None:
486 self
.Bind(wx
.EVT_UPDATE_UI
, updateUI
, item
)
488 tbar
= self
.CreateToolBar()
489 doBind( tbar
.AddTool(-1, images
.get_rt_openBitmap(),
490 shortHelpString
="Open"), self
.OnFileOpen
)
491 doBind( tbar
.AddTool(-1, images
.get_rt_saveBitmap(),
492 shortHelpString
="Save"), self
.OnFileSave
)
494 doBind( tbar
.AddTool(wx
.ID_CUT
, images
.get_rt_cutBitmap(),
495 shortHelpString
="Cut"), self
.ForwardEvent
, self
.ForwardEvent
)
496 doBind( tbar
.AddTool(wx
.ID_COPY
, images
.get_rt_copyBitmap(),
497 shortHelpString
="Copy"), self
.ForwardEvent
, self
.ForwardEvent
)
498 doBind( tbar
.AddTool(wx
.ID_PASTE
, images
.get_rt_pasteBitmap(),
499 shortHelpString
="Paste"), self
.ForwardEvent
, self
.ForwardEvent
)
501 doBind( tbar
.AddTool(wx
.ID_UNDO
, images
.get_rt_undoBitmap(),
502 shortHelpString
="Undo"), self
.ForwardEvent
, self
.ForwardEvent
)
503 doBind( tbar
.AddTool(wx
.ID_REDO
, images
.get_rt_redoBitmap(),
504 shortHelpString
="Redo"), self
.ForwardEvent
, self
.ForwardEvent
)
506 doBind( tbar
.AddTool(-1, images
.get_rt_boldBitmap(), isToggle
=True,
507 shortHelpString
="Bold"), self
.OnBold
, self
.OnUpdateBold
)
508 doBind( tbar
.AddTool(-1, images
.get_rt_italicBitmap(), isToggle
=True,
509 shortHelpString
="Italic"), self
.OnItalic
, self
.OnUpdateItalic
)
510 doBind( tbar
.AddTool(-1, images
.get_rt_underlineBitmap(), isToggle
=True,
511 shortHelpString
="Underline"), self
.OnUnderline
, self
.OnUpdateUnderline
)
513 doBind( tbar
.AddTool(-1, images
.get_rt_alignleftBitmap(), isToggle
=True,
514 shortHelpString
="Align Left"), self
.OnAlignLeft
, self
.OnUpdateAlignLeft
)
515 doBind( tbar
.AddTool(-1, images
.get_rt_centreBitmap(), isToggle
=True,
516 shortHelpString
="Center"), self
.OnAlignCenter
, self
.OnUpdateAlignCenter
)
517 doBind( tbar
.AddTool(-1, images
.get_rt_alignrightBitmap(), isToggle
=True,
518 shortHelpString
="Align Right"), self
.OnAlignRight
, self
.OnUpdateAlignRight
)
520 doBind( tbar
.AddTool(-1, images
.get_rt_indentlessBitmap(),
521 shortHelpString
="Indent Less"), self
.OnIndentLess
)
522 doBind( tbar
.AddTool(-1, images
.get_rt_indentmoreBitmap(),
523 shortHelpString
="Indent More"), self
.OnIndentMore
)
525 doBind( tbar
.AddTool(-1, images
.get_rt_fontBitmap(),
526 shortHelpString
="Font"), self
.OnFont
)
527 doBind( tbar
.AddTool(-1, images
.get_rt_colourBitmap(),
528 shortHelpString
="Font Colour"), self
.OnColour
)
534 #----------------------------------------------------------------------
536 class TestPanel(wx
.Panel
):
537 def __init__(self
, parent
, log
):
539 wx
.Panel
.__init
__(self
, parent
, -1)
541 b
= wx
.Button(self
, -1, "Show the RichTextCtrl sample", (50,50))
542 self
.Bind(wx
.EVT_BUTTON
, self
.OnButton
, b
)
545 def OnButton(self
, evt
):
546 win
= RichTextFrame(self
, -1, "wx.richtext.RichTextCtrl",
548 style
= wx
.DEFAULT_FRAME_STYLE
)
551 # give easy access to PyShell if it's running
555 #----------------------------------------------------------------------
557 def runTest(frame
, nb
, log
):
558 win
= TestPanel(nb
, log
)
561 #----------------------------------------------------------------------
565 overview
= """<html><body>
566 <h2><center>wx.richtext.RichTextCtrl</center></h2>
573 if __name__
== '__main__':
576 run
.main(['', os
.path
.basename(sys
.argv
[0])] + sys
.argv
[1:])