wxDataViewCtrl on macOS defaults to no border, doesn't draw correct border style (Issue #25560)

44 views
Skip to first unread message

Will Cosgrove

unread,
Jun 23, 2025, 5:42:51 PMJun 23
to wx-...@googlegroups.com, Subscribed
willco007 created an issue (wxWidgets/wxWidgets#25560)

Description

Bug description:

wxDataViewCtrl on macOS doesn't draw a border by default. That is opposite of Win/GTK3 which does draw a border by default. Furthermore, if you pass in wxBORDER_DEFAULT it doesn't draw the correct native control border as expected.

Expected vs observed behaviour:

Expect border to draw by default and be the native style. Observed no border is drawn.

Patch or snippet allowing to reproduce the problem:

The bug stems from (this line)[https://github.com/wxWidgets/wxWidgets/blob/23762d0c65b7cd013e4cf8b87869c882ac5a8d97/src/osx/cocoa/dataview.mm#L1989]. It should be looking at the style value coming in and turning on the scrollview border.

Furthermore, if you set wxBORDER_DEFAULT as the border it should turn on the border of the scrollview, not draw a custom border that isn't native which it is currently doing.

To Reproduce:

Create a data view like so:
tree_view = new wxDataViewCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize);

Platform and version information

  • wxWidgets version you use: 3.2.7
  • wxWidgets port you use: wxMacOS
  • OS and its version: macOS 15.5


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25560@github.com>

VZ

unread,
Jun 24, 2025, 11:15:26 AMJun 24
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25560)

I have no idea why do we always disable the border here, apparently it has been done like this in the initial version of the code in e86edab (Add wxDataViewCtrl implementation for OSX/Cocoa (closes #10617: wxDataView for wxOSX-Cocoa), 2009-05-08).

Should we just remove the line calling setBorderType:? Does it look fine if you do it?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25560/3000915302@github.com>

Will Cosgrove

unread,
Jun 24, 2025, 12:14:44 PMJun 24
to wx-...@googlegroups.com, Subscribed
willco007 left a comment (wxWidgets/wxWidgets#25560)

If you remove setBorderType: no border is drawn. At the minimum to draw the native border you need [scrollview setBorderType:NSBezelBorder].

However, that will then interfere with non-native border drawing of wxWindow. It seems additional logic needs to be added to the border drawing of this control to handle the native border drawing.

Something like:

  1. if style is wxBORDER_THEME or wxBORDER_DEFAULT use the scrollview border.
  2. if style is wxBORDER_NONE turn off the scrollview border.
  3. if style is anything else, let wxWindow handle the drawing of the non-native borders.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25560/3001104711@github.com>

VZ

unread,
Jun 24, 2025, 12:46:45 PMJun 24
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25560)

If you can make a PR implementing the working version, it would be great. TIA!


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25560/3001184778@github.com>

Will Cosgrove

unread,
Jun 24, 2025, 11:36:14 PMJun 24
to wx-...@googlegroups.com, Subscribed
willco007 left a comment (wxWidgets/wxWidgets#25560)

Sure thing, wxWidgetImpl::CreateListBox also has the same problem of missing borders I'll try and fix in the same way.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25560/3002833983@github.com>

Will Cosgrove

unread,
Jun 25, 2025, 2:11:08 PMJun 25
to wx-...@googlegroups.com, Subscribed
willco007 left a comment (wxWidgets/wxWidgets#25560)

I just noticed, wxListbox::Create() in listbox_osx.cpp is overriding the border property and making it sunken for whatever reason, any ideas why that would be? Seems like that should be removed; I'll remove it in my MR.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25560/3005705008@github.com>

Stefan Csomor

unread,
Jun 25, 2025, 3:42:19 PMJun 25
to wx-...@googlegroups.com, Subscribed
csomor left a comment (wxWidgets/wxWidgets#25560)

I just noticed, wxListbox::Create() in listbox_osx.cpp is overriding the border property and making it sunken for whatever reason, any ideas why that would be? Seems like that should be removed; I'll remove it in my MR.

Julian wrote this 69fa3d2 , I don't recall any specifics, perhaps it should rather be modified to set a reasonable type if wxBORDER_DEFAULT (=0) is passed in


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25560/3005935532@github.com>

Will Cosgrove

unread,
Jun 25, 2025, 4:16:08 PMJun 25
to wx-...@googlegroups.com, Subscribed
willco007 left a comment (wxWidgets/wxWidgets#25560)

Julian wrote this 69fa3d2 , I don't recall any specifics, perhaps it should rather be modified to set a reasonable type if wxBORDER_DEFAULT (=0) is passed in

With my MR both wxBORDER_DEFAULT and wxBORDER_THEME types now both use the native scrollview border which is what I would expect by default. IMHO there isn't really a need to change it to a different border style if the default is set (?). I suspect 69fa3d2 was done before Cocoa where the list view didn't have a border.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25560/3006019825@github.com>

VZ

unread,
Jun 28, 2025, 9:09:10 PMJun 28
to wx-...@googlegroups.com, Subscribed

Closed #25560 as completed via 0bf7212.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/25560/issue_event/18372034790@github.com>

Reply all
Reply to author
Forward
0 new messages