Updating NSMenu while it's open

2012-04-18 Thread vinayak pai
Hi All, I have a NSMenu with dynamically added NSMenuItems. The NSMenu is not refreshing properly while it's kept open. The NSMenu update method is called in NSRunLoopCommonModes. I appreciate any help with this. Best regards, VinPai ___ Cocoa-dev

Re: Core Data and ARC crasher and workaround

2012-04-18 Thread Michael Link
I'm running into a similar situation except it's not crashing at the time of dealloc but at some later time. Here's the rundown of what I see happening. 1. Global parent (non main-thread MOC) is alloc'd 2. Child1 (main-thread) MOC is alloc'd 3. Child2 (main-thread) MOC is alloc'd 4. Child1 MOC

Re: Updating NSMenu while it's open

2012-04-18 Thread Jerry Krinock
On 2012 Apr 18, at 13:14, vinayak pai wrote: I have a NSMenu with dynamically added NSMenuItems. The NSMenu is not refreshing properly while it's kept open. I do not believe there is any way to refresh a menu while it is open. The method in which you do your dynamism, -menuNeedsUpdate, is

Re: Updating NSMenu while it's open

2012-04-18 Thread Graham Cox
On 19/04/2012, at 10:04 AM, Jerry Krinock wrote: On 2012 Apr 18, at 13:14, vinayak pai wrote: I have a NSMenu with dynamically added NSMenuItems. The NSMenu is not refreshing properly while it's kept open. I do not believe there is any way to refresh a menu while it is open. The

Re: Updating NSMenu while it's open

2012-04-18 Thread Dave DeLong
Nothing nearly so complicated. You just have to realize that the runloop is in a different mode while the menu is open. If you have a timer to periodically update your menu, then you have to add the timer to the runloop under the NSEventTrackingRunLoopMode. From there, add or update whatever

Re: Updating NSMenu while it's open

2012-04-18 Thread Andy Lee
On Apr 18, 2012, at 9:47 PM, Graham Cox wrote: On 19/04/2012, at 10:04 AM, Jerry Krinock wrote: [...] You must redesign your app to not require refreshing a menu while it is open. Not true - the system's WiFi menu updates while it is open. Another example is the File menu in some apps

Re: Updating NSMenu while it's open

2012-04-18 Thread Dave DeLong
On Apr 18, 2012, at 7:43 PM, Andy Lee wrote: On Apr 18, 2012, at 9:47 PM, Graham Cox wrote: On 19/04/2012, at 10:04 AM, Jerry Krinock wrote: [...] You must redesign your app to not require refreshing a menu while it is open. Not true - the system's WiFi menu updates while it is

Tabbing between text fields

2012-04-18 Thread Charlie Dickman
I have many textfields in an app and I receive the various delegate method messages as editing proceeds. I'd like to tab to the next text field when an acceptable value has been entered. Is there a way to do this from within one of the delegate methods? Charlie Dickman 3tothe...@comcast.net

Re: Cocoa equivalent for SetWindowProperty in Carbon

2012-04-18 Thread Chris Hanson
What end goal do you want to accomplish with an equivalent to SetWindowProperty? There isn't necessarily a 1:1 correspondence between API in different frameworks; describing your desired goal is more likely to lead to a solution. -- Chris On Apr 17, 2012, at 11:53 PM, Sanjay Arora

Re: Cocoa equivalent for SetWindowProperty in Carbon

2012-04-18 Thread Charles Srstka
On Apr 18, 2012, at 1:53 AM, Sanjay Arora wrote: Hi I am a newbie on Cocoa application development and could not find any method in NSWindow which does the same job as SetWindowProperty used to do in Carbon, Could some one point me to right direction. I’m not an expert on Carbon by any

Core Data : Rare, unreproducible SQLite Constraint Error 19

2012-04-18 Thread Jerry Krinock
Once every few months, my Core Data Mac app will indicate that it can't Save or Auto Save due to an error. MyApp: Core Data: annotation: -executeRequest: encountered exception = error during SQL execution : constraint failed with userInfo = { NSFilePath =