Re: sandboxing and filename extensions

2013-05-15 Thread Quincey Morris
On May 14, 2013, at 21:16 , Scott Ribe wrote: > On 10.6.8, if I enter a plain filename without extension, the save panel > returns the path with the extension appended. On 10.7.5, where sandboxing > kicks in and this actually matters because the code cannot normalize the > returned name, the s

UIView drawRect will update whole bounds

2013-05-15 Thread li shunnian
Hi all, I implement drawRect of a subclass of UIView. I found view will update whole bounds when I switch from another app to myapp. Because I draw a cgimage on the view's bounds, it cost lots of time. Are there some properties of view or layer to make the update rect not to be whole bounds? ___

Re: Displaying "Trebuchet MS" font

2013-05-15 Thread Ian Joyner
Thanks for the clarifications Jens, but I don't think what I was saying is so far removed from your more detailed story. I did realise after I posted that MS probably was somewhat justified in avoiding Adobe's outrageous licence fees. And it is certainly true that Matthew Carter is highly regard

Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop?

2013-05-15 Thread Jean Suisse
Thanks for your replies. Unfortunately, I can't easily avoid initWithHTML:dataUsingEncoding:documentAttributes: But I can postpone it long enough to move its execution to an other thread (serial dispatch queue). That solves the issue. Jean On 8 mai 2013, at 21:14, Jens Alfke wrote: > > On M

Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop?

2013-05-15 Thread Ken Thomases
On May 15, 2013, at 8:58 AM, Jean Suisse wrote: > Thanks for your replies. > Unfortunately, I can't easily avoid > initWithHTML:dataUsingEncoding:documentAttributes: > But I can postpone it long enough to move its execution to an other thread > (serial dispatch queue). > That solves the issue.

NSDocument custom file Package or URL override?

2013-05-15 Thread Trygve Inda
My document format needs to look like: File (actually a directory marked as a package) -- MyData.plist -> Images (directory) > Image1.png > Image2.png -> Data (directory) > Data1.dat > Data2.dat -> Icons (directory) > Icon1.png > Icon1.png In my NSDocument subclass, Overr

Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop?

2013-05-15 Thread Jean Suisse
Right. I dispatch the block on the main thread to solve the reentrancy issues as stated below. The serial queue is involved elsewhere. On 15 mai 2013, at 16:12, Ken Thomases wrote: > On May 15, 2013, at 8:58 AM, Jean Suisse wrote: > >> Thanks for your replies. >> Unfortunately, I can't easily

Getting a splash screen to show

2013-05-15 Thread Steve Mills
Please don't waste my time arguing that splash screens are bad. It's all been hashed out before. How am I supposed to force the splash screen to be visible? It's created and shown in applicationWillFinishLaunching. The app is document based. Other modal dialogs *could* appear and go away before

Re: sandboxing and filename extensions

2013-05-15 Thread Scott Ribe
On May 15, 2013, at 1:03 AM, Quincey Morris wrote: > Could you clarify a couple of things… > > Are you typing the file name into the Save panel, or just pressing Enter to > use the pre-filled name? What are the settings for "canSelectHiddenExtension" > and "isExtensionHidden"? What is the beha

Re: Getting a splash screen to show

2013-05-15 Thread Jean Suisse
In one application I have to display a splash screen while a poorly written framework (DAQmxBase from National Instruments) takes 6 to 11 seconds to initialize itself on the main thread. To do so, I display my splash screen as a non modal, top-level, centered window (use NSWindow's setLevel:NSFl

Re: Getting a splash screen to show

2013-05-15 Thread Steve Mills
On May 15, 2013, at 10:40:38, Jean Suisse wrote: > In one application I have to display a splash screen while a poorly written > framework (DAQmxBase from National Instruments) takes 6 to 11 seconds to > initialize itself on the main thread. > To do so, I display my splash screen as a non modal

Re: Minor Scriptability Quesiton

2013-05-15 Thread Seth Willits
On May 14, 2013, at 6:19 PM, Shane Stanley wrote: >> [button accessibilitySetValue:@"My Title" >> forAttribute:NSAccessibilityTitleAttribute]; > >> Discovered -accessibilitySetOverrideValue:forAttribute: but that has no >> effect. The title is still empty. > > The docs for the latter say: "Ens

Re: Getting a splash screen to show

2013-05-15 Thread Steve Mills
I added more nextEventMatchingMask's and the 4th one would actually cause the document to be restored, which was way too early in the init method to do that. But I found this, which seems to work much more reliably. It takes care of doing event type stuff and displays the window. NSModa

Re: UIView drawRect will update whole bounds

2013-05-15 Thread Kyle Sluder
Can you just set the CGImage as the .contents of the view's layer? --Kyle Sluder On May 15, 2013, at 3:42 AM, li shunnian wrote: > Hi all, > I implement drawRect of a subclass of UIView. I found view will update whole > bounds when I switch from another app to myapp. Because I draw a cgimage o

Re: UIView drawRect will update whole bounds

2013-05-15 Thread David Duncan
Or even more simply just use a UIImageView. On May 15, 2013, at 9:36 AM, Kyle Sluder wrote: > Can you just set the CGImage as the .contents of the view's layer? > > --Kyle Sluder > > On May 15, 2013, at 3:42 AM, li shunnian wrote: > >> Hi all, >> I implement drawRect of a subclass of UIView.

Re: Getting a splash screen to show

2013-05-15 Thread Seth Willits
On May 15, 2013, at 8:59 AM, Steve Mills wrote: > [splashWindow setLevel:NSFloatingWindowLevel]; > [splashWindow setBackgroundColor:[NSColor clearColor]]; > [splashWindow setOpaque:NO]; > [splashWindow setHasShadow:NO]; > [splashWindow invalidateShadow]; > [splashWindow flushWindow]; > [splashWind

Re: Getting a splash screen to show

2013-05-15 Thread Steve Mills
On May 15, 2013, at 11:56:42, Seth Willits wrote: > Looks fine, but ditch the invalidate/flush/display is unnecessary. Thanks. > Why is this here? Burn it with fire. Like I said, I didn't write it. And yeah, radiated acid napalm will be used. > Not much to go on here, unfortunately. It must h

Re: NSDocument custom file Package or URL override?

2013-05-15 Thread Markus Spoettl
On 5/15/13 5:14 PM, Trygve Inda wrote: My document format needs to look like: File (actually a directory marked as a package) -- MyData.plist -> Images (directory) > Image1.png > Image2.png -> Data (directory) > Data1.dat > Data2.dat -> Icons (directory) > Icon1.png > Ico

Re: Getting a splash screen to show

2013-05-15 Thread Kyle Sluder
On May 15, 2013, at 10:06 AM, Steve Mills wrote: > On May 15, 2013, at 11:56:42, Seth Willits wrote: > >> Not much to go on here, unfortunately. It must have something to do with >> what else is in your project or ordering. Showing a window at launch is as >> trivial as it should be, so somet

Re: sandboxing and filename extensions

2013-05-15 Thread Quincey Morris
On May 15, 2013, at 08:31 , Scott Ribe wrote: > I guess about the only thing I can do here in order to get the file named in > a usable manner […] is to use a delegate, implement panel:validateURL:error:, > and force the user to type ".pdf". I don't believe this. If true, it would suggest that

Re: Getting a splash screen to show

2013-05-15 Thread Steve Mills
On May 15, 2013, at 12:37:47, Kyle Sluder wrote: > Make sure the splash window is not restorable, and make sure you're not > relying on getting -applicationOpenUntitledFile:. I turned the Restorable setting off earlier today, since it has no business being on for this. I didn't help. We alread

Re: sandboxing and filename extensions

2013-05-15 Thread Scott Ribe
On May 15, 2013, at 11:39 AM, Quincey Morris wrote: > Because of "canSelectHiddenExtension", my Save dialog has a "Hide Extension" > checkbox. If it's unchecked, and I retype the file name text box without an > extension, the checkbox turns itself on automatically. If I type the correct > exten

Re: sandboxing and filename extensions

2013-05-15 Thread Scott Ribe
On May 15, 2013, at 11:39 AM, Quincey Morris wrote: > When comparing your code with mine, I realized that -[NSSavePanel > beginSheetForDirectory: …] was deprecated in 10.6. Try using one of the > non-deprecated methods. It *does* matter, with powerbox. Well, that was the problem. FYI, I'm still

Re: Getting a splash screen to show

2013-05-15 Thread Seth Willits
On May 15, 2013, at 10:48 AM, Steve Mills wrote: > Like I said in an earlier message, I've solved everything by > beginModalSessionForWindow followed by endModalSession. Calling beginModalSessionForWindow and endModalSession back to back to "fix" this issue is a hack, not solution. You'd really

Re: Getting a splash screen to show

2013-05-15 Thread Jean Suisse
On 15 mai 2013, at 17:59, Steve Mills wrote: > On May 15, 2013, at 10:40:38, Jean Suisse wrote: > >> In one application I have to display a splash screen while a poorly written >> framework (DAQmxBase from National Instruments) takes 6 to 11 seconds to >> initialize itself on the main thread. >

Re: Minor Scriptability Quesiton

2013-05-15 Thread Shane Stanley
On 16/05/2013, at 2:19 AM, Seth Willits wrote: > With just that I can make a few things easier through scripting without > having to dive into anything else. I was afraid that was where you were headed. Really, GUI scripting is a finnicky, unreliable hack. Unless you need a complex object mode

Re: UIView drawRect will update whole bounds

2013-05-15 Thread li shunnian
My app is a painter, the image is used for back buffering. When dragging, I calculate the points between the previous point and now point, and draw a small image on the back buffer image. Then update the back buffer image to the view. ___ Cocoa-dev

Re: UIView drawRect will update whole bounds

2013-05-15 Thread Graham Cox
On 16/05/2013, at 11:29 AM, li shunnian wrote: > I implement drawRect of a subclass of UIView. I found view will update whole > bounds when I switch from another app to myapp. Because I draw a cgimage on > the view's bounds, it cost lots of time. Are there some properties of view or > layer t

Re: UIView drawRect will update whole bounds

2013-05-15 Thread Cody Garvin
Not that this answers your question, but as graham eluded to, there aren't a lot if choices. I'd look into showing a progress indicator or look into tiling. GL Please excuse mobile typos On May 15, 2013, at 6:44 PM, Graham Cox wrote: > > On 16/05/2013, at 11:29 AM, li shunnian wrote: > >>

Re: NSPersistentDocument Migration with Sandbox

2013-05-15 Thread Jim McGowan
For the sake of the archives, here is how I solved this issue: First off, I turned off automatic migration in my NSPersistentDocument subclass I overrode -openDocumentWithContentsOfURL:display:completionHandler: in a subclass on NSDocumentController. In this method I check the UTI of the URL p

SecTrustEvaluate() failing with kSecTrustResultRecoverableTrustFailure

2013-05-15 Thread Rick Mann
I'm trying to validate our self-signed certificate in NSURLConnectionDelegate's -connection:willSendRequestForAuthenticationChallenge: using itself as the root cert. I'm not 100% sure I'm doing it right, but looking at the ridiculously, excessively complicated example code, I've come up with thi

Re: UIView drawRect will update whole bounds

2013-05-15 Thread li shunnian
I found even in a very simple painter app, view will refresh whole bounds when switching from another app. -- Shunnian ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact