Editing NSBrowser Cells
Editing NSBrowser Cells
- Subject: Editing NSBrowser Cells
- From: Niko Matsakis <email@hidden>
- Date: Tue, 3 Jun 2003 14:16:01 -0400 (EDT)
Hi there,
I've got an NSBrowser that uses a custom class of mine for its
cells. The cell class isn't really important, it's basically a convenient
class that associates some data with the cell and initializes its text
value based on that data.
Now, as it turns out, this cell class represents an XML element and
thus the text value it creates looks something like this: "a id='10'",
i.e., the name of the element is 'a' and it has an attribute 'id' with
the value 10.
What I'd like to happen is that when I double-click on the cell, I want
to be able to edit the name of the element, but not the attributes.
I'm not sure how to make this work. I'm thinking that if I intercept
the double-click event in my application, I can then send a
editWithFrame:inView:editor:delegate:event: message to the cell, but
I have to create an awful lot of crap to do that.
Is this the right approach? Is there a simpler one?
If it is the right approach, where should I get each component? Here are my
thoughts:
1. frame ---> from the NSMatrix for the current column
2. view ---> the NSMatrix itself?
3. editor --> instantiate an NSText with the initial value of the element name
4. delegate > some class of mine, I suppose
5. event ---> not sure what this is or what to get one
thank you for any assistance!
niko
_______________________________________________
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.