Wrap NSTableView in an NSScrollView and disable the header

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23008 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Elliott
2003-08-19 04:27:12 +00:00
parent 8ea5801e9e
commit 4a3dcf1de1

View File

@@ -50,6 +50,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID winid,
SetNSTableView([[NSTableView alloc] initWithFrame: MakeDefaultNSRect(size)]); SetNSTableView([[NSTableView alloc] initWithFrame: MakeDefaultNSRect(size)]);
[m_cocoaNSView release]; [m_cocoaNSView release];
[GetNSTableView() setHeaderView: nil];
// Set up the data source // Set up the data source
m_cocoaDataSource = [[wxCocoaNSTableDataSource alloc] init]; m_cocoaDataSource = [[wxCocoaNSTableDataSource alloc] init];
@@ -58,11 +59,15 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID winid,
// Add the single column // Add the single column
NSTableColumn *tableColumn = [[NSTableColumn alloc] initWithIdentifier:nil]; NSTableColumn *tableColumn = [[NSTableColumn alloc] initWithIdentifier:nil];
[GetNSTableView() addTableColumn: tableColumn]; [GetNSTableView() addTableColumn: tableColumn];
// [tableColumn release]; [tableColumn release];
[GetNSTableView() sizeToFit];
// Finish // Finish
if(m_parent) if(m_parent)
m_parent->CocoaAddChild(this); m_parent->CocoaAddChild(this);
// NSTableView does WEIRD things with sizes. Wrapping it in an
// NSScrollView seems to be the only reasonable solution.
CocoaCreateNSScrollView();
SetInitialFrameRect(pos,size); SetInitialFrameRect(pos,size);
return true; return true;