I want to set text with strike-through in RichTextCtrl
of wxPython
. But could not find any method like BeginStrikethrough
or SetStrikethrough
.
Is it possible to apply strike-through in RichTextCtrl
? How?
EDIT 1:
Font
with strike-through flag used with BeginFont
and EndFont
not giving strike-through effect
import wx
import wx.richtext as rt
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, 1, 'Testing strike-through')
rtc = rt.RichTextCtrl(self, -1)
rtc.WriteText("normal text")
rtc.Newline()
font = wx.FFont(12, wx.FONTFAMILY_DEFAULT, face='Tahoma', flags=wx.FONTFLAG_STRIKETHROUGH)
rtc.BeginFont(font)
rtc.WriteText("This is strike-through")
rtc.EndFont()
if __name__ == '__main__':
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
Output: