I use Windows 10, python 3.11.4, wxpython 4.2.1.
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.
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()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
What is the stack trace at the time of the crash?
Can you reproduce it in the C++ (richtext) sample?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@oneeyeman1 I'm sorry but I don't know how to code in C++.
If you know how to code in C++, just:
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Can be reproduced with the following patch to the richtext sample. Click on the text, then press Ctrl-End.
diff --git a/samples/richtext/richtext.cpp b/samples/richtext/richtext.cpp index 5b53ee47c6..82a411c651 100644 --- a/samples/richtext/richtext.cpp +++ b/samples/richtext/richtext.cpp @@ -929,6 +929,7 @@ MyFrame::MyFrame(const wxString& title, wxWindowID id, const wxPoint& pos, sizer->Add(splitter, 1, wxEXPAND); m_richTextCtrl = new MyRichTextCtrl(splitter, ID_RICHTEXT_CTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxVSCROLL|wxHSCROLL/*|wxWANTS_CHARS*/); + m_richTextCtrl->EnableVerticalScrollbar(false); wxASSERT(!m_richTextCtrl->GetBuffer().GetAttributes().HasFontPixelSize()); wxFont font(wxFontInfo(12).Family(wxFONTFAMILY_ROMAN));
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Closed #23763 as completed.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()