Re: NSTextfield focus in contextual menu

2013-01-17 Thread Kyle Sluder
On Thu, Jan 17, 2013, at 12:07 PM, Tamas Nagy wrote: > Well, I came up with a solution. I subclassed NSTextfield with > > -(void)viewDidMoveToWindow { > > [self selectText:self]; > } > > and no it works as expected. When the menu pops out, the focus is on the > textfield. Glad it works,

Issue with Core Data Mapping Model

2013-01-17 Thread John Brayton
Hi, I am building a mapping model between two versions of my Core Data model, and I am encountering a strange issue: * If I define six of the seven entity mappings I need in the mapping model, migrating the data works as expected. * When I add the seventh entity mapping, the migration fails wi

Re: Using NSSavePanel to export to UTTypeFolder without a file extension.

2013-01-17 Thread Thomas Bunch
All good thoughts, but hold the phone. I think I have a mishmash a lot of old deprecated info plist keys and outright misapprehensions in my Info.plist, especially under CFBundleDocumentTypes and UTExportedTypeDeclarations. I think the file extension swapping will behave correctly once I've got

Re: Using NSSavePanel to export to UTTypeFolder without a file extension.

2013-01-17 Thread Quincey Morris
On Jan 17, 2013, at 16:20 , Thomas Bunch wrote: > Yes, in fact, I do exactly this. It's kind of suboptimal, in that NSSavePanel > will first give you a warning: > > > “Foo.oplx” already exists. Do you want to replace it?” and so on… the user > will probably reflexively accept that one. > > T

Re: Changing color in NSColorPanel without message

2013-01-17 Thread Graham Cox
On 18/01/2013, at 11:13 AM, Andy Lee wrote: > The OP actually wants to *suppress* changing of color. But good to know. Yep, I misremembered - helps to actually re-read the OPs message before commenting... :| However, it does incidentally solve that problem, in most cases, because the messag

Programmatically Determining the Rendered Size of an NSTextView

2013-01-17 Thread Keary Suska
I am implementing a print merge function in my application, so I essentially need to take a template in an NSTextView, interpolate values, then add it to a growing view of some kind to be later printed. I have everything working well except how to concatenate the multiple "views" into a single v

Re: Using NSSavePanel to export to UTTypeFolder without a file extension.

2013-01-17 Thread Thomas Bunch
Yes, in fact, I do exactly this. It's kind of suboptimal, in that NSSavePanel will first give you a warning: “Foo.oplx” already exists. Do you want to replace it?” and so on… the user will probably reflexively accept that one. Then we check and see that you're asking to dump a folder of web stu

Re: Changing color in NSColorPanel without message

2013-01-17 Thread Andy Lee
On Jan 17, 2013, at 6:44 PM, Graham Cox wrote: > > On 18/01/2013, at 9:19 AM, Andy Lee wrote: > >> o at least for color wells, changeColor: isn't the mechanism causing them to >> change color when you set the color panel's color. I would think they must >> be listening for the notification --

Re: Changing color in NSColorPanel without message

2013-01-17 Thread Graham Cox
On 18/01/2013, at 9:19 AM, Andy Lee wrote: > o at least for color wells, changeColor: isn't the mechanism causing them to > change color when you set the color panel's color. I would think they must be > listening for the notification -- but I tried telling the color well to stop > observing

Re: Changing color in NSColorPanel without message

2013-01-17 Thread Andy Lee
On Jan 17, 2013, at 5:47 PM, Ken Thomases wrote: > On Jan 17, 2013, at 4:19 PM, Andy Lee wrote: > >> On Jan 17, 2013, at 4:45 PM, Andy Lee wrote: >> >>> On Jan 17, 2013, at 2:53 PM, Ken Thomases wrote: >>> On Jan 16, 2013, at 2:47 PM, Melvin Walker wrote: > Is it possible to

Re: Using NSSavePanel to export to UTTypeFolder without a file extension.

2013-01-17 Thread Quincey Morris
On Jan 17, 2013, at 14:12 , Thomas Bunch wrote: > Launch, take your "document" (very much a stub), File -> Export…, "My Flat > Format". Now File -> Export… again but this time pick "My HTML Folder > Export". If you have your file extensions visible you'll see at this point > that the extension

Re: Changing color in NSColorPanel without message

2013-01-17 Thread Ken Thomases
On Jan 17, 2013, at 4:19 PM, Andy Lee wrote: > On Jan 17, 2013, at 4:45 PM, Andy Lee wrote: > >> On Jan 17, 2013, at 2:53 PM, Ken Thomases wrote: >> >>> On Jan 16, 2013, at 2:47 PM, Melvin Walker wrote: >>> Is it possible to programmatically change color (using -setColor:) in NSCol

Re: Changing color in NSColorPanel without message

2013-01-17 Thread Andy Lee
On Jan 17, 2013, at 2:53 PM, Ken Thomases wrote: > On Jan 16, 2013, at 2:47 PM, Melvin Walker wrote: > >> Is it possible to programmatically change color (using -setColor:) in >> NSColorPanel without it sending a changeColor: message to the first >> responder? >> >> We'd like it to just refle

Re: Changing color in NSColorPanel without message

2013-01-17 Thread Andy Lee
On Jan 17, 2013, at 4:45 PM, Andy Lee wrote: > On Jan 17, 2013, at 2:53 PM, Ken Thomases wrote: > >> On Jan 16, 2013, at 2:47 PM, Melvin Walker wrote: >> >>> Is it possible to programmatically change color (using -setColor:) in >>> NSColorPanel without it sending a changeColor: message to th

Using NSSavePanel to export to UTTypeFolder without a file extension.

2013-01-17 Thread Thomas Bunch
Hi folks, NSSavePanel does not like UTTypes with no file extension. Under PowerBox, I can't find a good workaround. One of OmniPlan's export types is a directory full of HTML and associated resources. Being an old NeXT guy, I immediately called this a .htmld file, but when the feature was debu

Re: Changing color in NSColorPanel without message

2013-01-17 Thread Andy Lee
On Jan 17, 2013, at 2:53 PM, Ken Thomases wrote: > On Jan 16, 2013, at 2:47 PM, Melvin Walker wrote: > >> Is it possible to programmatically change color (using -setColor:) in >> NSColorPanel without it sending a changeColor: message to the first >> responder? >> >> We'd like it to just refle

Re: CALayer renderInContext changes zPosition of some child layers

2013-01-17 Thread Thomas Bunch
On Jan 5, 2013, at 7:29 AM, David Duncan wrote: > On Jan 3, 2013, at 12:46 AM, Markus Spoettl wrote: > >> […] >> I've been debugging this one for quite a while until I realized that missing >> layers are not missing but somehow their zPosition got messed up so they >> ended up below another

Re: NSTextfield focus in contextual menu

2013-01-17 Thread Tamas Nagy
Well, I came up with a solution. I subclassed NSTextfield with -(void)viewDidMoveToWindow { [self selectText:self]; } and no it works as expected. When the menu pops out, the focus is on the textfield. Tamas On Jan 17, 2013, at 8:54 PM, Kyle Sluder wrote: > On Thu, Jan 17, 2013, a

Re: NSTextfield focus in contextual menu

2013-01-17 Thread Tamas Nagy
Thanks for the info and the tips Kyle! Tamas On Jan 17, 2013, at 8:54 PM, Kyle Sluder wrote: > On Thu, Jan 17, 2013, at 11:38 AM, Tamas Nagy wrote: >> Hi List, >> >> I have an application (10.6>) where are have a contextual menu with an >> NSTextfield. What I'm trying is when I displaying the

Re: NSTextfield focus in contextual menu

2013-01-17 Thread Kyle Sluder
On Thu, Jan 17, 2013, at 11:38 AM, Tamas Nagy wrote: > Hi List, > > I have an application (10.6>) where are have a contextual menu with an > NSTextfield. What I'm trying is when I displaying the menu with [NSMenu > popupContextual…] making the NSTextfield focused, but without luck. > > I tried se

Re: Changing color in NSColorPanel without message

2013-01-17 Thread Ken Thomases
On Jan 16, 2013, at 2:47 PM, Melvin Walker wrote: > Is it possible to programmatically change color (using -setColor:) in > NSColorPanel without it sending a changeColor: message to the first responder? > > We'd like it to just reflect a color change without telling the responder > chain about

NSTextfield focus in contextual menu

2013-01-17 Thread Tamas Nagy
Hi List, I have an application (10.6>) where are have a contextual menu with an NSTextfield. What I'm trying is when I displaying the menu with [NSMenu popupContextual…] making the NSTextfield focused, but without luck. I tried setting [mytextfield becomeFirstResponder] and [mytestfield select

Re: Thread synchronization via queue

2013-01-17 Thread Charles Srstka
On Jan 17, 2013, at 10:22 AM, Kyle Sluder wrote: > On Jan 17, 2013, at 2:09 AM, Charles Srstka wrote: > >> You could start a run loop in a dispatch queue, schedule the NSInputStream >> on that runloop, and then have the delegate methods block/unblock your >> reading thread via a lock/semaphor

Re: Thread synchronization via queue

2013-01-17 Thread Kyle Sluder
On Jan 17, 2013, at 2:09 AM, Charles Srstka wrote: > You could start a run loop in a dispatch queue, schedule the NSInputStream on > that runloop, and then have the delegate methods block/unblock your reading > thread via a lock/semaphore/etc. Do not start a runloop in a block submitted to a d

Re: Thread synchronization via queue

2013-01-17 Thread Scott Ribe
On Jan 17, 2013, at 2:40 AM, Rick Mann wrote: > I can't change the complex process to work in discrete chunks. But you have access to the writing process source so that you can add a few lines of code for synchronization stuff? If so, this is kind of a classic case for a condition variable; the

tappable strings

2013-01-17 Thread Roland King
I have some NSAttributedStrings which I'm currently using a UILabel to draw. They are made up of several elements, words in more than one language, and I want the strings to be tappable and to know where in the string I tapped. I looked at NSStringDrawingContext which gives you some overall info

Re: Using a document bundle file type with core data

2013-01-17 Thread Eric Gorr
On Jan 17, 2013, at 5:42 AM, Mike Abdullah wrote: > > On 17 Jan 2013, at 03:38, David Brittain wrote: > >> The code in this blog article enables saving core data files to a package: >> >> http://cutecoder.org/featured/asynchronous-core-data-document/ >> >> Take a look at the writeSafelyToUR

Re: Thread synchronization via queue

2013-01-17 Thread Roland King
.. and if what you want is to use this to block a separate thread, you can do that too. Just make the read block grab some data for you and put it in a block variable ready for you to process, then call it with dispatch_sync. You'll block until there's data and when it returns the chunk is there

Re: Thread synchronization via queue

2013-01-17 Thread Roland King
There's quite a few things you can try in GCD. One of them (and this is designed in email so I'm sure this is going to get holes poked all over it but might make for a fun discussion) is to make one worker dispatch_queue on which all of your work happens, that protects your NSMutableData from

Re: Using a document bundle file type with core data

2013-01-17 Thread Mike Abdullah
On 17 Jan 2013, at 03:38, David Brittain wrote: > The code in this blog article enables saving core data files to a package: > > http://cutecoder.org/featured/asynchronous-core-data-document/ > > Take a look at the writeSafelyToURL implementation in the gist at the > bottom. I haven't tried sa

Re: Thread synchronization via queue

2013-01-17 Thread Charles Srstka
On Jan 17, 2013, at 4:01 AM, Rick Mann wrote: > On Jan 17, 2013, at 1:56 , Charles Srstka wrote: > >> On Jan 17, 2013, at 3:40 AM, Rick Mann wrote: >> >>> I've got a situation where I have a complicated process that periodically >>> pulls some bytes out of an NSMutableData. Eventually, it ge

Re: Thread synchronization via queue

2013-01-17 Thread Rick Mann
On Jan 17, 2013, at 1:56 , Charles Srstka wrote: > On Jan 17, 2013, at 3:40 AM, Rick Mann wrote: > >> I've got a situation where I have a complicated process that periodically >> pulls some bytes out of an NSMutableData. Eventually, it gets to the end of >> the NSMutableData. At that point,

Re: Thread synchronization via queue

2013-01-17 Thread Charles Srstka
On Jan 17, 2013, at 3:40 AM, Rick Mann wrote: > I've got a situation where I have a complicated process that periodically > pulls some bytes out of an NSMutableData. Eventually, it gets to the end of > the NSMutableData. At that point, I need the process to block while it waits > for a separat

Re: Comparator blocks in NSSortDescriptor not supported in Core Data?

2013-01-17 Thread Laurent Daudelin
On Jan 17, 2013, at 01:06, Kyle Sluder wrote: > On Thu, Jan 17, 2013, at 12:31 AM, Laurent Daudelin wrote: >> Any reason why comparator blocks are not supported in NSSortDescriptor >> when used for an NSFetchRequest? I tried one unaware they were not >> supported and I got an exception: >> >> **

Thread synchronization via queue

2013-01-17 Thread Rick Mann
I've got a situation where I have a complicated process that periodically pulls some bytes out of an NSMutableData. Eventually, it gets to the end of the NSMutableData. At that point, I need the process to block while it waits for a separate process (thread) to give it more data. What I need is

Re: Comparator blocks in NSSortDescriptor not supported in Core Data?

2013-01-17 Thread Kyle Sluder
On Thu, Jan 17, 2013, at 12:31 AM, Laurent Daudelin wrote: > Any reason why comparator blocks are not supported in NSSortDescriptor > when used for an NSFetchRequest? I tried one unaware they were not > supported and I got an exception: > > *** Terminating app due to uncaught exception > 'NSInvali

Re: Custom View drawRect method is not invoked when use with AutoLayout

2013-01-17 Thread Sasikumar JP
I have rephrased my earlier question to get some experts attention :) Is there any difference in creating a custom view in interface builder over code. If I create the custom view from interface builder, drawrect method is getting invoked, if I do it from code,drawrect is not getting invoked?

Re: Changing color in NSColorPanel without message

2013-01-17 Thread Andy Lee
On Jan 17, 2013, at 3:30 AM, Andy Lee wrote: > One thing I didn't test was whether this was due to changeColor: being sent > or due to the color well responding to the notification, Actually this doesn't matter since notifications are sent synchronously. *But* I couldn't resist poking around s

Comparator blocks in NSSortDescriptor not supported in Core Data?

2013-01-17 Thread Laurent Daudelin
Any reason why comparator blocks are not supported in NSSortDescriptor when used for an NSFetchRequest? I tried one unaware they were not supported and I got an exception: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'unsupported NSSortDescriptor (comparat

Re: Changing color in NSColorPanel without message

2013-01-17 Thread Andy Lee
On Jan 17, 2013, at 2:23 AM, "jonat...@mugginsoft.com" wrote: > The refactor could be fairly simple. > A category method on NSColorPanel could be used to insert a filter into the > responder chain as and when required before displaying the panel. > The filter could then divert the change reques

Re: Changing color in NSColorPanel without message

2013-01-17 Thread jonat...@mugginsoft.com
On 17 Jan 2013, at 00:58, Melvin Walker wrote: > On Jan 16, 2013, at 4:45 PM, Andy Lee wrote: >> On Jan 16, 2013, at 6:09 PM, Melvin Walker wrote: >> [...] When you select a color in the panel, NSColorPanel sends a changeColor: message to the first responder. It also sends its actio

Re: Changing color in NSColorPanel without message

2013-01-17 Thread jonat...@mugginsoft.com
On 17 Jan 2013, at 00:58, Melvin Walker wrote: > On Jan 16, 2013, at 4:45 PM, Andy Lee wrote: >> On Jan 16, 2013, at 6:09 PM, Melvin Walker wrote: >> [...] When you select a color in the panel, NSColorPanel sends a changeColor: message to the first responder. It also sends its actio