]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't crash if no scrollbar
authorJulian Smart <julian@anthemion.co.uk>
Tue, 3 Mar 2009 13:12:52 +0000 (13:12 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 3 Mar 2009 13:12:52 +0000 (13:12 +0000)
Force wxVSCROLL in wxRTC

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59295 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/scrolwin.cpp
src/richtext/richtextctrl.cpp

index e93f017032be5e2526b4f8c74718937ef2447bf1..245ecc72006358f0639b314cdaa45a610c521319 100644 (file)
@@ -44,6 +44,9 @@ void wxScrollHelper::DoAdjustScrollbar(GtkRange* range,
                                        int *lines,
                                        int *linesPerPage)
 {
+    if (!range)
+        return;
+
     int upper;
     int page_size;
     if (pixelsPerLine > 0 && winSize > 0 && winSize < virtSize)
index 68fd792f2c4f7e12b088355654aa702a487698b5..f3b1d697f33f2be7262d90d714641b38da91697a 100644 (file)
@@ -196,6 +196,8 @@ wxRichTextCtrl::wxRichTextCtrl(wxWindow* parent,
 bool wxRichTextCtrl::Create( wxWindow* parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style,
                              const wxValidator& validator, const wxString& name)
 {
+    style |= wxVSCROLL;
+
     if (!wxTextCtrlBase::Create(parent, id, pos, size,
                            style|wxFULL_REPAINT_ON_RESIZE,
                            validator, name))