Custom NSCell and Binding to a relationship property?

2011-12-09 Thread Rick Mann
Hi I'm implementing a UI in which each row in a table corresponds to an object in an animation. Each animated object has a list of events. I want to implement a custom NSCell to display those events as a horizontal bar extending to the right in a column in the table view. Here's a

Re: Custom NSCell and Bindings

2011-06-28 Thread Gustavo Pizano
o On Jun 28, 2011, at 10:11 PM, Sean McBride wrote: > 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

Re: Custom NSCell and Bindings

2011-06-28 Thread Sean McBride
me >property of the NSArrayController. It works great. Now I've introduced >a custom NSCell object into the NSTableView. The custom cell displays a >title, a subtitle, and a status image - all of which I want to be able >to bind to 3 separate properties of the model object. How do I

Custom NSCell and Bindings

2011-06-24 Thread Carter R. Harrison
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 NSArrayController. It works great. Now I've intr

Re: NSColorWell inside a custom NSCell

2011-04-25 Thread Graham Cox
On 24/04/2011, at 6:01 AM, Ken Ferry wrote: > That works, but if the stock NSColorWell drawing and behavior is already what > you want, you can use normal NSColorWell objects as subviews. Your uber view > might be in charge of positioning them. > > But definitely, if you don't need to put thi

Re: NSColorWell inside a custom NSCell

2011-04-23 Thread Ken Ferry
On Thu, Apr 21, 2011 at 5:52 PM, Graham Cox wrote: > > On 21/04/2011, at 4:17 PM, Bryan Hansen wrote: > > > Am I on the right track with this? Is there a better way to get a bunch > of movable colorwells within a custom control? > > > I'd say no, you're not on the right track and yes, there's a b

Re: NSColorWell inside a custom NSCell

2011-04-21 Thread Graham Cox
On 21/04/2011, at 4:17 PM, Bryan Hansen wrote: > Am I on the right track with this? Is there a better way to get a bunch of > movable colorwells within a custom control? I'd say no, you're not on the right track and yes, there's a better way. What you're attempting is probably doable, but the

NSColorWell inside a custom NSCell

2011-04-21 Thread Bryan Hansen
I'm trying to develop a gradient control using multiple custom NSCells to control the gradient color locations. I'd like to have an NSColorWell contained within each cell. I have the interactions working correctly as they are all handled by the cell itself but can not seem to get the color wells

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

Custom NSCell and target/action

2010-11-19 Thread Vincent Habchi
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 of its frame, and responds to a click by opening the shared color

Re: Using Field Editor correctly in custom NSCell

2010-06-23 Thread Alastair Houghton
On 23 Jun 2010, at 02:56, Graham Cox wrote: > For example, it seems that the cell should override > -setUpFieldEditorAttributes: but what should this method actually do? In the > cell code I have, this method has been commented out, and the field editor > "set up" is being done in -editWithFram

Using Field Editor correctly in custom NSCell

2010-06-22 Thread Graham Cox
I have a custom cell that displays a text label, which can be edited. The code for this custom cell is something I found on the net already written - I'll protect the guilty by not saying whose it is, but the text editing part doesn't work correctly, so I need to fix it. What happens is that the

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

Custom NSCell mouse events

2010-06-10 Thread Michael Hanna
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 receiving the mouse event because I click one checkbox in a

Re: Custom NSCell

2010-03-02 Thread Gustavo Pizano
lement >> NSCopying, as if you have an ivar, like anNSString, then you must implement >> NSCopying because table uses copies of the cell, >> >> On Mar 2, 2010, at 1:09 AM, Sean McBride wrote: >> >>> On 3/1/10 8:45 PM, Tilo Villwock said: >>> &

Re: Custom NSCell

2010-03-02 Thread Gustavo Pizano
NSCopying, as if you have an ivar, like anNSString, then you must implement NSCopying because table uses copies of the cell, On Mar 2, 2010, at 1:09 AM, Sean McBride wrote: > On 3/1/10 8:45 PM, Tilo Villwock said: > >> In applicationDidFinishLaunching: I created an instance of my cust

Re: Custom NSCell

2010-03-02 Thread Tilo Villwock
>> 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 se

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

Re: Custom NSCell

2010-03-01 Thread Tilo Villwock
rote: > >> 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 at all

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

Custom NSCell

2010-03-01 Thread Tilo Villwock
Hi, 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 at all in the other rows. Every row recei

Re: “EXC_BAD_ACCESS” on Custom TableV iew with custom NSCell when clicking.

2010-02-18 Thread Corbin Dunn
On Feb 18, 2010, at 9:17 AM, Gustavo Pizano wrote: > HEllo Corbin, > It seem its fixed, I didn't realize an ivar in the Custom NSCell, I forgot I > put it there thinking in using it to hold the name of the user and be able to > sort the table, which right now I can;t tell how

Re: “EXC_BAD_ACCESS” on Custom TableV iew with custom NSCell when clicking.

2010-02-18 Thread Gustavo Pizano
HEllo Corbin, It seem its fixed, I didn't realize an ivar in the Custom NSCell, I forgot I put it there thinking in using it to hold the name of the user and be able to sort the table, which right now I can;t tell how to do it, I took out that ivar, and it hasn't crash so far.. stil

Re: “EXC_BAD_ACCESS” on Custom TableV iew with custom NSCell when clicking.

2010-02-18 Thread Corbin Dunn
;> If you have an object iVar which shouldn’t be copied, but is still an >>>> owned reference, then you can (and must) retain it instead in the copy. >>>> >>>> (You should do this for all cells with iVars, not just ones with object >>>> iVars, so

Re: “EXC_BAD_ACCESS” on Custom TableV iew with custom NSCell when clicking.

2010-02-18 Thread Gustavo Pizano
bject.) >>> >>> - Jim >> >> Hello Jim >> HMM digging more into the problem.. definitely it seems because Im not >> copying properly the NSManagedObject Paul Robinson says in one old post: >> >> "The short answer is that you need to

Re: “EXC_BAD_ACCESS” on Custom TableV iew with custom NSCell when clicking.

2010-02-17 Thread Gustavo Pizano
ing properly the NSManagedObject Paul Robinson says in one old post: > > "The short answer is that you need to override the setObjectValue: method > (which tries to copy your uncopyable NSManagedObject) in your custom NSCell > to convert your NSManagedObject into an NSValue (which i

Re: “EXC_BAD_ACCESS” on Custom TableV iew with custom NSCell when clicking.

2010-02-17 Thread Ken Ferry
gt; NSCell doesn’t implement its behavior using NSCopyObject.) > > > > - Jim > > Hello Jim > HMM digging more into the problem.. definitely it seems because Im not > copying properly the NSManagedObject Paul Robinson says in one old post: > > "The short answer is

Re: “EXC_BAD_ACCESS” on Custom TableV iew with custom NSCell when clicking.

2010-02-17 Thread Corbin Dunn
n the future even if >> NSCell doesn’t implement its behavior using NSCopyObject.) >> >> - Jim > > Hello Jim > HMM digging more into the problem.. definitely it seems because Im not > copying properly the NSManagedObject Paul Robinson says in one old post: > >

Re: “EXC_BAD_ACCESS” on Custom TableV iew with custom NSCell when clicking.

2010-02-17 Thread Gustavo Pizano
e into the problem.. definitely it seems because Im not copying properly the NSManagedObject Paul Robinson says in one old post: "The short answer is that you need to override the setObjectValue: method (which tries to copy your uncopyable NSManagedObject) in your custom NSCell to convert you

Re: “EXC_BAD_ACCESS” on Custom TableV iew with custom NSCell when clicking.

2010-02-17 Thread Jim Correia
On Feb 17, 2010, at 4:41 PM, Gustavo Pizano wrote: > Maybe I misunderstood I must conform NSCopying protocol also even when using > core data? If you have an NSCell subclass which adds iVars, you must implement -copyWithZone: to do correct memory management. Your -copyWithZone: needs to work

Re: “EXC_BAD_ACCESS” on Custom TableV iew with custom NSCell when clicking.

2010-02-17 Thread Gustavo Pizano
m-cells-and-core-data/. >> >> So Im guessing that somehow when setting the selectedIndex in the the >> NSArrayController Im messing up with the insights of it and then suddenly it >> will blow up if I keep left clicking the user list changing selections. >> >

Re: “EXC_BAD_ACCESS” on Custom TableV iew with custom NSCell when clicking.

2010-02-17 Thread Corbin Dunn
somehow when setting the selectedIndex in the the > NSArrayController Im messing up with the insights of it and then suddenly it > will blow up if I keep left clicking the user list changing selections. > > Or I have something wrong in the approach I took to display the fields in the

“EXC_BAD_ACCESS” on Custom TableView wi th custom NSCell when clicking.

2010-02-17 Thread Gustavo Pizano
omething wrong in the approach I took to display the fields in the custom NSCell. I tried to blow the app up by just left-clicking and it happens also but not so immediately as when I right click an item in the list, which tells me that definitely there is something wrong in the approach to display

Re: pulldown in custom NSCell

2009-08-31 Thread Georg Seifert
Hi corbin and Andreas, Both approaches look promising. I will play with them. Thanks Georg What I found is that the Cell, in its drawwithFrame method, adds subview to the TableView and this subview handles all the drawing and handling. Is this appropriate or is there a better solution.

Re: pulldown in custom NSCell

2009-08-28 Thread Andreas Mayer
Am 21.08.2009 um 12:48 Uhr schrieb Georg Seifert: What I found is that the Cell, in its drawwithFrame method, adds subview to the TableView and this subview handles all the drawing and handling. Is this appropriate or is there a better solution. In case you don't need a fully fledged Table

Re: pulldown in custom NSCell

2009-08-28 Thread Corbin Dunn
On Aug 21, 2009, at 7:16 AM, Corbin Dunn wrote: On Aug 21, 2009, at 3:48 AM, Georg Seifert wrote: Hi, I want to build a custom cell similar to the one in "Transfer" list in Cyberduck. I need several pulldowns and input fields. I did looked at the code of Cyberduck but as it is written i

Re: pulldown in custom NSCell

2009-08-21 Thread Corbin Dunn
On Aug 21, 2009, at 3:48 AM, Georg Seifert wrote: Hi, I want to build a custom cell similar to the one in "Transfer" list in Cyberduck. I need several pulldowns and input fields. I did looked at the code of Cyberduck but as it is written in Java I did not understand it completely. What I

pulldown in custom NSCell

2009-08-21 Thread Georg Seifert
Hi, I want to build a custom cell similar to the one in "Transfer" list in Cyberduck. I need several pulldowns and input fields. I did looked at the code of Cyberduck but as it is written in Java I did not understand it completely. What I found is that the Cell, in its drawwithFrame metho

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/m7f5f8a

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 del

Custom NSCell issues

2009-03-25 Thread malcom
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: Binding to custom NSCell [Solved]

2009-02-13 Thread Corbin Dunn
On Feb 12, 2009, at 8:53 PM, Ken Tozier wrote: After looking at NSActionCell, I noticed the "setControlView" method and this seems to be the missing link. NSActionCell sets it's control view while NSCell does not. When I manually set the control view for my custom cell to the table that co

Re: Binding to custom NSCell [Solved]

2009-02-12 Thread Ken Tozier
uper] to do the real drawing work. [column bind: @"value" toObject: arrayController withKeyPath: @"arrangedObjects.name" options: nil]; I suspect that all I'm missing is some required accessor, but nowhere in the documentation does Apple offer a step by step exa

Re: Binding to custom NSCell

2009-02-12 Thread Ken Tozier
n bind: @"value" toObject: arrayController withKeyPath: @"arrangedObjects.name" options: nil]; I suspect that all I'm missing is some required accessor, but nowhere in the documentation does Apple offer a step by step example on how to write a bindable custom NSCell subc

Re: Binding to custom NSCell

2009-02-12 Thread Ken Tozier
ll [super] to do the real drawing work. [column bind: @"value" toObject: arrayController withKeyPath: @"arrangedObjects.name" options: nil]; I suspect that all I'm missing is some required accessor, but nowhere in the documentation does Apple offer a step by step

Re: Binding to custom NSCell

2009-02-12 Thread Corbin Dunn
quot;value" toObject: arrayController withKeyPath: @"arrangedObjects.name " options: nil]; I suspect that all I'm missing is some required accessor, but nowhere in the documentation does Apple offer a step by step example on how to write a bindable custom NSCell subclass.

Re: Binding to custom NSCell

2009-02-12 Thread Ken Tozier
" toObject: arrayController withKeyPath: @"arrangedObjects.name" options: nil]; I suspect that all I'm missing is some required accessor, but nowhere in the documentation does Apple offer a step by step example on how to write a bindable custom NSCell subclass. What methods a

Binding to custom NSCell

2009-02-11 Thread Ken Tozier
Hi I created a custom NSCell subclass, defined accessors for stringValue, setStringValue, objectValue ane setObjectValue. I set the data cell for a column like so: [column setDataCell: customCell]; And bind the column to an array controller: [column bind: @"value" toObject:

Custom NSCell selection and click issues

2008-03-14 Thread Justin Williams
Greetings, I have built a custom NSCell that displays the isCompleted and title of the CalTask items on a user's Mac. I've got two issues with the cell that i can't seem to figure out. 1. When a user selects one of the rows, the shadow on a row one or two above will disappear.