NSTableView dragging source image

2023-03-21 Thread Dragan Milić via Cocoa-dev
Hi all, I have a simple problem, but I’m not able to solve it in an easy way, so I suspect I’m doing something wrong. I have a simple view-based NSTableView, which is a dragging source. The data being dragged are provided to the pasteboard using the standard data source method - [NSObject

Re: NSTableView

2019-04-21 Thread Arved von Brasch
Yeah, it was obvious that writeRowsWith: would soon be deprecated. After going through the documentation a bit, I did it via: func tableView(_ tableView: NSTableView, draggingSession session: NSDraggingSession, willBeginAt screenPoint: NSPoint, forRowIndexes rowIndexes: IndexSet

Re: NSTableView

2019-04-21 Thread Alex Zavatone
wrote: >> >> Hello list, >> >> Anyone know if it is intentionally the case that NSTableView doesn’t call >> >> dragImageForRows(with dragRows: IndexSet, tableColumns: [NSTableColumn], >> event dragEvent: NSEvent, offset dragImageOffse

Re: NSTableView

2019-04-20 Thread Rob Petrovec
gt; Anyone know if it is intentionally the case that NSTableView doesn’t call > > dragImageForRows(with dragRows: IndexSet, tableColumns: [NSTableColumn], > event dragEvent: NSEvent, offset dragImageOffset: NSPointPointer) -> NSImage > > if you implement > > func tableView(N

NSTableView

2019-04-20 Thread Arved von Brasch
Hello list, Anyone know if it is intentionally the case that NSTableView doesn’t call dragImageForRows(with dragRows: IndexSet, tableColumns: [NSTableColumn], event dragEvent: NSEvent, offset dragImageOffset: NSPointPointer) -> NSImage if you implement func tableView(NSTableV

Tool tips for column headers of NSTableView not showing

2019-03-29 Thread James Walker
I have a view-based NSTableView with column headers, and I have assigned tool tips to all the columns in the nib. The problem is that if I pause the mouse over column headers, the tool tips don't appear. In contrast, tool tips for controls within table rows work fine. However, if I click

Re: Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Saagar Jha
Yup, this declares ImportTool (a subclass of NSObject) with the lightweight generic parameters X, Y, and Z. Here are some examples and how they map to Swift, which

Re: Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Andy Lee
The compiler may accept it, but it doesn't interpret it the way you think. You can confirm by checking whether your class formally conforms to the protocols. Try this with your old code and your new code, and compare: NSLog(@"conforms to protocol? %d", [ImportTool

Re: Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Peter Hudson
Very strange - the compiler is quite happy with my waywardness. Peter > On 28 Mar 2019, at 23:39, Quincey Morris > wrote: > >> On Mar 28, 2019, at 15:58 , Peter Hudson wrote: >> >> @interface ImportTool > NSEncoding> : NSObject > > You’re Doing It Wrong™. You mean: > >> @interface

Re: Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Rob Petrovec
Yes, this. —Rob > On Mar 28, 2019, at 5:39 PM, Quincey Morris > wrote: > > On Mar 28, 2019, at 15:58 , Peter Hudson wrote: >> >> @interface ImportTool > NSEncoding> : NSObject > > You’re Doing It Wrong™. You mean: > >> @interface ImportTool : NSObject > NSTableViewDelegate, NSEncoding>

Re: Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Quincey Morris
On Mar 28, 2019, at 15:58 , Peter Hudson wrote: > > @interface ImportTool NSEncoding> : NSObject You’re Doing It Wrong™. You mean: > @interface ImportTool : NSObject NSTableViewDelegate, NSEncoding> I don’t know what it means the way you wrote it. Something about lightweight generic

Re: Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Peter Hudson
wrote: >> >> Hi there >> >> The class I am trying to use as a datasource and delegate to an NSTableView >> adopts the required protocols and implements the required methods :- >> >> @interface ImportTool > NSEncoding> : NSObject >> >

Re: Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Alex Zavatone
ote: > > Hi there > > The class I am trying to use as a datasource and delegate to an NSTableView > adopts the required protocols and implements the required methods :- > > @interface ImportTool NSEncoding> : NSObject > > etc … > > > But when I

Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Peter Hudson
Hi there The class I am trying to use as a datasource and delegate to an NSTableView adopts the required protocols and implements the required methods :- @interface ImportTool : NSObject etc … But when I try to assign an instance of ImportScript as datasource and delegate to the table

Re: Popup-Menu Binding issue in Cell-based NSTableView

2018-01-04 Thread Keary Suska
> On Jan 4, 2018, at 12:27 AM, Motti Shneor wrote: > >>> If I last elect to add such out-of-table popup - can you think of a decent >>> way to disable opening those in-table popup button cells when more than one >>> line is selected? >> >> If you choose this route I

Re: Popup-Menu Binding issue in Cell-based NSTableView

2018-01-02 Thread Keary Suska
not be able to do the latter depending on when >> bindings populates the popup. > > Well - this I was able to do now - but with one strange behavior. I added the > -(BOOL) validateMenuItem:(NSMenuItem *)menuItem to my Window controller, and > it IS called for each and every item in

Re: Popup-Menu Binding issue in Cell-based NSTableView

2018-01-01 Thread Quincey Morris
On Jan 1, 2018, at 01:46 , Motti Shneor wrote: > > Selected Object bound to Measurements Array Controller, Controller Key: > arrangedObjects, Model Key Path: species, Allows Editing Multiple Values > Selection, Conditionally Sets Enabled, Creates Sort Descriptor Your

Re: Popup-Menu Binding issue in Cell-based NSTableView

2018-01-01 Thread Keary Suska
> I have an NSCell based NSTableView, whose columns are bound to an > NSArrayController, whose Content-Array in turn is bound to some CoreData > to-many relation - thus the table shows all the related entities. > > Say we have a “WaterSample” entity, and the to-many relati

Re: Popup-Menu Binding issue in Cell-based NSTableView

2018-01-01 Thread Richard Charles
tion written early 2014 when Swift was not an option. Pure Obj-C, > CoreData, and “No-custom-UI” approach. > > I have an NSCell based NSTableView, whose columns are bound to an > NSArrayController, whose Content-Array in turn is bound to some CoreData > to-many relation - thus th

Popup-Menu Binding issue in Cell-based NSTableView

2018-01-01 Thread Motti Shneor
Hello everyone. Please excuse the anachronism, I am maintaining an old Mac Application written early 2014 when Swift was not an option. Pure Obj-C, CoreData, and “No-custom-UI” approach. I have an NSCell based NSTableView, whose columns are bound to an NSArrayController, whose Content-Array

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
it, I'm not yet that advanced with my exploration of Cocoa app writing... may Apple came out with some clever trick...) 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

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 <eml...@wanadoo.fr> 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

Re: Creating NSTableView programmatically

2017-12-19 Thread Eric Matecki
the most fundamental one. When I select a row in a NSTableView, that selection doesn't "make it" all the way to update the controller... The code/project is now available here : https://gitlab.com/CocoaMusings/Combatants Any suggestion(s) is appreciated. Eric M. I ju

Re: Creating NSTableView programmatically

2017-12-19 Thread Eric Matecki
a row in a NSTableView, that selection doesn't "make it" all the way to update the controller... The code/project is now available here : https://gitlab.com/CocoaMusings/Combatants Any suggestion(s) is appreciated. Eric M. -- Keep intel OUTSIDE my Mac ! Hiii !!! I can see Intel chip

Re: NSTableView drag image - using the first column image

2017-12-18 Thread Marek Hrušovský
Override: - (NSArray *)draggingImageComponents; Apple uses it in its sample TableViewPlaygroud. I found it using br -n "-[NSDraggingImageComponent initWithKey:]". lldb and breakpoints can help you. Use hopper or class-dump to see method names (AppKit). Marek. On Fri, Dec 15, 2017 at 6:52 PM,

Re: NSTableView drag image - using the first column image

2017-12-17 Thread Rob Petrovec
You probably want NSTableView -dragImageForRowsWithIndexes:tableColumns:event:offset: —Rob > On Dec 15, 2017, at 10:52 AM, David Catmull <davidcatm...@gmail.com> wrote: > > In my table view, when you drag an item, the drag image it uses comes from > the column cell wher

NSTableView drag image - using the first column image

2017-12-15 Thread David Catmull
In my table view, when you drag an item, the drag image it uses comes from the column cell where the drag started, rather than using the cell from the first column where I have the icon and name. How do I make it use the first column? I'm looking at Apple's TableViewPlayground as an example, and

Re: Creating NSTableView programmatically

2017-12-14 Thread corbin dunn
kinda Doing It Wrong™. The standard (and, I believe, >> recommended) way to do this is to create an instance of >> NSTableCellView, which has the “objectValue” property, along with other >> potentially useful behaviors for cell views (such as >> identifiers that al

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
the “objectValue” property, along with other potentially useful behaviors for cell views (such as identifiers that allow the NSTableView to cache and manage cell views). I know it's wrong, or at least bad, but NSTextView and NSButton are the controls I kind of master right now... I really don't need

Re: Creating NSTableView programmatically

2017-12-11 Thread Charles Srstka
I can see Intel chips creeping around my G5 ! I dunno, to me it seems that trying to get NSTableView to work right without just using a nib is as much of a losing battle as still trying to fight the PPC->Intel transition in 2017… ;-) Charles ___ Coc

Re: Creating NSTableView programmatically

2017-12-11 Thread Quincey Morris
which has the “objectValue” property, along with other potentially useful behaviors for cell views (such as identifiers that allow the NSTableView to cache and manage cell views). In a very unusual or complex case, you might subclass NSTableCellView to add properties or behaviors to it, but

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
CellView 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 row:(NSInteger)row provides 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 row:(NSInteger

Creating NSTableView programmatically

2017-12-11 Thread Eric Matecki
ly instead of using IB to really understand what happens. Just creating the "Attacker" NSTableView causes me already a lot of trouble. My code is at the bottom of this message. I can't just bind "value" of the attacker tableview to the array controller's "arrangedObjects.na

Re: cell-based NSTableView, NSArrayController and first responder

2017-07-12 Thread Martin Hewitson
> On 12 Jul 2017, at 14:32, Ken Thomases <k...@codeweavers.com> wrote: > > On Jul 12, 2017, at 4:52 AM, Martin Hewitson <martin.hewit...@aei.mpg.de> > wrote: >> >> I have a new bug in an application which I believe has only appeared in >> 10.12. >

Re: cell-based NSTableView, NSArrayController and first responder

2017-07-12 Thread Ken Thomases
On Jul 12, 2017, at 4:52 AM, Martin Hewitson <martin.hewit...@aei.mpg.de> wrote: > > I have a new bug in an application which I believe has only appeared in 10.12. > > I have a cell-based NSTableView backed by an NSArrayController, and the (new) > problem I have is that

cell-based NSTableView, NSArrayController and first responder

2017-07-12 Thread Martin Hewitson
Dear list, I have a new bug in an application which I believe has only appeared in 10.12. I have a cell-based NSTableView backed by an NSArrayController, and the (new) problem I have is that the editing of a cell ends after the first keystroke. It looks as if first responder is resigned, but I

Re: Very slow NSTableView

2017-07-05 Thread Graham Cox
> On 5 Jul 2017, at 7:25 pm, Georg Seifert wrote: > > Any reason you set the tableview to be "Source List". Set it to regular and > it will work perfectly. It seems that the NSPopUpButtonCell don’t like to be > in a source list. Maybe you can subclass it and draw

Re: Very slow NSTableView

2017-07-05 Thread Georg Seifert
Any reason you set the tableview to be "Source List". Set it to regular and it will work perfectly. It seems that the NSPopUpButtonCell don’t like to be in a source list. Maybe you can subclass it and draw yourself? Georg > On 05.07.2017, at 03:36, Graham Cox wrote: >

Re: Very slow NSTableView

2017-07-04 Thread Quincey Morris
On Jul 4, 2017, at 18:23 , Graham Cox wrote: > > However, as of the latest documentation I can find, cell-based tables are not > exactly deprecated. They’re just treated as the embarrassing brother no-one > talks about, which is not quite the same thing: I was basing

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
> On 5 Jul 2017, at 11:23 am, Graham Cox wrote: > > If anyone can offer a place to host the project, I’d be happy to share it, > and see whether the problem is seen by others. (I no longer have file hosting > services). Never mind - I remembered I had an Amazon S3

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
t). In any case, I am able to reproduce the problem in a test app that does nothing except draw a long cell-based table with pop-ups. If I use text cells, it’s fine. Add pop-up cells, it tanks. The stack trace is the same as my app. 7.02 s 86.4% 0 s

Re: Very slow NSTableView

2017-07-04 Thread Jens Alfke
> On Jul 4, 2017, at 12:00 AM, Graham Cox wrote: > > Heh, well, I wish I knew. > Instruments isn’t working. It’s a new machine which I set up from my older > machine. XCode works fine, but Instruments doesn’t. I guess that just copying > stuff over isn’t enough to

Re: Very slow NSTableView

2017-07-04 Thread Quincey Morris
On Jul 4, 2017, at 05:02 , Graham Cox wrote: > > But it’s still spending an excruciating amount of time rendering the title of > the pop-up button, but most of it is in the mysterious rgba64_DAplusdDA > function. This is called twice for each pop-up button rendered, and

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
ch in between them collapsed (every line is meant to be indented from the one above, but mail isn’t preserving the formatting at all). 24.72 s 78.7% 0 s -[NSTableView drawRect:] 24.55 s 78.1% 0 s

Re: Very slow NSTableView

2017-07-04 Thread Quincey Morris
On Jul 4, 2017, at 01:02 , Graham Cox <graham@bigpond.com> wrote: > > Is NSTableView documented anywhere to require layer backing? Not that I know of. A couple of things to keep in mind: — This thing about the dramatic effect *might* be specific to NSCell-based tabl

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
uffer drawing using a temporary bitmap). So, turning vibrancy on/off in system prefs has no effect. Next, I subclassed the NSTableView to return NO from -allowsVibrancy. It works - no more nasty desktop bleedthrough, but it still scrolls very slowly. > In both cases, the “expensive” call was

Re: Very slow NSTableView

2017-07-04 Thread Quincey Morris
On Jul 4, 2017, at 00:18 , Graham Cox wrote: > > Is there a way to opt-out of vibrancy for an entire table view? There’s no clear indication that the performance problem has anything to do with vibrancy. In both cases, the “expensive” call was about transparency, which

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
reinstalled Instruments using XCode 8. Fixed all the new warnings and compilation glitches that going from XCode 7 to 8 inevitably causes, and my app is running again. Here’s what instruments says it’s spending all its time doing: 18.47 s

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
> On 4 Jul 2017, at 12:29 pm, Quincey Morris > wrote: > > On Jul 3, 2017, at 18:19 , Graham Cox wrote: >> >> slow. as. molasses. > > What does Instruments say it’s doing? > Heh, well, I wish I knew. Instruments isn’t working.

Re: Very slow NSTableView

2017-07-03 Thread Roland King
wrote: I have a NSTableView, cell-based (partially because it’s a very long-standing piece of code, partially because it is just a table of values which a cell-based table is ideally suited to - view-based would not do anything for me here). This table has always worked fine, but in Sierra, it i

Re: Very slow NSTableView

2017-07-03 Thread Alex Zavatone
at the start and the end and see where the time suck is happening in an attempt to narrow this down. GL. - Alex Zavatone > On Jul 3, 2017, at 8:19 PM, Graham Cox <graham@bigpond.com> wrote: > > I have a NSTableView, cell-based (partially because it’s a very long-standing > piece

Re: Very slow NSTableView

2017-07-03 Thread Quincey Morris
On Jul 3, 2017, at 18:19 , Graham Cox wrote: > > slow. as. molasses. What does Instruments say it’s doing? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

Very slow NSTableView

2017-07-03 Thread Graham Cox
I have a NSTableView, cell-based (partially because it’s a very long-standing piece of code, partially because it is just a table of values which a cell-based table is ideally suited to - view-based would not do anything for me here). This table has always worked fine, but in Sierra

Re: What do the font-related Cocoa Bindings in NSTableView and NSTableColumn do?

2017-04-07 Thread Quincey Morris
On Apr 7, 2017, at 16:24 , Daryle Walker wrote: > > I first tried overriding “prepareForReuse” in my text-field subclass, but it > never stuck. It’s never going to be called for that view, because the table view doesn’t know anything about it. You have to override it in a

Re: What do the font-related Cocoa Bindings in NSTableView and NSTableColumn do?

2017-04-07 Thread Daryle Walker
> On Apr 7, 2017, at 4:43 PM, Quincey Morris > wrote: > > On Apr 7, 2017, at 07:24 , Daryle Walker > wrote: >> >> Does anyone have any ideas how to do this a runtime? I need to intercept >> when a table cell is

Re: What do the font-related Cocoa Bindings in NSTableView and NSTableColumn do?

2017-04-07 Thread Quincey Morris
On Apr 7, 2017, at 07:24 , Daryle Walker wrote: > > Does anyone have any ideas how to do this a runtime? I need to intercept when > a table cell is created so I can either change its font property or set a > font binding. Do you implement tableView:viewFor:row: in your

Re: What do the font-related Cocoa Bindings in NSTableView and NSTableColumn do?

2017-04-07 Thread Daryle Walker
> On Apr 5, 2017, at 5:19 PM, Daryle Walker wrote: > >> On Apr 5, 2017, at 5:08 PM, Daryle Walker wrote: >> >>> On Apr 5, 2017, at 12:19 PM, Charles Srstka >>> wrote: >>> >>> Actually, while NSTableCellView won’t bind to *most*

Re: What do the font-related Cocoa Bindings in NSTableView and NSTableColumn do?

2017-04-05 Thread Charles Srstka
> On Apr 5, 2017, at 4:08 PM, Daryle Walker wrote: > >> >> On Apr 5, 2017, at 12:19 PM, Charles Srstka > > wrote: >> >> >> Actually, while NSTableCellView won’t bind to *most* things outside of the >> table view,

Re: What do the font-related Cocoa Bindings in NSTableView and NSTableColumn do?

2017-04-05 Thread Daryle Walker
> On Apr 5, 2017, at 5:08 PM, Daryle Walker wrote: > > >> On Apr 5, 2017, at 12:19 PM, Charles Srstka wrote: >> >> >> Actually, while NSTableCellView won’t bind to *most* things outside of the >> table view, there is an exception for the table’s

Re: What do the font-related Cocoa Bindings in NSTableView and NSTableColumn do?

2017-04-05 Thread Daryle Walker
> On Apr 5, 2017, at 12:19 PM, Charles Srstka wrote: > > > Actually, while NSTableCellView won’t bind to *most* things outside of the > table view, there is an exception for the table’s delegate. So, if you set > the table’s delegate to File’s Owner, and then bind

Re: What do the font-related Cocoa Bindings in NSTableView and NSTableColumn do?

2017-04-05 Thread Charles Srstka
> On Apr 5, 2017, at 8:38 AM, Keary Suska wrote: > >> >> On Apr 4, 2017, at 4:34 PM, Daryle Walker > > wrote: >> >> >>> On Apr 4, 2017, at 9:57 AM, Keary Suska >>

Re: What do the font-related Cocoa Bindings in NSTableView and NSTableColumn do?

2017-04-05 Thread Keary Suska
> On Apr 4, 2017, at 4:34 PM, Daryle Walker wrote: > > >> On Apr 4, 2017, at 9:57 AM, Keary Suska wrote: >> >> >>> On Apr 3, 2017, at 5:40 PM, Daryle Walker wrote: >>> >>> Is there a way to affect the font of a table cell via

What do the font-related Cocoa Bindings in NSTableView and NSTableColumn do?

2017-04-04 Thread Daryle Walker
Neither class (directly?) has font controls, so would any related binding affect, if anything? Is there a way to affect the font of a table cell via Bindings? The few times I tried, at the NSTextField level (NSTableCellView does not have any font-related Bindings), resulted in Xcode’s XIB

Re: NSTableView column sizes

2017-03-17 Thread Daryle Walker
The effect I don’t like about the default code is that when the last column’s width is set to fill out the table, it’s only set for the current set of widths. As soon as you narrow an earlier column, the last column’s right border becomes visible. I want the last column to always max out, no

Re: NSTableView column sizes

2017-03-15 Thread Quincey Morris
On Mar 15, 2017, at 06:51 , Stephane Sudre wrote: > > the Column Sizing option Remember too that each column has its own sizing options that operate in conjunction with the table view’s options. For each column, you can decide whether the column participates in

Re: NSTableView column sizes

2017-03-15 Thread Stephane Sudre
On Wed, Mar 15, 2017 at 9:59 AM, Daryle Walker wrote: > 1. Is there a way to make the last (right in the U.S. localization) column to > always be at the end of the table-view, instead of a gap after a resize? Yes, there is. > 2. My table has two columns. Is there a way to keep

Re: NSTableView column sizes

2017-03-15 Thread Steve Mills
On Mar 15, 2017, at 03:59:43, Daryle Walker wrote: > > 1. Is there a way to make the last (right in the U.S. localization) column to > always be at the end of the table-view, instead of a gap after a resize? > > 2. My table has two columns. Is there a way to keep their sizes

NSTableView column sizes

2017-03-15 Thread Daryle Walker
1. Is there a way to make the last (right in the U.S. localization) column to always be at the end of the table-view, instead of a gap after a resize? 2. My table has two columns. Is there a way to keep their sizes in proportion after a window resize? (If the divider is moved, resizes will

Re: Is it possible to set an NSTableView cell background color?

2017-02-23 Thread David Delmonte
I worked the problem. I’m rather rusty these days. This is what I came up with: 1. Moved to view-based table view. 2. In viewForRow, I added this line: cell.memoryName.drawsBackground = true 3. And then: cell.memoryName.backgroundColor = mintGreen Thanks to all for the pointers. > On

Re: Is it possible to set an NSTableView cell background color?

2017-02-23 Thread corbin dunn
> On Feb 22, 2017, at 6:27 PM, David Delmonte wrote: > > I tried you solution but it doesn’t color the cell. Scratching my head some > more.. I’ll probably ask on Stack Overflow. How did you get it to compile? It requires a view based tableview. Your first step is to

Re: Is it possible to set an NSTableView cell background color?

2017-02-22 Thread Quincey Morris
On Feb 22, 2017, at 17:45 , David Delmonte wrote: > > It's cell based! In that case, you need to implement the delegate method "tableView(_:willDisplayCell:for:row:)”, which is called once for each cell that’s redrawn. In your method, you need to verify that the cell is of

Re: Is it possible to set an NSTableView cell background color?

2017-02-22 Thread David Delmonte
I tried you solution but it doesn’t color the cell. Scratching my head some more.. I’ll probably ask on Stack Overflow. > On Feb 22, 2017, at 8:37 PM, Saagar Jha wrote: > > Well, assuming you have a NSTableCellView, you can set its background color > using its layer.

Re: Is it possible to set an NSTableView cell background color?

2017-02-22 Thread David Delmonte
It's cell based! > On Feb 22, 2017, at 20:38, Quincey Morris > wrote: > >> On Feb 22, 2017, at 16:14 , David Delmonte wrote: >> >> I have a table that has records by date. I want to color those entries based >> on the decade. > >

Re: Is it possible to set an NSTableView cell background color?

2017-02-22 Thread Quincey Morris
On Feb 22, 2017, at 16:14 , David Delmonte wrote: > > I have a table that has records by date. I want to color those entries based > on the decade. NSCell-based or NSView-based? ___ Cocoa-dev mailing list

Re: Is it possible to set an NSTableView cell background color?

2017-02-22 Thread Saagar Jha
Well, assuming you have a NSTableCellView, you can set its background color using its layer. For example: cell.layer.backgroundColor = NSColor.black.cgColor Saagar Jha > On Feb 22, 2017, at 16:14, David Delmonte wrote: > > Hi all, I have a table that has records by date. I

Is it possible to set an NSTableView cell background color?

2017-02-22 Thread David Delmonte
Hi all, I have a table that has records by date. I want to color those entries based on the decade. I cannot seem to find a way to do this. Any help would be appreciated. David ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: View based NSTableView bounds to NSArrayController bounds to NSUserDefaultsController

2017-02-06 Thread Steve Mills
On Feb 06, 2017, at 02:37 PM, Ken Thomases wrote: What is your cell view? An NSTableCellView with an NSTextField as a descendant view? An NSTextField directly? The default you get when you create a new table, NSTableCellView containing an NSTextField, which contains an

Re: View based NSTableView bounds to NSArrayController bounds to NSUserDefaultsController

2017-02-06 Thread Ken Thomases
On Feb 6, 2017, at 8:43 AM, Steve Mills wrote: > > The problem is that when I edit values in the table, they only seem to get > written to the defaults if I add a new item after editing an existing item. > > 1. Run app. > 2. Edit existing row value. > 3. Add new row and edit

Re: View based NSTableView bounds to NSArrayController bounds to NSUserDefaultsController

2017-02-06 Thread Steve Mills
On Feb 06, 2017, at 10:30 AM, Keary Suska wrote: Warning: the following explanation assumes a scenario that you don’t explicitly describe, namely that you are editing an array-type defaults value. This is a known “issue”, if you want to call it that. As I understand

Re: View based NSTableView bounds to NSArrayController bounds to NSUserDefaultsController

2017-02-06 Thread Keary Suska
> On Feb 6, 2017, at 7:43 AM, Steve Mills wrote: > > (Has cocoa-dev been down for days or what?) > > Why is it that most times when I implement a table, it can waste hours of my > time? > > So I think I have everything set up like it should be. I'll just jump right > to the

View based NSTableView bounds to NSArrayController bounds to NSUserDefaultsController

2017-02-06 Thread Steve Mills
(Has cocoa-dev been down for days or what?) Why is it that most times when I implement a table, it can waste hours of my time? So I think I have everything set up like it should be. I'll just jump right to the bug and then we can work back. The problem is that when I edit values in the table,

Re: Success with NSTableView weak delegates?

2016-09-20 Thread Sean McBride
On Tue, 20 Sep 2016 16:41:07 -0700, Greg Parker said: >Those crashes are expected. > >NSTableView's delegate is zeroing-weak when both of the following are true: >* Your app was built with the 10.11 SDK or newer. >* Your app is running on 10.12 or newer. > >The delegate is unsafe-unretained when

Re: Success with NSTableView weak delegates?

2016-09-20 Thread Greg Parker
> On Sep 20, 2016, at 2:47 PM, Sean McBride wrote: > > On Tue, 20 Sep 2016 14:26:27 -0700, David Duncan said: > >>> On Sep 20, 2016, at 1:21 PM, Sean McBride wrote: >>> >>> Hi all, >>> >>> WWDC 2016 Session 203 "What's New in Cocoa" at

Re: Success with NSTableView weak delegates?

2016-09-20 Thread David Duncan
> On Sep 20, 2016, at 2:47 PM, Sean McBride wrote: > > On Tue, 20 Sep 2016 14:26:27 -0700, David Duncan said: > >>> On Sep 20, 2016, at 1:21 PM, Sean McBride wrote: >>> >>> Hi all, >>> >>> WWDC 2016 Session 203 "What's New in Cocoa" at

Re: Success with NSTableView weak delegates?

2016-09-20 Thread Sean McBride
On Tue, 20 Sep 2016 14:26:27 -0700, David Duncan said: >> On Sep 20, 2016, at 1:21 PM, Sean McBride wrote: >> >> Hi all, >> >> WWDC 2016 Session 203 "What's New in Cocoa" at around 43:37 in the >video, says that if you link against the 10.11 SDK that NSTableView's

Re: Success with NSTableView weak delegates?

2016-09-20 Thread David Duncan
> On Sep 20, 2016, at 1:21 PM, Sean McBride wrote: > > Hi all, > > WWDC 2016 Session 203 "What's New in Cocoa" at around 43:37 in the video, > says that if you link against the 10.11 SDK that NSTableView's delegate is > weak. So I went and wrapped my delegate

  1   2   3   4   5   6   7   8   9   10   >