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()
177 def OnFileOpen(self
, evt
):
178 # TODO: Use RichTextBuffer.GetExtWildcard to get the wildcard string
179 dlg
= wx
.FileDialog(self
, "Choose a filename",
180 wildcard
="All files (*.*)|*.*",
182 if dlg
.ShowModal() == wx
.ID_OK
:
185 # TODO: use the filter index to determine what file type to use
186 self
.rtc
.LoadFile(path
, rt
.RICHTEXT_TYPE_TEXT
)
190 def OnFileSave(self
, evt
):
191 if not self
.rtc
.GetFilename():
192 self
.OnFileSaveAs(evt
)
196 def OnFileSaveAs(self
, evt
):
197 # TODO: Use RichTextBuffer.GetExtWildcard to get the wildcard string
198 dlg
= wx
.FileDialog(self
, "Choose a filename",
199 wildcard
="All files (*.*)|*.*",
201 if dlg
.ShowModal() == wx
.ID_OK
:
204 self
.rtc
.SaveFile(path
)
208 def OnFileViewHTML(self
, evt
): pass
211 def OnFileExit(self
, evt
):
215 def OnBold(self
, evt
):
216 self
.rtc
.ApplyBoldToSelection()
218 def OnItalic(self
, evt
):
219 self
.rtc
.ApplyItalicToSelection()
221 def OnUnderline(self
, evt
):
222 self
.rtc
.ApplyUnderlineToSelection()
224 def OnAlignLeft(self
, evt
):
225 self
.rtc
.ApplyAlignmentToSelection(rt
.TEXT_ALIGNMENT_LEFT
)
227 def OnAlignRight(self
, evt
):
228 self
.rtc
.ApplyAlignmentToSelection(rt
.TEXT_ALIGNMENT_RIGHT
)
230 def OnAlignCenter(self
, evt
):
231 self
.rtc
.ApplyAlignmentToSelection(rt
.TEXT_ALIGNMENT_CENTRE
)
233 def OnIndentMore(self
, evt
):
234 attr
= rt
.RichTextAttr()
235 attr
.SetFlags(rt
.TEXT_ATTR_LEFT_INDENT
)
236 ip
= self
.rtc
.GetInsertionPoint()
237 if self
.rtc
.GetStyle(ip
, attr
):
238 r
= rt
.RichTextRange(ip
, ip
)
239 if self
.rtc
.HasSelection():
240 r
= self
.rtc
.GetSelectionRange()
242 attr
.SetLeftIndent(attr
.GetLeftIndent() + 100)
243 attr
.SetFlags(rt
.TEXT_ATTR_LEFT_INDENT
)
244 self
.rtc
.SetStyle(r
, attr
)
247 def OnIndentLess(self
, evt
):
248 attr
= rt
.RichTextAttr()
249 attr
.SetFlags(rt
.TEXT_ATTR_LEFT_INDENT
)
250 ip
= self
.rtc
.GetInsertionPoint()
251 if self
.rtc
.GetStyle(ip
, attr
):
252 r
= rt
.RichTextRange(ip
, ip
)
253 if self
.rtc
.HasSelection():
254 r
= self
.rtc
.GetSelectionRange()
256 if attr
.GetLeftIndent() >= 100:
257 attr
.SetLeftIndent(attr
.GetLeftIndent() - 100)
258 attr
.SetFlags(rt
.TEXT_ATTR_LEFT_INDENT
)
259 self
.rtc
.SetStyle(r
, attr
)
262 def OnParagraphSpacingMore(self
, evt
):
263 attr
= rt
.RichTextAttr()
264 attr
.SetFlags(rt
.TEXT_ATTR_PARA_SPACING_AFTER
)
265 ip
= self
.rtc
.GetInsertionPoint()
266 if self
.rtc
.GetStyle(ip
, attr
):
267 r
= rt
.RichTextRange(ip
, ip
)
268 if self
.rtc
.HasSelection():
269 r
= self
.rtc
.GetSelectionRange()
271 attr
.SetParagraphSpacingAfter(attr
.GetParagraphSpacingAfter() + 20);
272 attr
.SetFlags(rt
.TEXT_ATTR_PARA_SPACING_AFTER
)
273 self
.rtc
.SetStyle(r
, attr
)
276 def OnParagraphSpacingLess(self
, evt
):
277 attr
= rt
.RichTextAttr()
278 attr
.SetFlags(rt
.TEXT_ATTR_PARA_SPACING_AFTER
)
279 ip
= self
.rtc
.GetInsertionPoint()
280 if self
.rtc
.GetStyle(ip
, attr
):
281 r
= rt
.RichTextRange(ip
, ip
)
282 if self
.rtc
.HasSelection():
283 r
= self
.rtc
.GetSelectionRange()
285 if attr
.GetParagraphSpacingAfter() >= 20:
286 attr
.SetParagraphSpacingAfter(attr
.GetParagraphSpacingAfter() - 20);
287 attr
.SetFlags(rt
.TEXT_ATTR_PARA_SPACING_AFTER
)
288 self
.rtc
.SetStyle(r
, attr
)
291 def OnLineSpacingSingle(self
, evt
):
292 attr
= rt
.RichTextAttr()
293 attr
.SetFlags(rt
.TEXT_ATTR_LINE_SPACING
)
294 ip
= self
.rtc
.GetInsertionPoint()
295 if self
.rtc
.GetStyle(ip
, attr
):
296 r
= rt
.RichTextRange(ip
, ip
)
297 if self
.rtc
.HasSelection():
298 r
= self
.rtc
.GetSelectionRange()
300 attr
.SetFlags(rt
.TEXT_ATTR_LINE_SPACING
)
301 attr
.SetLineSpacing(10)
302 self
.rtc
.SetStyle(r
, attr
)
305 def OnLineSpacingHalf(self
, evt
):
306 attr
= rt
.RichTextAttr()
307 attr
.SetFlags(rt
.TEXT_ATTR_LINE_SPACING
)
308 ip
= self
.rtc
.GetInsertionPoint()
309 if self
.rtc
.GetStyle(ip
, attr
):
310 r
= rt
.RichTextRange(ip
, ip
)
311 if self
.rtc
.HasSelection():
312 r
= self
.rtc
.GetSelectionRange()
314 attr
.SetFlags(rt
.TEXT_ATTR_LINE_SPACING
)
315 attr
.SetLineSpacing(15)
316 self
.rtc
.SetStyle(r
, attr
)
319 def OnLineSpacingDouble(self
, evt
):
320 attr
= rt
.RichTextAttr()
321 attr
.SetFlags(rt
.TEXT_ATTR_LINE_SPACING
)
322 ip
= self
.rtc
.GetInsertionPoint()
323 if self
.rtc
.GetStyle(ip
, attr
):
324 r
= rt
.RichTextRange(ip
, ip
)
325 if self
.rtc
.HasSelection():
326 r
= self
.rtc
.GetSelectionRange()
328 attr
.SetFlags(rt
.TEXT_ATTR_LINE_SPACING
)
329 attr
.SetLineSpacing(20)
330 self
.rtc
.SetStyle(r
, attr
)
333 def OnFont(self
, evt
):
334 if not self
.rtc
.HasSelection():
337 r
= self
.rtc
.GetSelectionRange()
338 fontData
= wx
.FontData()
339 fontData
.EnableEffects(False)
340 attr
= rt
.RichTextAttr()
341 attr
.SetFlags(rt
.TEXT_ATTR_FONT
)
342 if self
.rtc
.GetStyle(self
.rtc
.GetInsertionPoint(), attr
):
343 fontData
.SetInitialFont(attr
.CreateFont())
345 dlg
= wx
.FontDialog(self
, fontData
)
346 if dlg
.ShowModal() == wx
.ID_OK
:
347 fontData
= dlg
.GetFontData()
348 font
= fontData
.GetChosenFont()
350 attr
.SetFlags(rt
.TEXT_ATTR_FONT
)
352 self
.rtc
.SetStyle(r
, attr
)
356 def OnColour(self
, evt
):
357 colourData
= wx
.ColourData()
358 attr
= rt
.RichTextAttr()
359 attr
.SetFlags(rt
.TEXT_ATTR_TEXT_COLOUR
)
360 if self
.rtc
.GetStyle(self
.rtc
.GetInsertionPoint(), attr
):
361 colourData
.SetColour(attr
.GetTextColour())
363 dlg
= wx
.ColourDialog(self
, colourData
)
364 if dlg
.ShowModal() == wx
.ID_OK
:
365 colourData
= dlg
.GetColourData()
366 colour
= colourData
.GetColour()
368 if not self
.rtc
.HasSelection():
369 self
.rtc
.BeginTextColour(colour
)
371 r
= self
.rtc
.GetSelectionRange()
372 attr
.SetFlags(rt
.TEXT_ATTR_TEXT_COLOUR
)
373 attr
.SetTextColour(colour
)
374 self
.rtc
.SetStyle(r
, attr
)
379 def OnUpdateBold(self
, evt
):
380 evt
.Check(self
.rtc
.IsSelectionBold())
382 def OnUpdateItalic(self
, evt
):
383 evt
.Check(self
.rtc
.IsSelectionItalics())
385 def OnUpdateUnderline(self
, evt
):
386 evt
.Check(self
.rtc
.IsSelectionUnderlined())
388 def OnUpdateAlignLeft(self
, evt
):
389 evt
.Check(self
.rtc
.IsSelectionAligned(rt
.TEXT_ALIGNMENT_LEFT
))
391 def OnUpdateAlignCenter(self
, evt
):
392 evt
.Check(self
.rtc
.IsSelectionAligned(rt
.TEXT_ALIGNMENT_CENTRE
))
394 def OnUpdateAlignRight(self
, evt
):
395 evt
.Check(self
.rtc
.IsSelectionAligned(rt
.TEXT_ALIGNMENT_RIGHT
))
398 def ForwardEvent(self
, evt
):
399 # The RichTextCtrl can handle menu and update events for undo,
400 # redo, cut, copy, paste, delete, and select all, so just
401 # forward the event to it.
402 self
.rtc
.ProcessEvent(evt
)
405 def MakeMenuBar(self
):
406 def doBind(item
, handler
, updateUI
=None):
407 self
.Bind(wx
.EVT_MENU
, handler
, item
)
408 if updateUI
is not None:
409 self
.Bind(wx
.EVT_UPDATE_UI
, updateUI
, item
)
412 doBind( fileMenu
.Append(-1, "&Open\tCtrl+O", "Open a file"),
414 doBind( fileMenu
.Append(-1, "&Save\tCtrl+S", "Save a file"),
416 doBind( fileMenu
.Append(-1, "&Save As...\tF12", "Save to a new file"),
418 fileMenu
.AppendSeparator()
419 doBind( fileMenu
.Append(-1, "&View as HTML", "View HTML"),
421 fileMenu
.AppendSeparator()
422 doBind( fileMenu
.Append(-1, "E&xit\tCtrl+Q", "Quit this program"),
426 doBind( editMenu
.Append(wx
.ID_UNDO
, "&Undo\tCtrl+Z"),
427 self
.ForwardEvent
, self
.ForwardEvent
)
428 doBind( editMenu
.Append(wx
.ID_REDO
, "&Redo\tCtrl+Y"),
429 self
.ForwardEvent
, self
.ForwardEvent
)
430 editMenu
.AppendSeparator()
431 doBind( editMenu
.Append(wx
.ID_CUT
, "Cu&t\tCtrl+X"),
432 self
.ForwardEvent
, self
.ForwardEvent
)
433 doBind( editMenu
.Append(wx
.ID_COPY
, "&Copy\tCtrl+C"),
434 self
.ForwardEvent
, self
.ForwardEvent
)
435 doBind( editMenu
.Append(wx
.ID_PASTE
, "&Paste\tCtrl+V"),
436 self
.ForwardEvent
, self
.ForwardEvent
)
437 doBind( editMenu
.Append(wx
.ID_CLEAR
, "&Delete\tDel"),
438 self
.ForwardEvent
, self
.ForwardEvent
)
439 editMenu
.AppendSeparator()
440 doBind( editMenu
.Append(wx
.ID_SELECTALL
, "Select A&ll\tCtrl+A"),
441 self
.ForwardEvent
, self
.ForwardEvent
)
443 #doBind( editMenu.AppendSeparator(), )
444 #doBind( editMenu.Append(-1, "&Find...\tCtrl+F"), )
445 #doBind( editMenu.Append(-1, "&Replace...\tCtrl+R"), )
447 formatMenu
= wx
.Menu()
448 doBind( formatMenu
.AppendCheckItem(-1, "&Bold\tCtrl+B"),
449 self
.OnBold
, self
.OnUpdateBold
)
450 doBind( formatMenu
.AppendCheckItem(-1, "&Italic\tCtrl+I"),
451 self
.OnItalic
, self
.OnUpdateItalic
)
452 doBind( formatMenu
.AppendCheckItem(-1, "&Underline\tCtrl+U"),
453 self
.OnUnderline
, self
.OnUpdateUnderline
)
454 formatMenu
.AppendSeparator()
455 doBind( formatMenu
.AppendCheckItem(-1, "L&eft Align"),
456 self
.OnAlignLeft
, self
.OnUpdateAlignLeft
)
457 doBind( formatMenu
.AppendCheckItem(-1, "&Centre"),
458 self
.OnAlignCenter
, self
.OnUpdateAlignCenter
)
459 doBind( formatMenu
.AppendCheckItem(-1, "&Right Align"),
460 self
.OnAlignRight
, self
.OnUpdateAlignRight
)
461 formatMenu
.AppendSeparator()
462 doBind( formatMenu
.Append(-1, "Indent &More"), self
.OnIndentMore
)
463 doBind( formatMenu
.Append(-1, "Indent &Less"), self
.OnIndentLess
)
464 formatMenu
.AppendSeparator()
465 doBind( formatMenu
.Append(-1, "Increase Paragraph &Spacing"), self
.OnParagraphSpacingMore
)
466 doBind( formatMenu
.Append(-1, "Decrease &Paragraph Spacing"), self
.OnParagraphSpacingLess
)
467 formatMenu
.AppendSeparator()
468 doBind( formatMenu
.Append(-1, "Normal Line Spacing"), self
.OnLineSpacingSingle
)
469 doBind( formatMenu
.Append(-1, "1.5 Line Spacing"), self
.OnLineSpacingHalf
)
470 doBind( formatMenu
.Append(-1, "Double Line Spacing"), self
.OnLineSpacingDouble
)
471 formatMenu
.AppendSeparator()
472 doBind( formatMenu
.Append(-1, "&Font..."), self
.OnFont
)
475 mb
.Append(fileMenu
, "&File")
476 mb
.Append(editMenu
, "&Edit")
477 mb
.Append(formatMenu
, "F&ormat")
481 def MakeToolBar(self
):
482 def doBind(item
, handler
, updateUI
=None):
483 self
.Bind(wx
.EVT_TOOL
, handler
, item
)
484 if updateUI
is not None:
485 self
.Bind(wx
.EVT_UPDATE_UI
, updateUI
, item
)
487 tbar
= self
.CreateToolBar()
488 doBind( tbar
.AddTool(-1, images
.get_rt_openBitmap(),
489 shortHelpString
="Open"), self
.OnFileOpen
)
490 doBind( tbar
.AddTool(-1, images
.get_rt_saveBitmap(),
491 shortHelpString
="Save"), self
.OnFileSave
)
493 doBind( tbar
.AddTool(wx
.ID_CUT
, images
.get_rt_cutBitmap(),
494 shortHelpString
="Cut"), self
.ForwardEvent
, self
.ForwardEvent
)
495 doBind( tbar
.AddTool(wx
.ID_COPY
, images
.get_rt_copyBitmap(),
496 shortHelpString
="Copy"), self
.ForwardEvent
, self
.ForwardEvent
)
497 doBind( tbar
.AddTool(wx
.ID_PASTE
, images
.get_rt_pasteBitmap(),
498 shortHelpString
="Paste"), self
.ForwardEvent
, self
.ForwardEvent
)
500 doBind( tbar
.AddTool(wx
.ID_UNDO
, images
.get_rt_undoBitmap(),
501 shortHelpString
="Undo"), self
.ForwardEvent
, self
.ForwardEvent
)
502 doBind( tbar
.AddTool(wx
.ID_REDO
, images
.get_rt_redoBitmap(),
503 shortHelpString
="Redo"), self
.ForwardEvent
, self
.ForwardEvent
)
505 doBind( tbar
.AddTool(-1, images
.get_rt_boldBitmap(), isToggle
=True,
506 shortHelpString
="Bold"), self
.OnBold
, self
.OnUpdateBold
)
507 doBind( tbar
.AddTool(-1, images
.get_rt_italicBitmap(), isToggle
=True,
508 shortHelpString
="Italic"), self
.OnItalic
, self
.OnUpdateItalic
)
509 doBind( tbar
.AddTool(-1, images
.get_rt_underlineBitmap(), isToggle
=True,
510 shortHelpString
="Underline"), self
.OnUnderline
, self
.OnUpdateUnderline
)
512 doBind( tbar
.AddTool(-1, images
.get_rt_alignleftBitmap(), isToggle
=True,
513 shortHelpString
="Align Left"), self
.OnAlignLeft
, self
.OnUpdateAlignLeft
)
514 doBind( tbar
.AddTool(-1, images
.get_rt_centreBitmap(), isToggle
=True,
515 shortHelpString
="Center"), self
.OnAlignCenter
, self
.OnUpdateAlignCenter
)
516 doBind( tbar
.AddTool(-1, images
.get_rt_alignrightBitmap(), isToggle
=True,
517 shortHelpString
="Align Right"), self
.OnAlignRight
, self
.OnUpdateAlignRight
)
519 doBind( tbar
.AddTool(-1, images
.get_rt_indentlessBitmap(),
520 shortHelpString
="Indent Less"), self
.OnIndentLess
)
521 doBind( tbar
.AddTool(-1, images
.get_rt_indentmoreBitmap(),
522 shortHelpString
="Indent More"), self
.OnIndentMore
)
524 doBind( tbar
.AddTool(-1, images
.get_rt_fontBitmap(),
525 shortHelpString
="Font"), self
.OnFont
)
526 doBind( tbar
.AddTool(-1, images
.get_rt_colourBitmap(),
527 shortHelpString
="Font Colour"), self
.OnColour
)
533 #----------------------------------------------------------------------
535 class TestPanel(wx
.Panel
):
536 def __init__(self
, parent
, log
):
538 wx
.Panel
.__init
__(self
, parent
, -1)
540 b
= wx
.Button(self
, -1, "Show the RichTextCtrl sample", (50,50))
541 self
.Bind(wx
.EVT_BUTTON
, self
.OnButton
, b
)
544 def OnButton(self
, evt
):
545 win
= RichTextFrame(self
, -1, "wx.richtext.RichTextCtrl",
547 style
= wx
.DEFAULT_FRAME_STYLE
)
550 # give easy access to PyShell if it's running
554 #----------------------------------------------------------------------
556 def runTest(frame
, nb
, log
):
557 win
= TestPanel(nb
, log
)
560 #----------------------------------------------------------------------
564 overview
= """<html><body>
565 <h2><center>wx.richtext.RichTextCtrl</center></h2>
572 if __name__
== '__main__':
575 run
.main(['', os
.path
.basename(sys
.argv
[0])] + sys
.argv
[1:])