Re: Editable NSBrowser (Still Broken)
Re: Editable NSBrowser (Still Broken)
- Subject: Re: Editable NSBrowser (Still Broken)
- From: Evan Cooke <email@hidden>
- Date: Wed, 19 Jun 2002 17:37:43 -0700
Quick summary so far: I am trying to create an Editable NSBrowser that
allows navigation with a single click and editing with a double click.
Per Brian's instructions in his reply I used editWithFrame: but the edit
field does not appear when I double click it. I tried changing the
color and appearance of the fieldEditor to see if it was the same color
as the background but no good. Here is my code:
- (IBAction)browserDoubleClick:(id)sender
{
NSCell *selectedCell;
NSRect cellFrame;
NSMatrix *theMatrix;
int selectedRow, selectedColumn;
NSText *fieldEditor;
selectedCell = [myBrowser selectedCell];
selectedColumn = [myBrowser selectedColumn];
selectedRow = [myBrowser selectedRowInColumn:selectedColumn];
theMatrix = [myBrowser matrixInColumn:selectedColumn];
//that matrix only has one column so we pass it 0
cellFrame = [theMatrix cellFrameAtRow:selectedRow column:0];
fieldEditor = [[myBrowser window] fieldEditor:YES
forObject:selectedCell];
[selectedCell editWithFrame:cellFrame
inView:theMatrix
editor:fieldEditor
delegate:self
event:nil];
NSLog(@"double click happened");
}
Any help getting editing working is very much appreciated.
Evan
_______________________________________________
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.