Re: Creating NSTableView programmatically

2017-12-20 Thread Quincey Morris
On Dec 20, 2017, at 18:55 , Rob Petrovec wrote: > > Not for nothin', but I don’t think bindings have died. So, let me respond jointly to all of the comments similar to this. Of course bindings haven’t “died”, in the sense that no one *uses* them any more. My point was that

Re: Creating NSTableView programmatically

2017-12-20 Thread Rob Petrovec
Not for nothin', but I don’t think bindings have died. They are still supported and used all over the OS. I use them all the time in my code too. They are very useful. Bindings are built onto of KVO, which is a fundamental technology. —Rob > On Dec 20, 2017, at 3:40 PM, Richard Charles

Re: Creating NSTableView programmatically

2017-12-20 Thread Richard Charles
> On Dec 20, 2017, at 3:23 AM, Quincey Morris > wrote: > > In effect, the whole thing with bindings died at 10.5, except for the part > where they were used within IB to hook up specific controls to specific > properties. That part is really all we use

Re: Creating NSTableView programmatically

2017-12-20 Thread Charles Srstka
> On Dec 20, 2017, at 4:23 AM, Quincey Morris > wrote: > >> The original code used all the same three array controllers, with the exact >> same subclassing of the target's one. > > This is where I take the fifth. > > When bindings were introduced, back

Re: Creating NSTableView programmatically

2017-12-20 Thread Richard Charles
> On Dec 20, 2017, at 2:23 AM, Eric Matecki wrote: > > My project is based on what I believe is an official sample from Apple, > which Richard Charles posted as an attachment to his msg from 12/12/2017. It looks like you have taken your project from Malcolm Crawford's

Re: Creating NSTableView programmatically

2017-12-20 Thread Quincey Morris
On Dec 20, 2017, at 01:23 , Eric Matecki wrote: > > The sole purpose of my project is to learn how bindings works, it has no > practical application per se. Bindings exist to support the use of NIB-based UI behavior. All bindings work the same way, in the sense that they

Re: Creating NSTableView programmatically

2017-12-20 Thread Eric Matecki
Hi, Richard, I also reply to your msg here to avoid too much redundancy. Thanks for your efforts. My project is based on what I believe is an official sample from Apple, which Richard Charles posted as an attachment to his msg from 12/12/2017. The sole purpose of my project is to learn how

Re: Creating NSTableView programmatically

2017-12-19 Thread Richard Charles
> Eric Matecki - Combatants Project on GitHub > > File Combatants.m > > /* > Create and return an array of all the combatants that are not selected > */ > - (NSArray *) arrangeObjects: (NSArray*)iObjectsToArrange > { > printf("Targets::ArrangeObject()\n”); This smells like C++ which is

Re: Creating NSTableView programmatically

2017-12-19 Thread Quincey Morris
On Dec 19, 2017, at 02:24 , Eric Matecki wrote: > > When I select a row in a NSTableView, that selection doesn't "make it" all > the way to update the controller... I masochistically downloaded your project, and I think it’s a perfect example of why not to do this. There is

Re: Creating NSTableView programmatically

2017-12-19 Thread Eric Matecki
On 19/12/2017 11:24, Eric Matecki wrote: Hello all, No I didn't abandon all hope, I was just busy :) Thanks to all the replies, I got a lot further, but still didn't reach my destination... Now I have a nice window, looking almost exactly like the NIB created one. Most things works, except

Re: Creating NSTableView programmatically

2017-12-19 Thread Eric Matecki
Hello all, No I didn't abandon all hope, I was just busy :) Thanks to all the replies, I got a lot further, but still didn't reach my destination... Now I have a nice window, looking almost exactly like the NIB created one. Most things works, except the most fundamental one. When I select a

Re: Creating NSTableView programmatically

2017-12-14 Thread corbin dunn
> On Dec 12, 2017, at 2:12 AM, Eric Matecki wrote: > > Hi, > > On 11/12/2017 20:10, Quincey Morris wrote: >>> I made my own text field class according to this (in NSTableCellView's doc) >>> : >> >> I think you’re still kinda Doing It Wrong™. The standard (and, I believe,

Re: Creating NSTableView programmatically

2017-12-12 Thread Richard Charles
> On Dec 12, 2017, at 2:40 PM, Jonathan Mitchell wrote: > >> On 12 Dec 2017, at 19:56, Richard Charles wrote: >> >> I always assumed the reason bindings never came over to iOS was they >> consumed too much cpu power and were too difficult to

Re: Creating NSTableView programmatically

2017-12-12 Thread Jonathan Mitchell
> On 12 Dec 2017, at 19:56, Richard Charles wrote: > > I always assumed the reason bindings never came over to iOS was they consumed > too much cpu power and were too difficult to understand. It seems evident > that 10 or 20 years from now Apple anticipates the bulk of

Re: Creating NSTableView programmatically

2017-12-12 Thread Richard Charles
> On Dec 12, 2017, at 12:08 PM, Quincey Morris > wrote: > > I don’t think bindings are fading away. They can’t, while they’re the only > way to connect UI elements without custom glue code. However, the design is > ancient (IIRC, bindings were introduced

Re: Creating NSTableView programmatically

2017-12-12 Thread Quincey Morris
On Dec 12, 2017, at 02:12 , Eric Matecki wrote: > > In the case of NSTableCellView, neither binding works... I don't get any > exception or crash, but nothing is displayed inside my table view (although > it's size suggests the four rows are there). This was a conceptual

Re: Creating NSTableView programmatically

2017-12-12 Thread Eric Matecki
Hi Richard, thanks for all this reading ! I'll need a day or two to understand everything therein. Even if they aren't that long, there are a lot of subtle details :) Too bad that bindings are fading away, the concept is great, the implementation is not so great from skimming thru these

Re: Creating NSTableView programmatically

2017-12-12 Thread Eric Matecki
Hi, On 11/12/2017 20:10, Quincey Morris wrote: I made my own text field class according to this (in NSTableCellView's doc) : I think you’re still kinda Doing It Wrong™. The standard (and, I believe, recommended) way to do this is to create an instance of NSTableCellView, which has the

Re: Creating NSTableView programmatically

2017-12-11 Thread Charles Srstka
> On Dec 11, 2017, at 4:59 AM, Eric Matecki wrote: > > > Hello, > > I'm trying to implement in Objective-C on macOS *programmatically* the "Real > World Example" at the bottom of this page : >

Re: Creating NSTableView programmatically

2017-12-11 Thread Quincey Morris
On Dec 11, 2017, at 10:19 , Alastair Houghton wrote: > > NSTableViewCell is the old way to do it, before view-based tables were the > norm In this case, I think “NSTableViewCell” is a typo in the documentation. In the following tables, it refers to the binding

Re: Creating NSTableView programmatically

2017-12-11 Thread Alastair Houghton
On 11 Dec 2017, at 13:53, Eric Matecki wrote: > > Thanks Jonathan, > > I got a lot further now. > So it is NSTableCellView, not NSTableViewCell as stated in the doc ! FWIW, NSTableViewCell is the old way to do it, before view-based tables were the norm, which probably

Re: Creating NSTableView programmatically

2017-12-11 Thread Eric Matecki
Thanks Jonathan, I got a lot further now. So it is NSTableCellView, not NSTableViewCell as stated in the doc ! I could have searched a long time before finding this out I made my own text field class according to this (in NSTableCellView's doc) : """ The objectValue is used when setting the

Re: Creating NSTableView programmatically

2017-12-11 Thread Jonathan Mitchell
For NSTableCellView see https://developer.apple.com/documentation/appkit/nstablecellview objectValue is a property on NSTableCellView not on NStableView. The NSTableViewDelegate method - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn

Creating NSTableView programmatically

2017-12-11 Thread Eric Matecki
Hello, I'm trying to implement in Objective-C on macOS *programmatically* the "Real World Example" at the bottom of this page : https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/WhatAreBindings.html I want to do it programmatically instead of