Re: Block until block is called

2011-08-26 Thread Ken Thomases
On Aug 26, 2011, at 11:40 PM, Brian Norh wrote: > I'm working against an API which looks like this: > > - (void)performOperationWithBlock:(void (^)(void))block > > The call returns directly and the execution continues. At some point > the block is eventually called. How would I do to block execu

NSWindow setFrame:display: ceiling behavior?

2011-08-26 Thread Arbit Richardi
Given the following code snip: NSRect newFrame = [myWindow frame]; newFrame.size.width = 772.16; [myWindow setFrame:newFrame display:YES]; NSLog(@"%f", [myWindow frame].size.width); The output is: 773.00, and in fact, the window is drawn 773 points wide on my MacBook Pro. Why do windows pref

Odd Versions behavior

2011-08-26 Thread Aidas Dailide
Hi, I'm trying to figure out Versions behavior in Lion especially how (and when) "Save a Version" works. I've made a quick simple application with Versions enabled that basically just saves and opens text files. I've tried a very simple thing: 1. Type a letter 2. Hit "Save a Version" 3. Type an

Re: Block until block is called

2011-08-26 Thread Brian Norh
On Sat, Aug 27, 2011 at 7:07 AM, Glenn L. Austin wrote: > Um, why would you want to (or need to) do that? It's often not necessary at all but I've found a very rare case where if the API is called from within another block it sometimes makes sense to do that, at least for now until the API is up

Re: Block until block is called

2011-08-26 Thread Glenn L. Austin
On Aug 26, 2011, at 9:40 PM, Brian Norh wrote: > Hi. > > I'm working against an API which looks like this: > > - (void)performOperationWithBlock:(void (^)(void))block > > The call returns directly and the execution continues. At some point > the block is eventually called. How would I do to blo

Block until block is called

2011-08-26 Thread Brian Norh
Hi. I'm working against an API which looks like this: - (void)performOperationWithBlock:(void (^)(void))block The call returns directly and the execution continues. At some point the block is eventually called. How would I do to block execution until the block have been called? [obj performOper

Re: Sample code using the new document model?

2011-08-26 Thread Jerry Krinock
On 2011 Aug 26, at 19:34, Richard Somers wrote: > On Aug 26, 2011, at 8:11 PM, Jerry Krinock wrote: > >> I cannot find any sample code using the new NSDocument features in Lion, >> such as autosave in place and asynchronous saving. Am I searching >> incorrectly? > > Have you checked this out

Re: Sample code using the new document model?

2011-08-26 Thread Richard Somers
On Aug 26, 2011, at 8:11 PM, Jerry Krinock wrote: > I cannot find any sample code using the new NSDocument features in Lion, such > as autosave in place and asynchronous saving. Am I searching incorrectly? Have you checked this out? Mac OS X Lion Release Notes Cocoa Foundation Framework http:

Sample code using the new document model?

2011-08-26 Thread Jerry Krinock
I cannot find any sample code using the new NSDocument features in Lion, such as autosave in place and asynchronous saving. Am I searching incorrectly? The more I read NSDocument.h in the 10.7 SDK, the more I appreciate that properly implementing asynchronous saving to handle all the corner cas

Re: Transparency of textured controls

2011-08-26 Thread Andreas Mayer
Am 23.08.2011 um 12:58 schrieb Leo: >>> Actually, I finally realized what the real issue is: Apple for some reason >>> didn't "refresh" NSSegmentedControl Rounded style to match the new >>> appearance of NSTabView controls on Lion. >> I guess that's intentional. The 'Capsule' style does look li

Re: update nspopupbutton at use-time

2011-08-26 Thread Shane Stanley
On Aug 27, 2011, at 2:06 AM, Jens Alfke wrote: > > Listen for NSPopUpButtonCellWillPopUpNotification sent by the button’s cell. Or implement -menuNeedsUpdate: on the delegate of the popup's menu. -- Shane Stanley 'AppleScriptObjC Explored' ___ Coc

Re: rightMouseDown: never called in NSView subclass

2011-08-26 Thread Indragie Karunaratne
Thank you for this tip, I had tried doing this earlier, but I was using -hitTest: from my NSWindow to find out if the event should be passed to my view, which obviously didn't work because NSToolbarView was overriding -hitTest: to return itself. I got it working by converting point to the view's

Re: Sharing a persistent store between iOS and Mac

2011-08-26 Thread Fritz Anderson
On 25 Aug 2011, at 4:20 PM, Jens Alfke wrote: > I’m not qualified to answer the CoreData question, but it shouldn’t take that > long to read 12,000 words out of a text file. A fraction of a second. You may > have been doing it using some technique that added a lot of extra overhead, > perhaps f

Re: Calling -addObserver:forKeyPath:… more than once

2011-08-26 Thread Rick Mann
Thanks for verifying. On Aug 26, 2011, at 7:09 , Heath Borders wrote: > You must call remove as many times as you call add. Otherwise, > subclasses and superclasses would interfere with each other's > observations. > > -Heath Borders > heath.bord...@gmail.com > Twitter: heathborders > http://he

Re: Calling -addObserver:forKeyPath:… more than once

2011-08-26 Thread Rick Mann
Thanks for verifying! On Aug 26, 2011, at 11:42 , Sean McBride wrote: > On Fri, 26 Aug 2011 09:09:19 -0500, Heath Borders said: > >> You must call remove as many times as you call add. Otherwise, >> subclasses and superclasses would interfere with each other's >> observations. > > Also, see th

Re: rightMouseDown: never called in NSView subclass

2011-08-26 Thread Lee Ann Rucker
What if you intercept the event a bit higher, in [NSWindow sendEvent:]? The right click gets intercepted by the toolbar view because it's got its own menu; it's likely your users won't discover your menu because they're expecting that one. I have toolbar items with menus, but they're NSButtons t

Layer Backed WebView: assertion failed/CGGStackRestore crash on Google News page

2011-08-26 Thread Eric Wing
Just wondering if anybody has come across this problem. It looks like an Apple bug to me, but I wanted to make sure or learn if there is a reasonable workaround. I am trying to get a layer backed WebView to work in an OpenGL app. (I want to put a web view on top of an OpenGL surface, either a CAOp

Re: Calling -addObserver:forKeyPath: … more than once

2011-08-26 Thread Sean McBride
On Fri, 26 Aug 2011 09:09:19 -0500, Heath Borders said: >You must call remove as many times as you call add. Otherwise, >subclasses and superclasses would interfere with each other's >observations. Also, see the 10.7 Foundation Release Notes "More Precise Removal of Key-Value Observers". -- __

Re: Persistant reference to file that is not a path?

2011-08-26 Thread Sean McBride
On Fri, 26 Aug 2011 09:36:27 +0200, Mike Abdullah said: >NDAlias and BDAlias are the two candidates that come to mind Though I'm biased, I recommend NDAlias since it is still actively maintained, which BDAlias does not seem to be. Even better, I recommend dropping 10.5 support. :) -- _

Re: NSTabView Sizing Question

2011-08-26 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 8/26/11 11:08 AM, Jens Alfke wrote: > What I would do is, once you know the content view size you want, > compute the difference between that size and the content’s current > size, then grow the window by that amount. > > The assumption is that th

Re: NSTabView Sizing Question

2011-08-26 Thread Jens Alfke
On Aug 26, 2011, at 10:43 AM, Conrad Shultz wrote: > I have an NSTabView in a window and want to size it (and, > subsequently, the window) to fully display the current tab view item's > content view (i.e. [tabViewItem view]). What I would do is, once you know the content view size you want, comp

NSTabView Sizing Question

2011-08-26 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, I'm attempting a seemingly trivial task that is proving sufficiently cumbersome that I wonder whether I am missing some shortcut. ("Easy things should be easy, hard things should be possible," right?) Given that I am a relative newcomer to A

Re: rightMouseDown: never called in NSView subclass

2011-08-26 Thread Kyle Sluder
On Fri, Aug 26, 2011 at 10:36 AM, Kyle Sluder wrote: > replace NSClipView's implementation Of course I mean NSToolbarView. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to

Re: rightMouseDown: never called in NSView subclass

2011-08-26 Thread Kyle Sluder
On Fri, Aug 26, 2011 at 9:51 AM, glenn andreas wrote: > The App Store approval guidelines is pretty clear that the use of non-public > API is grounds for rejection.  NSToolbarView is undocumented, and therefore > doing anything that depends on that class or its (undocumented) behavior > would s

Re: rightMouseDown: never called in NSView subclass

2011-08-26 Thread Mark Munz
OK, I misread your first message. That said, I'd go with the option to just put your "toolbar" view as part of the contentView of the window. If your view is within the contentView of the window, it will be part of the fullscreen window in Lion. Just make sure it can resize with the window. Xcode

Re: update nspopupbutton at use-time

2011-08-26 Thread Martin Hewitson
Excellent. Thank you! Martin On 26, Aug, 2011, at 06:06 PM, Jens Alfke wrote: > > On Aug 26, 2011, at 8:15 AM, Martin Hewitson wrote: > >> I would like to populate the list in an NSPopupButton just as the user >> clicks but before the menu is shown. So I'd like an NSPopupButton delegate >> m

Re: rightMouseDown: never called in NSView subclass

2011-08-26 Thread glenn andreas
The App Store approval guidelines is pretty clear that the use of non-public API is grounds for rejection. NSToolbarView is undocumented, and therefore doing anything that depends on that class or its (undocumented) behavior would seem like grounds for rejection. This would include adding a ca

Re: rightMouseDown: never called in NSView subclass

2011-08-26 Thread Indragie Karunaratne
Thats actually what I'm doing right now, its an NSToolbarItem with a custom view but like I said, the right mouse events are not passed to it by NSToolbarView without that little hack. I could, as you said, circumvent NSToolbar completely, but when a view is placed outside of the toolbar, it di

Re: update nspopupbutton at use-time

2011-08-26 Thread Jens Alfke
On Aug 26, 2011, at 8:15 AM, Martin Hewitson wrote: > I would like to populate the list in an NSPopupButton just as the user clicks > but before the menu is shown. So I'd like an NSPopupButton delegate message > -popupWillAppear: or something like that. I knew there was a way to do this but it

Re: Sharing a persistent store between iOS and Mac

2011-08-26 Thread Fritz Anderson
Thanks for the lead. I thought I'd tried this before (pointing both at the same .momd was a desperate measure), but I'll try again. — F On 26 Aug 2011, at 9:19 AM, Heath Borders wrote: > I created a command-line build tool, and generated a sqlite coredata store > with it. Then I copy t

update nspopupbutton at use-time

2011-08-26 Thread Martin Hewitson
Dear list, I'm guessing this is easy, but I can't find a solution anywhere. I would like to populate the list in an NSPopupButton just as the user clicks but before the menu is shown. So I'd like an NSPopupButton delegate message -popupWillAppear: or something like that. Does anyone know of a

Re: NSDate description in Lion shows GMT instead of local time

2011-08-26 Thread Clark Cox
On Fri, Aug 26, 2011 at 12:38 AM, Gerriet M. Denkmann wrote: > > The documentation says about -[NSDate description]: "The representation is > not guaranteed to remain constant across different releases of the operating > system." That really says it all right there. > NSLog(@"someDate: %@", so

Re: Text rendered in NSImage is fuzzy

2011-08-26 Thread Rimas M.
On Fri, Aug 26, 2011 at 5:21 PM, Kyle Sluder wrote: > On Aug 26, 2011, at 7:13 AM, "Rimas M." wrote: > > > If I am using Core Text (CTLineDraw(line, bitmapDrawContext);) to draw my > > text into bitmap context, there is no way to get sub-pixels antialiasing > if > > resulting image has transpare

Re: NSDate description in Lion shows GMT instead of local time

2011-08-26 Thread David Duncan
On Aug 26, 2011, at 12:38 AM, Gerriet M. Denkmann wrote: > Is this a bug in Lion or is this a really useful feature? Its not a bug, its more like a clarification of expectation. Upon seeing the description in local time many developers believe than an NSDate somehow carries time zone informati

Re: Text rendered in NSImage is fuzzy

2011-08-26 Thread Kyle Sluder
On Aug 26, 2011, at 7:13 AM, "Rimas M." wrote: > If I am using Core Text (CTLineDraw(line, bitmapDrawContext);) to draw my > text into bitmap context, there is no way to get sub-pixels antialiasing if > resulting image has transparent background? Correct. Subpixel antialiasing algorithms require

Re: Sharing a persistent store between iOS and Mac

2011-08-26 Thread Heath Borders
I've done something similar in two of my projects. However, I only shared the sqlite file, not the momd. I created a command-line build tool, and generated a sqlite coredata store with it. Then I copy the sqlite into my iOS project and add it to the Copy Bundle Resources phase. I do NOT copy the

Re: Text rendered in NSImage is fuzzy

2011-08-26 Thread Rimas M.
Sorry for touching this old thread. I just want to be sure. If I am using Core Text (CTLineDraw(line, bitmapDrawContext);) to draw my text into bitmap context, there is no way to get sub-pixels antialiasing if resulting image has transparent background? Currently it looks: http://db.tt/Rtiu7B1 Re

Re: Calling -addObserver:forKeyPath:… more than once

2011-08-26 Thread Heath Borders
You must call remove as many times as you call add. Otherwise, subclasses and superclasses would interfere with each other's observations. -Heath Borders heath.bord...@gmail.com Twitter: heathborders http://heath-tech.blogspot.com On Fri, Aug 26, 2011 at 4:34 AM, Rick Mann wrote: > Is -addObs

Calling -addObserver:forKeyPath:… more than once

2011-08-26 Thread Rick Mann
Is -addObserver:forKeyPath:… idempotent? I called it multiple times with the same parameters, but called -removeObserver:forKeyPath: only once, and the object continued to receive KVO notifications. After adding code to ensure -addObserver:forKeyPath:… was only called once, -removeObserver:forK

NSDate description in Lion shows GMT instead of local time

2011-08-26 Thread Gerriet M. Denkmann
The documentation says about -[NSDate description]: "The representation is not guaranteed to remain constant across different releases of the operating system." NSLog(@"someDate: %@", someDate ); Formerly did print the time in the local time zone. Which is a very sensible thing to do. But Li

Re: Persistant reference to file that is not a path?

2011-08-26 Thread Mike Abdullah
NDAlias and BDAlias are the two candidates that come to mind Sent from my iPad On 26 Aug 2011, at 07:41 AM, Jens Alfke wrote: > > On Aug 25, 2011, at 9:18 PM, Joar Wingfors wrote: > >> Prior to Mac OS X 10.6 you can use "aliases", which have been around since >> before Mac OS X: >> >> >