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 wrote: > > 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 f

Re: Exception in IKImageBrowserView in macOS 10.13 GM

2017-11-05 Thread Rob Petrovec
> On Nov 5, 2017, at 10:53 AM, Jim Crate wrote: > > On Nov 5, 2017, at 11:56 AM, Steve Mills wrote: >> >> On Nov 5, 2017, at 10:23:09, Jim Crate wrote: >>> >>> The Finder icon view works the same way, and has since at least 10.10 or >>> so. When I initially replaced the IKImageBrowserView in

Re: Exception in IKImageBrowserView in macOS 10.13 GM

2017-11-04 Thread Rob Petrovec
NSCollectionView -selectionIndexPaths works pretty well for me and is super simple to use, IMO. —Rob > On Oct 18, 2017, at 3:12 PM, Steve Mills wrote: > > On Oct 18, 2017, at 15:38:47, Rob Petrovec wrote: >> >> re-NSCollectionView: Yes it had its problems when it f

Re: Exception in IKImageBrowserView in macOS 10.13 GM

2017-10-18 Thread Rob Petrovec
IKImageBrowserView was soft deprecated in 10.12 actually. ‘soft’ deprecation means that it is in maintenance mode and will be removed completely in a future release. When that will be is TBD, but typically it’s at least 3 to 4 releases before it is pulled to give developers time to transition to

Re: Visible difference in text: NSTextField vs drawInRect:

2017-04-10 Thread Rob Petrovec
updateLayer vs not? By implementing drawRect: it automagically disables updateLayer for that view so the drawing mechanics are different under the hood. NSTextField may be using updateLayer while your manual implementation is not resulting in a different rendering of the text. Also try printi

Re: programmatically tell when spotlight/mds is indexing

2017-03-22 Thread Rob Petrovec
I’m not sure there is a way to tell if it is indexing other then to check for the existence of the mdworker process. But that won’t tell you if you are in the middle of a full index. It will just say that Spotlight is importing something, somewhere, for some reason which it does all the time. I

Re: Custom NSCollectionViewLayout isn't causing scrollbars to appear

2016-12-28 Thread Rob Petrovec
You need to specify the scroll direction via -scrollDirection and return an NSSize large enough for a scroll bar from -collectionViewContentSize. Hope that helps. —Rob > On Dec 23, 2016, at 11:23 AM, Steve Mills wrote: > > I'm using a custom layout subclass because I want a specific number

Re: Is NSCollectionView size not controllable in 10.10?

2016-11-06 Thread Rob Petrovec
I haven’t seen Jean-Daniel’s reply (he likely replied directly to you), but I think he is correct. Your best bet is to subclass NSCollectionViewFlowLayout and override -collectionViewContentSize: to specify what width you want the collection view to be and let NSCollectionViewFlowLayout figure

Re: NSCollectionView isn't playing nicely with selection binding

2016-11-06 Thread Rob Petrovec
The NSIndexSet variants are (soft) deprecated. They will likely be hard deprecated (e.g. produce compiler warnings/errors) in a future release. You should only use the NSIndexPath versions going forward. Using a mix of the two variants of API is not supported. To bind NSCollectionView -sele

Re: Don't you hate it when Appkit crashes?

2016-02-13 Thread Rob Petrovec
I agree that this is likely not an issue with AppKit or Core Animation. I’d start by search your code for ‘saveDocumentAs:’. Whatever object that is supposed to be getting called on is likely the object that is being smashed. You could also try running with the Static Analyzer & Address Sanit

Re: Auto Layout Log Warning Message

2015-09-10 Thread Rob Petrovec
What version of the OS? Typically this is a bad bug that shouldn’t be ignored. Set a breakpoint on -[NSScrollView setNeedsLayout:] and see what is triggering the layout to f the scroll view to get dirtied inside of -layout. Good luck... —Rob > On Sep 9, 2015, at 6:35 AM, Dave wrote: > > H

Re: awakeFromNib multiple objects - all connected?

2014-07-05 Thread Rob Petrovec
> On Jul 4, 2014, at 9:13 PM, Graham Cox wrote: > > > On 5 Jul 2014, at 1:56 pm, Trygve Inda wrote: > >> As long as A can call into B & C and know that B & C have their outlets >> hooked up, that's fine. > > You can rely on all outlets being connected. What you can't rely on is the > order

Re: NSDatePicker : Displaying and binding to nil.

2014-05-20 Thread Rob Petrovec
I haven’t looked at your code, but why not use a nil placeholder value when binding? Pass an options dictionary with a key / value pair of NSNullPlaceholderBindingOption / to the -bind:… method, or specify the value for the nil placeholder in the nib. Something like: [datePicker bind: NSVal

Re: NSOpenPanel runModal on a dispatch

2012-12-16 Thread Rob Petrovec
On Dec 16, 2012, at 9:05 AM, Mike Abdullah wrote: > > On 16 Dec 2012, at 10:45, Tamas Nagy wrote: > >> Hey, >> >> I'm trying to display an NSOpenPanel on a dispatch, with half-luck. The >> panel displays, but no files going to be displayed - the circle just >> spinning on the bottom-left cor

Re: Updating NSTextView when it gets shorter [SOLVED]

2008-05-05 Thread Rob Petrovec
, Graham Cox wrote: Um, thanks for that. Does this qualify as *less* roundabout than one notification? ;-) G. On 6 May 2008, at 12:44 am, Rob Petrovec wrote: I override setMinSize to always set it to some small size (like 11x11) no matter what the passed in size is. I also override

Re: Updating NSTextView when it gets shorter [SOLVED]

2008-05-05 Thread Rob Petrovec
I override setMinSize to always set it to some small size (like 11x11) no matter what the passed in size is. I also override setMaxSize to set whatever the passed in width is, but use my own max size (1, for example), and also set the textContainer to match. Then override setString an

Re: View Getting MouseUp Without Corresponding MouseDown

2008-04-28 Thread Rob Petrovec
FYI, same thing happens in Carbon. Its technically a feature for Drag support. --Rob On Apr 28, 2008, at 8:51 PM, Peter Zegelin wrote: Hi Graham, I don't think so as they are my own rulers - I'm not using NSRulerView. I wasn't even going to mention the rulers! They are just custom sibl

Re: NSLog() replacement for debugger output

2008-04-26 Thread Rob Petrovec
On Apr 24, 2008, at 4:54 PM, Ken Thomases wrote: The do-while-false pattern is only necessary if you've got multiple statements or are otherwise surrounding the statements with braces. On Apr 24, 2008, at 5:43 PM, Herb Petschauer wrote: What happens in a release build in this situation? if

Auto-resizing column based on the data inside it?

2008-04-02 Thread Rob Petrovec
Hey, I have an NSScrollView with an NSTableView embedded inside it. The NSTableView is bound to a custom NSArrayController as its data source and delegate. The NSTableView only has one column that shows a string of text (NSTextFieldCell) in each row. The problem is that when the text ge

Issues implementing [NSArrayController replaceObjectsAtArrangedObjectIndexes: withObjects:]

2008-03-25 Thread Rob Petrovec
Hey, Since NSArrayController does not have 'replace' functionality, I'm trying to implement my own for performance reasons. Problem is, I keep getting an exception when my code runs. Here is a code snippit: - (void) replaceObjectsAtArrangedObjectIndexes:(NSIndexSet*)indexes withObjects:(

Re: Private Methods

2008-02-22 Thread Rob Petrovec
Lack of private methods is a serious flaw in Obj-C IMO. There are just as many reasons why someone would want to make a variable private as they would want to make a method private. For example if your writing a class that is part of a library that other developers will be using (quite co

<    1   2