Opened 11 years ago

Closed 17 months ago

#11321 closed defect (outdated)

No horizontal scrollbar in wxTextCtrl on Mac

Reported by: rex666 Owned by:
Priority: normal Milestone:
Component: wxOSX Version: 3.1.1
Keywords: Cc: thouis@…
Blocked By: Blocking:
Patch: no


Using wxWidgets 2.8.10 on Windows and Mac, I cannot get a horizontal scroll bar to appear on a multi-line text control on Mac. It works correctly on Windows. Here is a sample project to recreate the issue:

#include "wx/wx.h"

class MyFrame : public wxFrame
        MyFrame() : wxFrame(NULL, wxID_ANY,  wxT("Hello wxWidgets"), wxPoint(50,50), wxSize(800,600))
            wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
            wxTextCtrl* m_Output = new wxTextCtrl( this, wxID_ANY, wxT("Some very very very long text goes here\nAnother very very long line below too\nAnother very very long line below too\nAnother very very long line below too\nAnother very very long line below too"),
                                                  wxDefaultPosition, wxDefaultSize, wxHSCROLL | wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP | wxTE_RICH );
            sizer->Add(m_Output, 1, wxEXPAND | wxALL, 100);

class MyApp: public wxApp
        wxFrame *frame;
        bool MyApp::OnInit()
            frame = new MyFrame();
            return true;


It works the same with wxHSCROLL and wxTE_DONTWRAP.

On OS-X, the space for the scroll bar is there, but the scroll bar itself never shows up. If I remove the wxTE_DONTWRAP style, it will wrap long lines to the control width, and adjust if I resize the control. With the wxTE_DONTWRAP, it doesn't wrap the text, and I can scroll manually by drag selecting with the mouse. But I never see the horizontal scrollbar or the arrow buttons to move it.

This happens on both Intel and PPC macs, running OS-X 10.5

Change History (5)

comment:1 Changed 11 years ago by thouis.jones

  • Cc thouis@… added

comment:2 Changed 7 years ago by andreas.pflug

  • Version changed from 2.8.10 to 3.0.0

This bug is still present in 3.0

Easily reproduced also in xrced with textbox style wxTE_PROCESS_ENTER|wxTE_MULTILINE|wxHSCROLL|wxTE_DONTWRAP

comment:3 Changed 7 years ago by rocrail

  • Status changed from new to confirmed

I can confirm this bug with wx3.0 and OS X Mavericks.

comment:4 Changed 3 years ago by oneeyeman

  • Component changed from old wxOSX/Carbon port to wxOSX
  • Version changed from 3.0.0 to 3.1.1

This bug is still present in Cocoa pre 3.1.1.

comment:5 Changed 17 months ago by oneeyeman

  • Resolution set to outdated
  • Status changed from confirmed to closed

The bug is no longer present in the current Git master.

Tested on OSX 10.13 with the minimal SDK set to 10.9.

Ticket can be closed.

Please re-open if you can reproduce it with the recent wx version.

Note: See TracTickets for help on using tickets.