Re: NSTableHeaderView and NSTableView problem...
Re: NSTableHeaderView and NSTableView problem...
- Subject: Re: NSTableHeaderView and NSTableView problem...
- From: Allan Dushan <email@hidden>
- Date: Fri, 9 Jan 2004 21:21:57 -0800
Joern,
That was the clue I needed.
What I ended up doing was the following:
NSTableHeaderView *currentTableHeaderView = [tableView headerView];
MyTableHeaderView *customTableHeaderView = [[MyTableHeaderView alloc]
init];
[customTableHeaderView setFrame:[currentTableHeaderView frame]];
[customTableHeaderView setBounds:[currentTableHeaderView bounds]];
[tableView setHeaderView:customTableHeaderView];
That solved the problem.
Thanks,
Allan
On Friday, January 9, 2004, at 08:38 PM, Jvrn Salewski wrote:
Hi,
Shouldn't you initialize your TableHeaderView subclass better with
- (id)initWithFrame:(NSRect)frameRect?
Something like:
MyTableHeaderView *customTableHeaderView;
NSRect headerFrame = [tableView frame];
customTableHeaderView = [[MyTableHeaderView alloc] initWithFrame:
headerFrame];
[tableView setHeaderView:customTableHeaderView];
Yours,
Joern Salewski
am 09.01.2004 19:06 Uhr schrieb Allan Dushan unter
email@hidden:
I am attempting to create a subclass of NSTableHeaderView so that I
can
override
+ (NSMenu*)defaultMenu;
- (NSMenu *)menuForEvent:(NSEvent *)theEvent;
so that I can provide a different contextual menu based on the column
header the mouse is over.
In Interface Builder I am using an NSTableView, and then in my code I
am using awakeFromNib to replace the current NSTableHeaderView with my
subclass of NSTableHeaderView. When I do this the table header does
not
appear, leaving me with white space above the table. The code I am
using is as follows:
MyTableHeaderView *customTableHeaderView = [[MyTableHeaderView alloc]
init];
[tableView setHeaderView:customTableHeaderView];
This seemed straight forward, but I must be missing other
initialization code that is required. Anyone know what else needs to
be
done?
Thanks,
Allan Dushan
email@hidden
_______________________________________________
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.
_______________________________________________
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.