button in tableview header
button in tableview header
- Subject: button in tableview header
- From: Justin Lundy <email@hidden>
- Date: Fri, 18 Jul 2003 11:39:44 -0700
I'm trying to get a button (specifically a popUpButton) into the
headers of my tableView. I used IB to create the button's menu,
columnMenu, and created the button programatically using:
NSPopUpButtonCell *columnPopCell = [[[NSPopUpButtonCell alloc]
initTextCell:@"None" pullsDown:YES] autorelease];
[columnPopCell setMenu:columnMenu];
[columnPopCell setControlSize:NSSmallControlSize];
// then I clear out the old columns:
while([[myTable tableColumns] count] > 0) {
[myTable removeTableColumn:[[myTable tableColumns]
objectAtIndex:0]];
// then I add build the tableColumn, and repeatedly add it to the table
using:
for (i = 0; i <= tableWidth; i++) {
newColumn = [[NSTableColumn alloc] initWithIdentifier:
[NSString stringWithFormat:@"column%d", i]];
[newColumn setEditable:NO];
[[newColumn headerCell] setStringValue:[[columnMenu
itemAtIndex:0] title]];
[newColumn setHeaderCell:columnPopCell];
[myTable addTableColumn:newColumn];
[newColumn release];
}
From this, each column has a popUpButton as the header, but the two
following problems occur:
1) The height of the tableHeader is smaller than the popUpButton, which
gets clipped. So, how do I make the tableHeader taller?
2) I cannot click the button. Any suggestions?
- Justin
----
"Never give up, Never surrender."
- Capt. Peter Quincy Taggart
----
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.