]> git.saurik.com Git - wxWidgets.git/commitdiff
Wrap NSTableView in an NSScrollView and disable the header
authorDavid Elliott <dfe@tgwbd.org>
Tue, 19 Aug 2003 04:27:12 +0000 (04:27 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Tue, 19 Aug 2003 04:27:12 +0000 (04:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23008 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/cocoa/listbox.mm

index 384e24b6b4e4e81e0cb39cfea448fff1805a6aba..4d4cd0bf43e5066ad02f1e0d702be94a5e25019d 100644 (file)
@@ -50,6 +50,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID winid,
 
     SetNSTableView([[NSTableView alloc] initWithFrame: MakeDefaultNSRect(size)]);
     [m_cocoaNSView release];
+    [GetNSTableView() setHeaderView: nil];
 
     // Set up the data source
     m_cocoaDataSource = [[wxCocoaNSTableDataSource alloc] init];
@@ -58,11 +59,15 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID winid,
     // Add the single column
     NSTableColumn *tableColumn = [[NSTableColumn alloc] initWithIdentifier:nil];
     [GetNSTableView() addTableColumn: tableColumn];
-//    [tableColumn release];
+    [tableColumn release];
 
+    [GetNSTableView() sizeToFit];
     // Finish
     if(m_parent)
         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);
 
     return true;