diff --git a/src/osx/checklst_osx.cpp b/src/osx/checklst_osx.cpp index 134e778338..0807cc7fd5 100644 --- a/src/osx/checklst_osx.cpp +++ b/src/osx/checklst_osx.cpp @@ -63,7 +63,7 @@ bool wxCheckListBox::Create( if ( !wxCheckListBoxBase::Create( parent, id, pos, size, n, choices, style & ~(wxHSCROLL | wxVSCROLL), validator, name ) ) return false; - int colwidth = 30; + int colwidth = 18; // TODO adapt the width according to the window variant m_checkColumn = GetListPeer()->InsertCheckColumn(0, wxEmptyString, true, wxALIGN_CENTER, colwidth); diff --git a/src/osx/cocoa/listbox.mm b/src/osx/cocoa/listbox.mm index 216142b026..f2e97a33da 100644 --- a/src/osx/cocoa/listbox.mm +++ b/src/osx/cocoa/listbox.mm @@ -473,7 +473,9 @@ wxListWidgetColumn* wxListWidgetCocoaImpl::InsertCheckColumn( unsigned pos , con void wxListWidgetCocoaImpl::AdaptColumnWidth ( int w ) { - NSTableColumn *col = [[m_tableView tableColumns] objectAtIndex:0]; + // Note that the table can have more than one column as it's also used by + // wxCheckListBox, but the column containing the text is always the last one. + NSTableColumn *col = [[m_tableView tableColumns] lastObject]; [col setWidth:w]; m_maxWidth = w; } @@ -488,7 +490,7 @@ void wxListWidgetCocoaImpl::ListInsert( unsigned int n ) if ( m_autoSize ) { - NSCell *cell = [m_tableView preparedCellAtColumn:0 row:n]; + NSCell *cell = [m_tableView preparedCellAtColumn:[m_tableView numberOfColumns]-1 row:n]; NSSize size = [cell cellSize]; int width = (int) ceil(size.width); @@ -648,6 +650,7 @@ wxWidgetImplType* wxWidgetImpl::CreateListBox( wxWindowMac* wxpeer, wxNSTableView* tableview = [[wxNSTableView alloc] init]; [tableview setDelegate:tableview]; + [tableview setFocusRingType:NSFocusRingTypeNone]; // only one multi-select mode available if ( (style & wxLB_EXTENDED) || (style & wxLB_MULTIPLE) ) [tableview setAllowsMultipleSelection:YES];