Nullability question (NSEvent)

2016-06-27 Thread Stefan Haller
I see that -[NSEvent characters] is marked nullable; however, the documentation seems to say otherwise. (It says that it will raise an exception if the event is not a key event; apart from that, it will return an empty string when there are no characters to return, e.g. for dead keys.) Is this a d

Re: Avoid smooth scrolling when scrolling programmatically

2011-09-12 Thread Stefan Haller
Kyle Sluder wrote: > On Mon, Sep 12, 2011 at 12:07 AM, Stefan Haller > wrote: > > I need to set the scroll position of my NSScrollView programmatically, > > and I don't want it to scroll smoothly (if the user's "smooth scrolling" > > preferenc

Avoid smooth scrolling when scrolling programmatically

2011-09-12 Thread Stefan Haller
rollPoint; I haven't been able to figure out the details yet). I guess I could mess with NSUserDefaults, turning off smooth scrolling before calling scrollPoint and restoring it to what it was before afterwards, but this seems like a hack to me. Any other ideas? -- Stefan Haller Berlin,

Re: Setting cursor for subview of NSTextView

2010-03-13 Thread Stefan Haller
the cursor would still be reset to an arrow in certain cases. Thanks for the help (also to Douglas, who sent me private mail). -Stefan -- Stefan Haller Berlin, Germany http://www.haller-berlin.de/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.a

Setting cursor for subview of NSTextView

2010-03-12 Thread Stefan Haller
ES). Any ideas what else to try, or how to debug what's going on? Setting breakpoints at [NSCursor set] or [NSCursor arrowCursor] didn't get me very far yet. Thanks, Stefan -- Stefan Haller Berlin, Germany http://www.haller-berlin.de/ __

Re: Accepting files dragged from iTunes in a Cocoa app

2008-09-11 Thread Stefan Haller
> NSURL *url = nil; > > while((track = [enumerator nextObject])) { > url = [NSURL URLWithString:[track valueForKey:@"Location"]]; > > if([url isFileURL]) > ; // Do something with URL > } > } > > Stephen -- Stefan Haller Berlin, Germany htt

Re: Accepting files dragged from iTunes in a Cocoa app

2008-09-10 Thread Stefan Haller
Gregory Weston <[EMAIL PROTECTED]> wrote: > Stefan Haller wrote: > > > In a Carbon application I solved the problem by handling the > > kDragPromisedFlavorFindFile flavor, which worked quite well. How do I > > do this in a Cocoa app though? I can't find

Accepting files dragged from iTunes in a Cocoa app

2008-09-10 Thread Stefan Haller
a new file, but reference the existing file in the iTunes library. Any ideas? Thanks, Stefan -- Stefan Haller Berlin, Germany http://www.haller-berlin.de/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mod

Re: My windows don't cascade

2008-06-03 Thread Stefan Haller
Stefan Haller <[EMAIL PROTECTED]> wrote: > I have an NSDocument-based application that is still pretty close to the > Xcode template for "Cocoa Document-based application"; i.e. I subclass > NSDocument but not NSWindowController, and I implement -windowNibName > bu

My windows don't cascade

2008-06-02 Thread Stefan Haller
be always (0,0). Any idea what could cause this? Thanks, Stefan -- Stefan Haller Ableton http://www.ableton.com/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact th

Re: NSStream blocking behavior?

2008-05-08 Thread Stefan Haller
e only way to find out is to attempt a read : or a write operation (which could lead to a momentary block). The : NSStreamEventHasBytesAvailable and NSStreamEventHasSpaceAvailable : stream events have identical semantics. I'm not sure exactly what "momentary block" means here. -- S