Re: Custom NSCell and Bindings

2011-06-28 Thread Gustavo Pizano
Hello Carter. Right now I can't remember the name of the example. Its a little tricky but its do-able. your MO subclass must do something like: -(NSDictionary *)userDictionary{ return [self dictionaryWithValuesForKeys:[NSArray arrayWithObjects:@"firstName",@"lastName",@

Re: Custom NSCell and Bindings

2011-06-28 Thread Sean McBride
On Fri, 24 Jun 2011 09:33:38 -0400, Carter R. Harrison said: >It's a pretty typical situation. I've got my model objects stored in an >NSSet. An NSArrayController that is bound to the NSSet. And then an >NSTableView with one NSTableColumn bound to the arrangedObjects.name >property of the NSArr

Re: Custom NSCell and target/action

2010-11-20 Thread vincent habchi
Oops. Sorry for the few missing -s here and there and the last sentence that should read "so it should not be too intricate". Cheers Vincent___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

Re: Custom NSCell and target/action

2010-11-20 Thread vincent habchi
Hi Sean! > Do I remember correctly that you're trying to make a cell version of > NSColorWell, so that you can use it in a table? Yes, this (screenshot from my app) : <> > I tried that a few months ago, and got something basically working (with > Corbin's help), but never did get it working ve

Re: Custom NSCell and target/action

2010-11-20 Thread Sean McBride
vincent habchi (vi...@macports.org) on 2010-11-20 03:51 said: >> http://developer.apple.com/library/mac/#samplecode/AnimatedTableView/ >Introduction/Intro.html >> >> It will answer a lot of questions. > >I've done that. It is a nice example, but I think it is meant to people >that have already ti

Re: Custom NSCell and target/action

2010-11-20 Thread vincent habchi
Corbin: > You should just check out the example: > > http://developer.apple.com/library/mac/#samplecode/AnimatedTableView/Introduction/Intro.html > > It will answer a lot of questions. I've done that. It is a nice example, but I think it is meant to people that have already tinkered a bit with

Re: Custom NSCell and target/action

2010-11-19 Thread Corbin Dunn
On Nov 19, 2010, at 7:09 AM, Vincent Habchi wrote: > Le 19 nov. 2010 à 15:39, Graham Cox a écrit : > >> 1. Playing nice with the color panel requires a little care, because it's >> shared by not only any color wells in your app, but by any responders that >> implement -changeColor: > > You're

Re: Custom NSCell and target/action

2010-11-19 Thread Vincent Habchi
Le 19 nov. 2010 à 15:39, Graham Cox a écrit : > 1. Playing nice with the color panel requires a little care, because it's > shared by not only any color wells in your app, but by any responders that > implement -changeColor: You're right, I'll try to be cautious. > 2. A table column only has o

Re: Custom NSCell and target/action

2010-11-19 Thread Graham Cox
On 20/11/2010, at 1:17 AM, Vincent Habchi wrote: > Hi there, > > I'm beginning to figure out something but I'd like to have some (even terse) > comments. > > I have created a custom subclass of NSCell that duplicates the behavior of a > NSColorWell: It draws a small colored rectangle inside o

Re: Custom NSCell mouse events

2010-06-15 Thread Michael Hanna
Thanks for the suggestion Corbin. It looks like I'm doing everything OK with creation and destruction though. Here is my code: - (id)init { if ((self = [super init])) { _checkboxCell = [[NSButtonCell alloc] init]; [_checkboxCell setButtonType:NSSwitchButton]; [_checkbox

Re: Custom NSCell mouse events

2010-06-14 Thread Corbin Dunn
On Jun 10, 2010, at 9:43 AM, Michael Hanna wrote: > OK I'm really stumped on this one. I want to make a checkbox with a > NSTextFieldCell combined together. It's important that the checkbox > goes ON if the mouse hits the box, NOT the text. I've accomplished > this, more or less, but the issue is

Re: Custom NSCell

2010-03-02 Thread Gustavo Pizano
happy to help. On Mar 2, 2010, at 9:26 AM, Tilo Villwock wrote: > Finally! That did the trick, thanks a lot! Does make sense though, the > coordinates I used originally of course refer to the NSView insets and not to > the ones from each NSCell, which is why all Strings were in same place. >

Re: Custom NSCell

2010-03-02 Thread Gustavo Pizano
Sean hello. Im not expert in this, but I had the same problem when making my own NSCell subclass to display a name and a picture next to it.. So in your NSCell subclass in the method - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView print(draw) your items in the cellFrame y p

Re: Custom NSCell

2010-03-02 Thread Tilo Villwock
Finally! That did the trick, thanks a lot! Does make sense though, the coordinates I used originally of course refer to the NSView insets and not to the ones from each NSCell, which is why all Strings were in same place. Thanks again. Tilo Am 02.03.2010 um 08:56 schrieb Gustavo Pizano: > Sean

Re: Custom NSCell

2010-03-01 Thread Sean McBride
On 3/1/10 8:45 PM, Tilo Villwock said: >In applicationDidFinishLaunching: I created an instance of my custom >NSCell class and put it in place for the right column. Could you elaborate? I have found that I needed to set the custom cell in IB. You can drag a custom cell from the library to the t

Re: Custom NSCell

2010-03-01 Thread Tilo Villwock
Well, since I'm subclassing NSCell and only override the method drawInteriorWithFrame: why is there a need to override copyWithZone: as well? I don't store any data within the Class. Am 01.03.2010 um 20:59 schrieb Nick Zitzmann: > > On Mar 1, 2010, at 12:45 PM, Tilo Villwock wrote: > >> I've

Re: Custom NSCell

2010-03-01 Thread Nick Zitzmann
On Mar 1, 2010, at 12:45 PM, Tilo Villwock wrote: > I've created a custom NSCell Object to layout some different text attributes > of a custom data object in a NSTableView, but for some reason all the > attributes of the different data objects are only displayed in the first row > and nothing

Re: Custom NSCell issues

2009-03-26 Thread Benjamin Stiglitz
> hello I'm using a custom NSCell in order to draw some elements in an > NSTableView. I've created a simple tableview with 2 row. However my > draws is always put on first row while the second one is empty. > This my code for NSOutlineView delegate http://pastebin.com/m7f5f8a0f > while this is for

Re: Custom NSCell issues

2009-03-25 Thread Corbin Dunn
On Mar 25, 2009, at 2:47 PM, malcom wrote: hello I'm using a custom NSCell in order to draw some elements in an NSTableView. I've created a simple tableview with 2 row. However my draws is always put on first row while the second one is empty. This my code for NSOutlineView delegate http://past