Re: Funky file URLs from drag & drop

2012-05-11 Thread Quincey Morris
On May 11, 2012, at 16:58 , Rick Mann wrote: > NSString* path = [item stringForType: > @"public.file-url"]; > NSURL* url = [NSURL fileURLWithPath: > path]; You absolutely can't do this. A URL is not a path, not even whe

Re: __bridge_transfer on a method return value

2012-05-10 Thread Quincey Morris
On May 9, 2012, at 23:07 , Roland King wrote: > I'm using CFURLCreateStringByAddingPercentEscapes() because the NSString > version leaves '+' signs unescaped. If I used it directly in code I'd either > CFRelease it, or if assigned to an NSString, __bridge_transfer it. However I > want it as the

Re: monitoring changes in a local property

2012-05-09 Thread Quincey Morris
On May 9, 2012, at 19:56 , Koen van der Drift wrote: > In my case, the contentset of the array controller is bound to a tree > controller (which is bound to the MOC of my model). I fail to see how I > also bind it to an array. Well, as to a direct answer, I'm stumped. If the array controller

Re: monitoring changes in a local property

2012-05-09 Thread Quincey Morris
On May 9, 2012, at 18:48 , Koen van der Drift wrote: > Hmmm, an indexset just gives me an index, how do I get the object from it > that it belongs to? I think I still need to be able to access the > NSArrayController (that feeds the NSTableView) for that? The array controller is also bound to s

Re: saveDocument:

2012-05-09 Thread Quincey Morris
On May 9, 2012, at 02:45 , ecir hana wrote: > I apologize but I still don't quite understand. If I just > implement saveDocument: at the document and leave document controller > without it, the menu item is still disabled. When I add saveDocument: to > the controller as well, it works. I mean, if

Re: monitoring changes in a local property

2012-05-07 Thread Quincey Morris
On May 7, 2012, at 20:16 , Koen van der Drift wrote: > One of my viewcontrollers uses the representedObject to bind to the > NSArrayController that holds all the data for the application (OS X, ARC on). > I declared a local property mySelection (an NSArray) and bind it to the > representedObjec

Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare

2012-05-07 Thread Quincey Morris
On May 7, 2012, at 16:07 , Martin Wierschin wrote: > I'm sliding over the details of what you said because they're irrelevant for > my purposes. OK, but I'd *really* appreciate it if you'd avoid calling my replies senseless: >> On May 7, 2012, at 13:35 , Martin Wierschin wrote: >> >>> As Jens

Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare

2012-05-07 Thread Quincey Morris
On May 7, 2012, at 13:35 , Martin Wierschin wrote: > As Jens mentioned, that doesn't make any sense. What good is a localized > comparison method if not for sorting a list for display? I suppose you could > be implying that Cocoa's sorting methods aren't optimized to assume > comparisons are tr

Re: Window "snapping" to main screen

2012-05-07 Thread Quincey Morris
On May 7, 2012, at 00:30 , Quincey Morris wrote: > On May 7, 2012, at 00:14 , Eric Matecki wrote: > >>> mWindow = [[NSWindow alloc] initWithContentRect: contentSize styleMask: >>> styleMask backing: NSBackingStoreBuffered defer: YES]; > > I would assume that the c

Re: Window "snapping" to main screen

2012-05-07 Thread Quincey Morris
On May 7, 2012, at 00:14 , Eric Matecki wrote: >> mWindow = [[NSWindow alloc] initWithContentRect: contentSize styleMask: >> styleMask backing: NSBackingStoreBuffered defer: YES]; I would assume that the content rect is here assumed to be relative to the main screen. Have you tried 'initWithCon

Re: Problem parsing file in 64 bit build.

2012-05-07 Thread Quincey Morris
On May 7, 2012, at 00:22 , Graham Cox wrote: > Is using the syntax you suggested considered better form than #pragma,? I have a vague recollection that #pragma pack was already deprecated in GCC, so __attribute__ ((packed)) might be the more compatible choice, but finding trustworthy, non-out-o

Re: Problem parsing file in 64 bit build.

2012-05-06 Thread Quincey Morris
On May 6, 2012, at 23:30 , Quincey Morris wrote: > while they're only 4-bit aligned Er … 4-byte aligned. Also, be careful when debugging these with lldb. At some versions of lldb get the member offsets and struct size wrong in packed structs, so debugger member display is wrong, a

Re: Problem parsing file in 64 bit build.

2012-05-06 Thread Quincey Morris
On May 6, 2012, at 22:51 , Graham Cox wrote: > Could this be caused by the 64 bit compiler padding out my structures in a > different way for 64-bit builds? Yes, I believe in 64-bit builds 8-byte data types are 8-byte aligned, while they're only 4-bit aligned in 32-bit builds -- or something li

Re: Issue when hiding NSTableColumn while resizing

2012-05-06 Thread Quincey Morris
On May 1, 2012, at 06:40 , Thibault Martin-Lagardette wrote: > The problem in the end is that not only do I have a visual glitch, but this > also feels like a very hacky/dirty solution, and hence, not the way to go. > I feel like I probably should not be trying to hide columns while some others >

Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare

2012-05-05 Thread Quincey Morris
On May 5, 2012, at 19:45 , Jens Alfke wrote: > On May 5, 2012, at 4:51 PM, Kyle Sluder wrote: > >> If I understand Quincey correctly, that's exactly what he's saying: the >> semantics of localizedCaseInsensitiveCompare: might be such that it is not >> appropriate for such algorithms. > > But t

Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare

2012-05-05 Thread Quincey Morris
On May 5, 2012, at 15:43 , Martin Wierschin wrote: > All comparisons, including those used for the original sorting, were done > using the same comparison method/locale. And the sort order and search order > need to be same, otherwise any algorithms that rely on the transitive nature > of compa

Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare

2012-05-05 Thread Quincey Morris
On May 5, 2012, at 14:07 , Martin Wierschin wrote: > For example, consider the following sorted list of strings: > > "aaa" < "laso" < "lasso" < "zzz" > > I would expect that any new string I want to insert into this list would > compare so that it has just one point of insertion. But this

Re: how to prevent TableView update on key repeat?

2012-05-04 Thread Quincey Morris
On May 4, 2012, at 12:39 , Marc Respass wrote: > This is working great. What do you think? "Working great" sounds great! If you want to go the extra mile for your users, you could try something like this: CMTableView *tableview = [notification object]; NSTimeInterval delayInterval

Re: how to prevent TableView update on key repeat?

2012-05-04 Thread Quincey Morris
On May 4, 2012, at 08:25 , Marc Respass wrote: > When I set the delay to zero, there is no delay. My selector is called > immediately as if I didn't change anything. Not exactly. Consider what happens when you mash the arrow key. Thus, there might be multiple (normal) key events queued. The se

Re: how to prevent TableView update on key repeat?

2012-05-04 Thread Quincey Morris
On May 3, 2012, at 19:38 , Graham Cox wrote: > You probably should do this as your last line: > > [self performSelector: withObject:nil afterDelay:[NSEvent > keyRepeatInterval] + 0.1]; > > because the key repeat rate is set by the user in the "Keyboard" system > preferences and can change. I

Re: how to prevent TableView update on key repeat?

2012-05-03 Thread Quincey Morris
On May 3, 2012, at 16:07 , Marc Respass wrote: > Do I have that correct? Yes, you do. :) Another way to think about it is this: the cancel suppresses all the selector performs except the last one. (There's *always* a last one because the cancel is done first.) The last one is the only one you

Re: how to prevent TableView update on key repeat?

2012-05-03 Thread Quincey Morris
On May 3, 2012, at 15:27 , Marc Respass wrote: > I ended up finding a solution that almost works perfectly. > > - (void)tableViewSelectionDidChange:(NSNotification *)aNotification; > { > NSEvent *event = [NSApp currentEvent]; > > if(event != nil && [event type] == NSKeyDown && [event isA

Re: Xcode warns about missing protocol definition, even though @protocol is used

2012-05-03 Thread Quincey Morris
On May 3, 2012, at 15:13 , Kyle Sluder wrote: > Except the compiler produces the warning on the @interface, which provides no > information about whether the class actually implements the required protocol > methods. You don't need to redeclare methods from protocols you adopt. The > logical pl

Re: how to prevent TableView update on key repeat?

2012-05-03 Thread Quincey Morris
On May 3, 2012, at 13:46 , Marc Respass wrote: > Can anyone point me in the right direction on this? How can I prevent > tableViewSelectionDidChange: from being called when the user is holding the > up or down arrow and trying to scroll rapidly through the table so I only > update when they sto

Re: NSTableView doesn't show data until I click on a header

2012-05-03 Thread Quincey Morris
On May 3, 2012, at 03:52 , Koen van der Drift wrote: > Thanks! I was indeed using removeAtIndexes: , but set seems a bit > easier to do. The setter is not quite so easy at it seems. You should declare the property with the 'copy' option, so that the parameter is copied by any @synthesized sett

Re: No validation with a bound NSTableView and custom NSFormatter

2012-05-01 Thread Quincey Morris
On May 1, 2012, at 20:09 , Ben Kennedy wrote: > The thing about all this is that a few revs back, when I was using a dumb > array with NSTableViewDataSource and no bindings, I was getting the > validation behaviour for free. Now it's gone. I guess I should re-trace my > steps and try to figur

Re: No validation with a bound NSTableView and custom NSFormatter

2012-05-01 Thread Quincey Morris
On May 1, 2012, at 19:20 , Ben Kennedy wrote: > The issue I'm still having is that non-bound columns (i.e., those controlled > by the latter two NSTableViewDataSource methods) are not enforcing validity > when the attached formatter returns NO from > getObjectValue:forString:errorDescription:.

Re: No validation with a bound NSTableView and custom NSFormatter

2012-05-01 Thread Quincey Morris
On May 1, 2012, at 16:23 , Ben Kennedy wrote: > I confess to have mis-described my situation somewhat: while most columns > were bound, several instead used the classical NSTableViewDataSource style, > including the one for which I'm having the validation trouble. Sure enough, > when I connect

Re: No validation with a bound NSTableView and custom NSFormatter

2012-05-01 Thread Quincey Morris
On May 1, 2012, at 14:55 , Kyle Sluder wrote: > That seems to be at odds with the Bindings documentation: > https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaBindings/Concepts/MessageFlow.html > > The validation should be triggered as soon as the text field tries to co

Re: No validation with a bound NSTableView and custom NSFormatter

2012-05-01 Thread Quincey Morris
On May 1, 2012, at 14:23 , Ben Kennedy wrote: > I have an NSTableView whose data source is bound to an NSArrayController. To > one of its columns (displaying a custom type) I have attached a custom > NSFormatter subclass. The NSFormatter correctly returns NO from > getObjectValue:forString:er

Re: NSTableView doesn't show data until I click on a header

2012-04-30 Thread Quincey Morris
On Apr 30, 2012, at 09:27 , Koen van der Drift wrote: > I am using an NSMutableArray to store the myObjects, the table > displays several properties of each object in seperate columns. So > the order in which the objects are stored in the array is not > critical, they will be ordered once display

Re: NSTableView doesn't show data until I click on a header

2012-04-30 Thread Quincey Morris
On Apr 30, 2012, at 04:53 , Koen van der Drift wrote: > Thanks for the link. I am confused now, since it says: > > "Indexed Accessor Pattern > [...] > There are indexed accessors which return data from the collection (the > getter variation) and mutable accessors > that provide an interface for m

Re: NSKeyValueBindingCreation Protocol

2012-04-28 Thread Quincey Morris
On Apr 28, 2012, at 15:52 , Richard Somers wrote: > Actually now that I have done a little more research it appears that my > question regarding programmatically calling -unbind: when the window closes > is not related to which memory model I am using: GC, ARC or traditional RR. > > GC is not

Re: NSKeyValueBindingCreation Protocol

2012-04-28 Thread Quincey Morris
On Apr 28, 2012, at 10:17 , Richard Somers wrote: > I have a number of controls with custom bindings that are programmatically > added to a view hierarchy in a window. Calling –unbind: on these controls > when the window is closes is a challenge. > > But it actually does not seem to matter. If

Re: activating Delete menu item through binding

2012-04-24 Thread Quincey Morris
On Apr 21, 2012, at 19:18 , Koen van der Drift wrote: > So, I solved it as follows. I created a deleteObjects IBAction in my > AppController class invoked by the delete menuItem. To remove the objects, I > am more or less following the code in Hillegass' book, chapter 15 on > NSAlerts. In thi

Re: activating Delete menu item through binding

2012-04-16 Thread Quincey Morris
On Apr 16, 2012, at 16:18 , Koen van der Drift wrote: > Still a bit confused here. My tableview from which I want to delete > items is controlled by an NSViewController, and populated by an > NSArrayController that is again hooked up to my CoreData model. Yes, that's an awkward case. Although a N

Re: activating Delete menu item through binding

2012-04-15 Thread Quincey Morris
On Apr 15, 2012, at 11:53 , Koen van der Drift wrote: > Interestingly, the 'Select All' menu item that sits just under the Delete > item (and both of them were already present when I started my project) works > 'out of the box' for my NSTableView, I did not set any responders or do any > valid

Re: activating Delete menu item through binding

2012-04-15 Thread Quincey Morris
On Apr 15, 2012, at 11:13 , Koen van der Drift wrote: > My MainMenu.nib has a 'Delete' menu item that is mapped to the Delete key. > I'd like to use that to remove items from my NSTableView that is connected to > an NSArrayController. So in the bindings for the Delete menu item, I set > it's

Re: Opening a gap in NSTableView during drag and drop

2012-04-14 Thread Quincey Morris
On Apr 13, 2012, at 08:02 , Andrew Madsen wrote: > I've got a simple, single-column, view-based NSTableView with items in it > that can be dragged to reorder them. During drag and drop, I'd like to make > it so that a gap for the item-to-be-dropped opens up at the location under > the mouse. Ga

Re: How to bind to NSMutableArray that may contain zero objects?

2012-04-10 Thread Quincey Morris
On Apr 10, 2012, at 07:34 , Michael Crawford wrote: > The problem I'm trying solve is that I have a crashing bug in the UI when an > underlying array managed by an NSArrayController contains zero objects. The > controls bound to the array-controller include an NSPopUpButton, an > NSTextField,

Re: How to bind to NSMutableArray that may contain zero objects?

2012-04-03 Thread Quincey Morris
On Apr 3, 2012, at 15:29 , Michael Crawford wrote: > Using and NSArrayController I'd like to bind the controller to an instance of > NSMutableArray, which under certain circumstances may contain zero objects. > I don't have any real experience with NULL placeholders but I assume this > situati

Re: Trouble with code signing and app store submission

2012-03-30 Thread Quincey Morris
On Mar 29, 2012, at 23:41 , Martin Hewitson wrote: > According to Keychain Access, all my certificates have a private key. At > least I can expand the certificate and see the private key. Do I need to do > something to tell Xcode about these? I followed the usual steps of installing > certifica

Re: mogenerator and key path error

2012-03-27 Thread Quincey Morris
On Mar 27, 2012, at 11:56 , Ayers, Joseph wrote: > 2012-03-27 14:39:38.533 Roboplasm[74089:403] Cocoa Bindings: Error accessing > value for key path tapes of object (from bound > object [entity: tapes, number of selected > objects: 0]): [ valueForUndefinedKey:]: this > class is not key value

Re: mogenerator and key path error

2012-03-27 Thread Quincey Morris
On Mar 27, 2012, at 11:12 , Ayers, Joseph wrote: > In mainMenu.xib I have a NSArrayController. TapesController:NSArrayController > With ObjectController mode set to EntityName > and the EntityName set to tapes The entity name should be "Tapes", not "tapes". _

Re: File types...

2012-03-26 Thread Quincey Morris
On Mar 26, 2012, at 23:14 , Randy Widell wrote: > Now…everything goes wrong when I try to open a file. Opening the recently > saved document just gives the error: "The document '…' could not be opened. > My App cannot open files of this type." If I try to select the file in the > open panel,

Re: makeObjectsPerformSelector on a sub class

2012-03-21 Thread Quincey Morris
On Mar 21, 2012, at 13:23 , Quincey Morris wrote: > One thing to check: if your 'scrambleState' actually has a parameter: > > - (void) scrambleState: … > > Then you need '@selector(scrambleState:)', not '@selector(scrambleState)'. > It

Re: makeObjectsPerformSelector on a sub class

2012-03-21 Thread Quincey Morris
On Mar 21, 2012, at 07:56 , Pascal Harris wrote: > @interface gameTile : UIView > > And I've successfully drawn my tiles onto the iOS Simulator screen. > > Now I want to scramble the state of each of the tiles. In the game > controller, I'm using the following code: > > [[self.view subviews]

Re: There's obviously something I don't understand about autorelease.

2012-03-19 Thread Quincey Morris
On Mar 19, 2012, at 11:48 , Matt Neuburg wrote: > As long as we're just dreaming up our own linguistic world, I'd suggest that > instead of "owning" we say "owning-copying". I've never liked the way "copy" > implies "retain". The word "retain" tells you something very important, > namely that t

Re: There's obviously something I don't understand about autorelease.

2012-03-17 Thread Quincey Morris
On Mar 17, 2012, at 20:50 , Roland King wrote: > Did it really? No, I didn't notice your sample code was the *good* code. :) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

Re: There's obviously something I don't understand about autorelease.

2012-03-17 Thread Quincey Morris
On Mar 17, 2012, at 20:03 , Ken Thomases wrote: > It's an important part of the semantics of a property whether it holds a > strong or weak reference. On Mar 17, 2012, at 20:04 , Greg Parker wrote: > The memory management behavior of a property frequently is part of the public > interface. For

Re: There's obviously something I don't understand about autorelease.

2012-03-17 Thread Quincey Morris
On Mar 17, 2012, at 18:59 , Roland King wrote: > I will just need to be more diligent checking ivars against the properties > they support to ensure they match Clang *was* checking this, at least in Xcode 4.2. We had a thread a couple of months ago discussing this, in a case where the check w

Re: Making a NSPanel to look active

2012-03-14 Thread Quincey Morris
On Mar 14, 2012, at 03:10 , bassrelig...@free.fr wrote: > I also want the NSWindow to remain the key window so it still receive key > events This is the heart of the problem. By making your panel's table view *look* active, you're making a promise to your users that keystrokes work in the table

Re: ivar access during -finalize

2012-03-11 Thread Quincey Morris
On Mar 10, 2012, at 23:18 , Eric Wing wrote: > I don't disagree that finalizers are hard and need to be approached > with great care. And I agree that all 4 of your points are valid. > However, I think this description of the retain cycle problem might be > a little over-dramatic. Retain cycles ha

Re: ivar access during -finalize

2012-03-10 Thread Quincey Morris
On Mar 10, 2012, at 17:08 , jonat...@mugginsoft.com wrote: > On 10 Mar 2012, at 22:51, Eric Wing wrote: > >> Just another angle on your original problem, have you considered using >> CFRetain and CFRelease on _myIvar? These are still meaningful in >> garbage collection mode. Using CFRetain when y

Re: Accessing array in thread safe way

2012-03-09 Thread Quincey Morris
On Mar 9, 2012, at 00:30 , CoGe - Tamas Nagy wrote: > Thanks Quiencey to pointing this out, however, what you suggest instead of > the current implementation? What I use for this class is putting and/or > update objects into it from different threads, then access it from an other > (reader) th

Re: Accessing array in thread safe way

2012-03-08 Thread Quincey Morris
On Mar 8, 2012, at 14:29 , Charles Srstka wrote: > For those two examples, it seems like having the default accessor return an > immutable array via copy would solve the issue. It wouldn't solve, e.g., the possibly inconsistency between 'array.count' and a subsequent reference, unless it was co

Re: Accessing array in thread safe way

2012-03-08 Thread Quincey Morris
On Mar 8, 2012, at 12:18 , CoGe - Tamas Nagy wrote: > I should subclass NSMutableArray because I had a project which used > NSMutableArray (calls) before, but was not thread safe. Anyway, I can't > really understand why it would be _really_ better to implement just > accessors, but maybe you co

Re: ivar access during -finalize

2012-03-08 Thread Quincey Morris
On Mar 8, 2012, at 09:09 , Nick Zitzmann wrote: > +defaultManager is not thread-safe IIRC. It's currently listed as thread-safe: https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html I believe there was histo

Re: ivar access during -finalize

2012-03-08 Thread Quincey Morris
On Mar 8, 2012, at 07:39 , jonat...@mugginsoft.com wrote: > Consider: > > - (void)finalize > { > // a single reference to _myIvar is held by self > [[NSFileManager defaultManager] removeItemAtPath:_myIvar error:NULL] > [super finalize]; > } > I had initially assumed that _myIva

Re: textfield problem

2012-03-02 Thread Quincey Morris
On Mar 2, 2012, at 12:35 , H. Miersch wrote: > i have a problem with a text field that won't accept any input. the textfield > is one of three on a panel that appears only when the input is needed. I > activate the panel with this line:[app beginSheet:Sheet > modalForWindow:mainWindow modal

Re: Suggestions for forcing NSSlider to some values, without tickmarks

2012-03-01 Thread Quincey Morris
On Mar 1, 2012, at 13:18 , Sean McBride wrote: > I have a continuous linear NSSlider who's range is -180 to 180 degrees. I > don't want tick marks because any value is acceptable. However, the value > zero is important, and I need for the user to be able to get to exactly 0.0 > (0.1 or whatev

Re: Who is responsible for removing observers in longer key paths

2012-03-01 Thread Quincey Morris
On Mar 1, 2012, at 13:23 , Per Bull Holmen wrote: > OK. I haven't thought of KVO-compliance at the level > because no values can change at this level. Only the controller's > parameterInfo property can change, by replacing it. That's what I > meant by calling the parameterInfo object immutable. N

Re: Who is responsible for removing observers in longer key paths

2012-03-01 Thread Quincey Morris
On Mar 1, 2012, at 11:26 , Per Bull Holmen wrote: > parameterInfo.. > > "parameterInfo" is a literal key name, maps to a > parameter in a plug-in, and must be resolved at run-time. > is one of several attribute names, such as "minValue", > "maxValue" etc. There is a value object that represent

Re: How to: NSTableView redisplay

2012-02-29 Thread Quincey Morris
On Feb 28, 2012, at 20:39 , Erik Stainsby wrote: > NSTableView - I have an NSTableViewDataSource with an array holding the > objects to be represented in the table. > I add a new object to the array, I call [table reloadData]; and I follow that > with [table setNeedsDisplay:YES]; > Bupkiss. Nada

Re: Question about KVC-compliance and bindings

2012-02-28 Thread Quincey Morris
On Feb 28, 2012, at 07:24 , Per Bull Holmen wrote: > Suppose I want to make a controller, which allows a view to bind to the > keyPath: > > mainBranch.subBranch.attribute > > There will be a large range of theoretical subBranch.attribute > combinations, but only a few of these will actually be

Re: How to support larger NSView hierarchy?

2012-02-27 Thread Quincey Morris
On Feb 27, 2012, at 20:46 , Graham Cox wrote: > Jeez. Indeed. Especially as it's usually taken as a given that large numbers of NSViews aren't going to perform well. Trying to make the scenario work might be quixotic at best. However, two thoughts did spring to mind: 1. It might be easier (an

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-25 Thread Quincey Morris
On Feb 24, 2012, at 15:26 , Scott Ribe wrote: > Thing is: if(foo) is equivalent to if(foo != 0), which I think results in 0 > being treated as a pointer, not the pointer being cast to int, anyway if > if(foo) could fail, so could if(foo != 0)... Also I think "Except as > previously specified...

Re: NSView mouseDown truncated coordinates

2012-02-24 Thread Quincey Morris
On Feb 23, 2012, at 14:15 , Markus Spoettl wrote: > Mouse movement highlighting must happen when the mouse moves. At that time, > only the mouse move coordinates are known. They correspond with what happens > on the screen, so highlighting works as expected. > > Now a mouse-down comes along wit

Re: NSView mouseDown truncated coordinates

2012-02-23 Thread Quincey Morris
On Feb 23, 2012, at 12:09 , Markus Spoettl wrote: > This is what I do: > > 1) On -mouseMoved: locate object under the cursor and highlight it so the > user knows which one of them will be operated on when the mouse goes down. > > 2) On -mouseDown: locate object under the cursor and prepare it f

Re: NSView mouseDown truncated coordinates

2012-02-23 Thread Quincey Morris
On Feb 23, 2012, at 10:27 , Markus Spoettl wrote: > I'm using a mouse and the cursor doesn't move between -mouseMove: and > -mouseDown: (on screen). If the device would be capable of reporting > sub-pixel movements (which may not be reported by moving the cursor), I guess > it would have done s

Re: NSView mouseDown truncated coordinates

2012-02-23 Thread Quincey Morris
On Feb 23, 2012, at 04:04 , Markus Spoettl wrote: > As an illustration for the list, I have logged coordinates of a mouse move > and a subsequent mouse down event that followed the move event: > > mouseMovedToPoint:NSPoint: {217.15625, 343.3984375} > mouseDownAtPoint:NSPoint: {217, 344} > > It

Re: copy & isEqual nightmares

2012-02-16 Thread Quincey Morris
On Feb 16, 2012, at 11:44 , Ken Thomases wrote: > Well, the documentation for -[NSDictionary isEqualToDictionary:] >

Re: copy & isEqual nightmares

2012-02-16 Thread Quincey Morris
On Feb 16, 2012, at 08:30 , Ken Thomases wrote: > A dictionary is equal to any other dictionary with equal keys and values. > That's true for a mutable dictionary, too. Mutating a mutable dictionary > will changes which other objects it's equal to. Really? Well, OK. I can't find any documen

Creating a file using NSURL

2012-02-15 Thread Quincey Morris
Am I missing something obvious here? I'm trying to create an empty file (prior to using a NSFileHandle to write its contents), and I have a URL for the place to create it, and I want to avoid path-based API where possible, and I'm targeting 10.6. The only URL-based file creation API I know of i

Re: NSEvent locationInWindow undefined for non-mouse events, how to catch?

2012-02-15 Thread Quincey Morris
On Feb 15, 2012, at 08:12 , Sean McBride wrote: > In the meantime, I'll create a category method that wraps locationInWindow > and delegates to mouseLocation or similar otherwise. Depending on how correct you want to be, you do have to be a bit cautious with this. +[NSEvent mouseLocation] isn't

Re: copy & isEqual nightmares

2012-02-15 Thread Quincey Morris
On Feb 15, 2012, at 00:50 , Uli Kusterer wrote: > Why would there ever be an object that is not -isEqual: to itself? Now you've > lost me. Sorry, it was a poor choice of words. I was just acknowledging the difference between (say) a NSMutableDictionary whose internal state changes over time wi

Re: copy & isEqual nightmares

2012-02-14 Thread Quincey Morris
On Feb 14, 2012, at 04:32 , James Montgomerie wrote: > Take a mutable string as the canonical example - obviously its hash should > change when its contents changes (and it should no longer be isEqual: with a > copy of its older self). It's up to the user of the string to ensure that > they don

Re: copy & isEqual nightmares

2012-02-13 Thread Quincey Morris
On Feb 13, 2012, at 01:14 , Uli Kusterer wrote: > The hash should be calculated from your object's values. If your object's > ivars (those that are relevant to the hash) can be changed after creation, > you must always recalculate your hash whenever one of them is modified (or > mark it as inva

Re: copy & isEqual nightmares

2012-02-12 Thread Quincey Morris
On Feb 12, 2012, at 16:25 , James Maxwell wrote: > I have an object with isEqual set up to help me limit the number of "unique" > objects I can put in a Dictionary. Basically, the object has a few properties > which account for "equality", and some properties that don't matter. For > example, p

Re: Lion: Lock documents and custom undomanager

2012-02-10 Thread Quincey Morris
On Feb 10, 2012, at 15:03 , Mike Abdullah wrote: > My line of thinking: > > Each time one of your undo managers is about to close its top-level group, > register that with the doc's main undo manager. Thus the doc's undo manager > will see the change while locked, prompt the user to unlock, and

Re: How to get bookmarks data for non-existing files

2012-02-08 Thread Quincey Morris
On Feb 8, 2012, at 18:20 , Gerriet M. Denkmann wrote: > The only keys which seem to work for an non-existing file seem to be: > NSURLNameKey > NSURLIsDirectoryKey > NSURLIsRegularFileKey > NSURLIsSymbolicLinkKey > NSURLIsVolumeKey > (I did try many, though not all

Re: How to get bookmarks data for non-existing files

2012-02-07 Thread Quincey Morris
On Feb 7, 2012, at 22:58 , Gerriet M. Denkmann wrote: > This works fine (usually): > BOOL isStale; > NSError *outError; > NSURL *url =[ NSURL URLByResolvingBookmarkData: > bookmarksData >

Re: Lion's 'restore windows' vs. app with initial 'login'

2012-02-07 Thread Quincey Morris
On Feb 7, 2012, at 09:27 , Eric Slosser wrote: > I've got an app that has a login step at the beginning. Until the user has > logged on, it's inappropriate to display the documents that were open when > the last user quit. Lion's 'restore windows' feature happens while my login > dialog is st

Re: NSTextField recieves string but does not display it?

2012-02-05 Thread Quincey Morris
On Feb 5, 2012, at 00:18 , Erik Stainsby wrote: > The web browser instantiates a subclassed WebView which declares & implements: > > @interface RSSWebView : WebView > > @property (retain) IBOutlet RSSRuleEditorController * ruleEditor; > - (IBAction) quickSetActionSelector:(id)sender; > @end > >

Re: NSTextField recieves string but does not display it?

2012-02-04 Thread Quincey Morris
On Feb 4, 2012, at 19:11 , Erik Stainsby wrote: > I have two windows. A is the source, B is the destination. A context menu > action in A sets a string value on a message. The message arrives in window > B, in a view which sets the stringValue of an NSTextField. I then read the > stringValue ba

Re: PDFView focus ring

2012-02-04 Thread Quincey Morris
On Feb 4, 2012, at 16:17 , Graham Cox wrote: > The way I've done this is to handle the focus ring in the view's -drawRect > method. You need to focus on the superview so you can draw outside your > frame, but that's not a problem - just do it after you've drawn the rest of > your normal content

Re: Restoring custom view scroll position

2012-02-02 Thread Quincey Morris
On Feb 2, 2012, at 14:06 , Quincey Morris wrote: > I have a window nib that contains a scroll view controlling a custom view. > This custom view has an essentially arbitrary size in the nib -- it's resized > at window load time to a suitable size. (It's a kind of canvas, so

Re: Selected text in NSTextField

2012-02-02 Thread Quincey Morris
On Feb 2, 2012, at 14:23 , Graham Cox wrote: > On 31/01/2012, at 7:14 PM, Dany Golubitsky wrote: > >> I am interested in opening NSAlert window that includes editable text field. > > > > Well, that's pretty daft :) > > NSAlert isn't designed for that purpose, so why try to make it fit somewhe

Restoring custom view scroll position

2012-02-02 Thread Quincey Morris
Has anyone successful implemented Lion window state restoration that properly restores the scroll position for a custom view that's a scroll view's "document" view? The behavior that seems to break this is changing the frame of the custom view. AFAICT, it goes like this: I have a window nib th

Re: Addressing handlers in the First Responder list of another window ?

2012-02-02 Thread Quincey Morris
On Feb 2, 2012, at 11:13 , Erik Stainsby wrote: > I have a context menu in one window (A) from which I need to dispatch to > another (B) window's First Responder list. > Do I need to bring in a reference to window B (or it's controller) into the > nib/code of window A ? This seems to go against lo

Re: Window/Controller, View/Controller, View ?

2012-02-01 Thread Quincey Morris
On Feb 1, 2012, at 09:00 , Fritz Anderson wrote: > Bindings can be your friend here. In simple cases, having an > NSObjectController link between controls and .representedObject can do a lot > for you. I'm not sure how it improves the situation to have a NSObjectController. You can bind direct

Re: Window/Controller, View/Controller, View ?

2012-01-31 Thread Quincey Morris
On Jan 31, 2012, at 07:32 , Erik Stainsby wrote: > Seeking clarity about the display hierarchy: > > I have an application for a form which would have several variant sections, > the exact configuration of which would be established in context at run time. > I'm thinking to setup the variants a

Re: NSPopUpButton Binding Frustration

2012-01-29 Thread Quincey Morris
On Jan 29, 2012, at 22:32 , Seth Willits wrote: > The popup should display the names, but I want the selected item bound to > fileType which is one of the UTIs. By my reading of the documentation, this > _should be very simple_. > > Bind: > content -> fileTypes* > contentValues -> fileTypeNames

Re: Key Value Observing of NSMutableArray inside an object

2012-01-28 Thread Quincey Morris
On Jan 28, 2012, at 13:28 , Mikael Wämundson wrote: > I have put an NSMutableArray (dataObjectArray) in my class > DataObjectCollection. I have also made it possible to add objects to > DataObjectCollection and hence the array by implementing > - (void)addDataObject:(DataObject *)theDataObject >

Re: Recently Opened in Doc

2012-01-28 Thread Quincey Morris
On Jan 28, 2012, at 11:57 , Brad Stone wrote: > Thanks Quincey, I've already subclassed my NSDocumentController and I use > noteNewRecentDocument to prevent my index file from showing up in the list. > The code never gets past the continue call because every time this method is > called the o

Re: Recently Opened in Doc

2012-01-28 Thread Quincey Morris
On Jan 28, 2012, at 08:19 , Brad Stone wrote: > I have a shoebox app like iPhoto where the actual filename is irrelevant to > the user. I control the file name. > > What I'd like to do is just capture the menu items before they're displayed > and change the menu titles into something releva

Re: Where to implement alert ?

2012-01-24 Thread Quincey Morris
On Jan 24, 2012, at 13:03 , Luc Van Bogaert wrote: > Assume I have a document object with an array object as a property, and an > associated window controller, with a removeObject: method which is called > from the menu. If I wanted to alert the user before actually removing an > object from th

Re: NSSlider and arrangedObjects

2012-01-21 Thread Quincey Morris
On Jan 21, 2012, at 00:54 , Ken Thomases wrote: > Table columns do have special handling for array-valued bindings. It's that > they distribute the array values among their rows. Table columns are not > special in being able to bind through collection properties. That's a > feature of NSArra

Re: NSSlider and arrangedObjects

2012-01-21 Thread Quincey Morris
On Jan 19, 2012, at 03:03 , Tobias Wood wrote: > I am attempting to bind an NSSlider to a property of every object in an > NSArrayController, rather than just the current selection. There are other > properties that are bound to the selection, but this particular one I want to > change for ever

Re: Embedded Library in Cocoa App

2012-01-19 Thread Quincey Morris
On Jan 19, 2012, at 16:37 , John Nairn wrote: > But then I tested on another Mac (10.5.8) and I still get the > > dyld: unknown required load command 0-x8022 > > error message with no more help. If I remove the library from my app resource > on the 10.6.8 Mac, it does fail but gives a bette

<    12   13   14   15   16   17   18   19   20   21   >