Hi,
The program crashes when you type something in RichTextCtrl, if you disable the vertical scroll bar of RichTextCtrl and set the widget height to 28.
If you set the widget height to 30, however, it doesn’t crash.
Or, if you set the height to 28 and enable the vertical scroll bar, it doesn’t crash either.
I use Windows 10, python 3.11.4, wxpython 4.2.1.
What’s wrong here?
import wx
import wx.richtext as rt
class MyFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent, -1, "RichText")
self.panel = wx.Panel(self)
widget_height = 28
self.rt = rt.RichTextCtrl(self.panel, -1, size=(200, widget_height))
self.rt.EnableVerticalScrollbar(False)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.rt, 0, wx.ALIGN_CENTER | wx.ALL, 20)
self.panel.SetSizer(sizer)
sizer.Layout()
app = wx.App(0)
frame = MyFrame(None)
app.SetTopWindow(frame)
frame.Show()
app.MainLoop()