Re: NSDrawer
Hi Cocoa-dev people, FWIW, the deprecation warning for NSDrawer says to "consider using NSSplitViewController." Best regards, Joel Norvell On Mon, Jul 2, 2018, at 7:08 PM, Casey McDermott wrote: > NSDrawer is deprecated, but it's also perfect for our application. > We still haven't found a good substitute. > > Our app has an outline view that loads various types of business records > into a tab view. Some of them have optional extra info. When it's > small a panel is fine, > but some records have large tables: about the same size as the main > record. > A drawer is perfect for viewing them side-by-side with the main info. > In a panel it obscure the main record, and users need to see both. > > Is there a work-around for an attached window that pops out on the side, > and acts like a drawer? > > Any idea when deprecation turns into total non-support? > > Thanks, > > Casey McDermott > www.TurtleSoft.com > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/frameworker%40fastmail.com > > This email sent to framewor...@fastmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Quicksand boxed – a tale of woe.
Hi Cocoa-dev People, I have a sandboxing question, below. I'm wondering if it's even possible to do what I tried to do, and if so, how? Thanks, Joel Norvell I'm trying to iterate directories in a sandboxed app in order to find a file with a specific extension. I believe I have all the entitlements that are available that might help: App Sandbox com.apple.security.files.downloads.read-write com.apple.security.files.user-selected.read-write com.apple.security.print com.apple.security.temporary-exception.files.home-relative-path.read-write com.apple.security.temporary-exception.files.absolute-path.read-write I need to be able to find a file, by name, that could either be on the Desktop or in the (real) Documents folder. I don't even get close. I get a filecoordinationd when I try to iterate either of them (code below). I am able to find a file, by name, in the Downloads folder, though. Has anyone been able to do this with the Desktop folder or the (real) Documents folder? (When I used NSDocumentDirectory it looked in the Documents folder attached to my container. I could find things that were in that. But it wasn't the same as the Documents folder that the user sees.) If I turn off Sandboxing I have no problem iterating Desktop or Documents. This is the code I used to test iterating in three NSSearchPathDirectories: NSDocumentDirectory, NSDesktopDirectory, and NSDownloadsDirectory. NSFileManager* fm = [NSFileManager new]; NSError* err = nil; NSURL* rootDirURL = [fm URLForDirectory:NSDesktopDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:]; // error-checking omitted NSURL * theFormsFolderURL = [self formsFolderURL:rootDirURL]; - (NSURL *) formsFolderURL:(NSURL *)rootDirURL { NSFileManager * fm = [NSFileManager defaultManager]; NSDirectoryEnumerator* dir = [fm enumeratorAtURL:rootDirURL includingPropertiesForKeys:nil options:0 errorHandler:nil]; for (NSURL* f in dir) { if ([[f pathExtension] isEqualToString:@"pdq"]) { NSLog(@"%@", [f lastPathComponent]); } } return nil; // Dummy nil } BTW, this was the value that gave me a filecoordinationd for Desktop: rootDirURL NSURL * @"file:///Users/joely/Library/Containers/biz.pdqforms.pdqforms/Data/Desktop/" ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Zooming Breaks Focus-ring Architecture (10.13.1)
Dear Cocoa-dev People, The main view of my app can be zoomed by the user. It contains NSTextView subviews. The NSTextView focus-rings are well-drawn when the main view is not zoomed. But when it is zoomed, focus rings are not drawn properly. They are drawn the same size, no matter what the zoom factor. And they drift downward as zoom is increased. Note that the text fields themselves are zoomed properly and all mouse clicks are interpreted correctly in zoomed views; just the focus-rings are wrong. Am I doing something wrong? Is there any way to get zoomed focus rings to work using the Cocoa focus ring APIs? Thanks, Joel Norvell This describes my zoom-architecture: // "self" is an NSImageView subclass containing NSTextViews as subviews. - (void) doZoom:(float)scale { float width = [[self bounds].width; float height = [[self bounds].height; NSRect zoomedRect = NSMakeRect(0, 0, width*scale, height*scale*pages); NSRect boundsRect = NSMakeRect(0, 0, width, height*pages); // Make view corners have integral values. zoomedRect = [self roundedRect:zoomedRect]; [self setFrame:zoomedRect]; [self setBounds:boundsRect]; [self setNeedsDisplay:YES]; [self scrollToTop]; } // "self" is an NSTextField nested in the NSImageView subclass. // Part of initialization pertinent to focus-rings // N.B. My NSTextField subclass doesn't use or explicitly do anything to opt-into Core Animation layers. - (void) initTextField; { [self setFocusRingType:NSFocusRingTypeExterior]; [self setDrawsBackground:NO]; [[self cell] setRefusesFirstResponder:NO]; // accept 1st responder. [[self cell] setShowsFirstResponder: YES]; } If I use Apple's focus-ring APIs, the focus-ring is drawn as if the text-view has not been zoomed. And it is shifted downward from it's correct location. - (void)drawFocusRingMask { // Set the focus ring mask to the zoomed bounds. NSRectFill([self focusRingMaskBounds]); } - (NSRect)focusRingMaskBounds { return [self bounds]; } ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: selectText of NSTextField on focus
Hi Richard, When the instance of your NSTextField subclass becomes first responder, you have access to the NSText object (the field editor) and I believe you can use its methods to select the text. (I don't see why you can't, but since I haven't tried it myself, I'm saying I believe.) Sincerely,Joel Override - (BOOL)becomeFirstResponder in your subclass. Get the field editor: NSText * itsText = [[self window] fieldEditor:YES forObject:self]; Use -selectAll or -setSelectedRange ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Transparent NSTextField
Hi Vincent, Have you tried setDrawsBackground:NO on your NSTextField? Below was what I used. I don't know if any of the other instance variables I set are important for your case but they might be. HTH, Joel - (void) initTextField; { [self setBordered:NO]; [self setFocusRingType:NSFocusRingTypeNone]; [self setBezelStyle:NSTextFieldSquareBezel]; [self setBezeled:NO]; [self setEnabled:YES]; [self setSelectable:YES]; [self setEditable:YES]; [self setAlignment:NSNaturalTextAlignment]; [self setBackgroundColor:[NSColor whiteColor]]; [self setDrawsBackground:NO]; } This was the original message: Hi everybody, I’m trying to add a transparent editable NSTextField to a view. As long as the field is not editable (e.g. a label), everything is fine; but with an editable field, I get a background fill. I imagine this is under the window NSTextView responsibility. Has someone already succeeded in programming a totally transparent NSTextField, or shall I recourse to a CATextLayer instead? Thanks, Vincent ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Is it valid to override awakeFromNib in my NSApplicationDelegate?
Hi Cocoa People, I noticed that NSApplicationDelegate instances get awakeFromNib messages. I've tried to find its definition. But I haven't been able to find it. Is it be valid to override awakeFromNib in NSApplicationDelegate? Thanks, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Is it valid to override awakeFromNib in my NSApplicationDelegate?
Hi Fritz, Thank you very much for answering my question! Sincerely, Joel From: Fritz Anderson fri...@manoverboard.org To: Joel Norvell framewor...@yahoo.com Cc: cocoa-dev@lists.apple.com cocoa-dev@lists.apple.com Sent: Sunday, March 25, 2012 11:02 AM Subject: Re: Is it valid to override awakeFromNib in my NSApplicationDelegate? On 25 Mar 2012, at 12:49 PM, Joel Norvell wrote: I noticed that NSApplicationDelegate instances get awakeFromNib messages. I've tried to find its definition. But I haven't been able to find it. Is it be valid to override awakeFromNib in NSApplicationDelegate? It is documented that any object in the NIB, and File's Owner, are sent -awakeFromNib when the NIB has fully loaded. See the reference document for the NSNibAwaking protocol. The order of -awakeFromNib calls is not guaranteed, only that all the connections specified in the NIB itself will have been made. The Resource Programming Guide, in the chapter Nib Files (strangely available in the iOS library only), it says, In OS X, Cocoa tries to call the awakeFromNib method of File’s Owner last but does not guarantee that behavior. — F ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: PDFView focus ring
Hi Martin, This is just a guess. Could the NSFocusRingType set in IB be overridden somehow for the PDFView? You might explicitly test the focusRingType to see what it is once it's been created. Sincerely, Joel Martin Hewitson wrote: ... I have an app which has an editor on the left side of a splitview and a pdfview on the right side of the splitview. Then I have a keyboard shortcut to toggle focus between the editor and the pdfview. The problem is that the pdfview doesn't show a focus ring, so it's very hard for the user to see that the focus changed. Does anyone know a way that I can make the pdfview show a focus ring? I have tried setting it to Default and Exterior in IB, but it still doesn't appear. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Help finding documentation about printing
Hi Christopher, The documentation set on http://developer.apple.com/devcenter/mac/index.action has Apple's printing giude. The full URL to the printing section is: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Printing/Printing.html%23//apple_ref/doc/uid/1083i When I've had to work with Cocoa printing, I've found Hillegass's Cocoa Programming for Mac OS X helpful and also the classic Cocoa Programming by Anguish, Buck Yacktman. Sincerely, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Unexpected PDFKit behavior in -[PDFPage string]
Dear Cocoa-dev People, I'd queried the list about PDFKit selection behavior: NSString * currentPageData = [currentPage string]; behaves quite differently on a Snow Leopard build than it did under Leopard. A partial description of the issue is that the order of table data is not correctly preserved under Snow Leopard. Someone answered my question off-list, saying: I haven't looked at this lately, but in Snow Leopard PDFKit gained some smarts to recognise columnar layouts and base its text extraction on that. Possibly this causes tables to be selected by column rather than by row, as they would have been before. I believe this is correct. Unfortunately, due to the layout of the file I was inspecting, the new behavior wasn't useful to me. (My file was so bad that it wasn't obvious what the selection behavior was–but it's selections did have columnar tendencies.) If anyone on the PDFKit team is listening, I think it would be kind to allow row-by-row selection behavior to be effected within an app if so doing didn't complicate the PDFKit codebase! Sincerely, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Unexpected PDFKit behavior in -[PDFPage string]
Dear Cocoa-dev People, In PDFKit NSString * currentPageData = [currentPage string]; behaves quite differently on a Snow Leopard build than it did under Leopard. A partial description of the issue is that the order of table data in not correctly preserved under Snow Leopard. Has anyone else noticed this issue? I thought it prudent to query the list before filing a rdar. Sincerely, Joel P.S. My heartfelt gratitude to Bertrand Mansion for resurrecting the awesome cocoabuilder site! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
[MEET] Silicon Valley CocoaHeads, Thursday, November 12
Silicon Valley CocoaHeads is meeting Thursday, November 12 at 7 p.m. (sharp) Apple Building 4 — Garage 1 Meeting Room As announced on Theocacao: http://theocacao.com/document.page/609 Our featured speaker is Rob Rhyne who will give a talk on Intuitive Design for the iPhone. Sincerely, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Sticky Event tracking
Hi Francisco, When you click outside of your application, your window's delegate will receive a windowDidResignKey message. I don't know if this is the standard way of handling the type of case you described, but I believe it would work. Sincerely, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to change focus ring color?
Alexander, If you're drawing the focus ring yourself, you can change its color by setting it in the NSGraphicsContext that's active while it's being drawn. I draw NSView/NSControl focus rings by hand in one of my apps. I've posted the code that does this, below. I'm not changing the color of the focus ring, but easily could by setting some color other than keyboardFocusIndicatorColor. My approach is fairly heavy-handed. I'm not suggesting that you adopt it, just that it's possible. You didn't say what objects you are drawing, so I should add this caveat: I'm not sure what variations, if any, would be induced by generalizing my approach to NSCell objects. Sincerely, Joel - (void)drawRect:(NSRect)rect { [super drawRect:rect]; if ([self focus]) { [self drawFocusRing]; [NSGraphicsContext saveGraphicsState]; NSRect whiteOutRect = NSInsetRect([self bounds], 2, 2); [self whiteOutInterior:whiteOutRect]; [NSGraphicsContext restoreGraphicsState]; } } - (void) drawFocusRing { if ([self focus]) { [NSGraphicsContext saveGraphicsState]; [self whiteOutFocusRegion:[self bounds]]; // whiteOutFocusRegion [[NSColor keyboardFocusIndicatorColor] set]; NSSetFocusRingStyle(NSFocusRingOnly); [[NSBezierPath bezierPathWithRect:[self bounds]] fill]; [NSGraphicsContext restoreGraphicsState]; [self setFocusRingDrawn:YES]; } } ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cocoa Graphics Parsing
Hi Courtney, Two resources that you might consider are the Quartz-dev mailing list and Programming with Quartz by David Gelphman. HTH, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
RE: missing vertical scroll bar
Dale, I believe the recipe you want involves shoe-horning the scrollViewRect into its containing window. For an example, look at the DocumentWindowController's resizeWindowForViewSize method in TextEdit (shown below). HTH, Joel - (void)resizeWindowForViewSize:(NSSize)size { NSWindow *window = [self window]; NSRect origWindowFrame = [window frame]; if (![[self document] hasMultiplePages]) { size.width += (defaultTextPadding() * 2.0); } NSRect scrollViewRect = [[window contentView] frame]; scrollViewRect.size = [[scrollView class] frameSizeForContentSize:size hasHorizontalScroller:[scrollView hasHorizontalScroller] hasVerticalScroller:[scrollView hasVerticalScroller] borderType:[scrollView borderType]]; NSRect newFrame = [window frameRectForContentRect:scrollViewRect]; newFrame.origin = NSMakePoint(origWindowFrame.origin.x, NSMaxY(origWindowFrame) - newFrame.size.height); [window setFrame:newFrame display:YES]; } ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to create programaticlly
Hi Agha, I guess you've overridden your NSViewController's loadView method, which seems like a good place to roll your own button. You'll need to create and initialize the button with something like this: NSButton *newButton = [[[NSButton alloc] initWithFrame:nestedFrame] autorelease]; And then you have to diddle with the button's instance variables. These might include – but are not limited to – things like: [newButton setButtonType:NSSwitchButton]; [[newButton cell] setEnabled:YES]; [newButton setTransparent:NO]; [newButton setBordered:NO]; [newButton setBezelStyle:NSShadowlessSquareBezelStyle]; [newButton setTitle:@]; There are enough permutations of these that you'll probably have to experiment some to determine which properties (instance method settings) are pertinent to your case. (I've found that AppKido most useful for this.) If you want to hook the button into the responder chain, you'll need to do something like this: [[newButton cell] setRefusesFirstResponder:NO]; // accept first responder. [[newButton cell] setShowsFirstResponder:YES]; // show first responder. And you'll need an action method, that IB would have let you connect graphically, but you'll set up like this: [self setAction:@selector(buttonClicked:)]; If you're subclassing NSButton, the recipe is slightly more complicated. But you're doing the same stuff, in the context of an NSButton subclass. HTH, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to create programaticlly
Hi Agha, In my previous note, I forgot to mention that the button will have to be explicitly connected to its window's view hierarchy, unless your view controller does this for you. So you'll probably need to find its super view and do something like this: [itsSuperview addSubview: newButton]; And this may not be the only point I overlooked, which only reinforces the wisdom of I. Savant's admonition*. My best, Joel *Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime. –Chinese Proverb ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Confused about NSPrintInfo margins
Graham, I'm not sure if this is exactly what you were talking about, but I did a test in the printShowingPrintPanel of a program I'd written. The NSPrintInfo methods setLeftMargin, setBottomMargin, setRightMargin and setTopMargin all affect the margin values within the NSPrintInfo instance. Here's the test code with the before and after values I saw. - (void)printShowingPrintPanel:(BOOL)flag { NSPrintInfo *printInfo = [NSPrintInfo sharedPrintInfo]; float testLeft = [printInfo leftMargin]; float testBottom = [printInfo bottomMargin]; float testRight = [printInfo rightMargin]; float testTop= [printInfo topMargin]; // L, T, R, B IS NOW 72, 90, 72, 90 [printInfo setLeftMargin: 0]; [printInfo setBottomMargin: 0]; [printInfo setRightMargin: 0]; [printInfo setTopMargin:0]; testLeft = [printInfo leftMargin]; testBottom = [printInfo bottomMargin]; testRight = [printInfo rightMargin]; testTop= [printInfo topMargin]; // L, T, R, B IS NOW 0, 0, 0, 0 ... } This was done using Xcode 3.1.3. HTH, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Problem with NSDecimalNumber truncating zeros
Eric, I agree with Keary that NSNumberFormatter holds the solution to your problem. Here are links to pertinent documentation. HTH, Joel http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSFormatter_Class/Reference/Reference.html http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/DataFormatting/DataFormatting.html ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Switching Contents of NSView
Pierce, As an adjunct to document reading skills, I've found that there's no substitute for a class browser. Andy Lee has written Appkido, an excellent class browser for Cocoa! http://homepage.mac.com/aglee/downloads/appkido.html There are other ways to browse the Cocoa class hierarchy, but Appkido is my favorite :-) Thanks Andy!! Yours in Cocoa, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Booleans
John, I believe the problem is that you're treating the boolean as a pointer. HTH, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
[MEET] Silicon Valley CocoaHeads, Thursday, April 23
Silicon Valley CocoaHeads is meeting Thursday, April 23 at 7pm (sharp) Apple Building 4 — Garage 1 Meeting Room As announced on Theocacao: http://theocacao.com/document.page/604 Our featured speaker is Wil Shipley of Delicious Monster, who will share what he's learned while writing his first iPhone app. Sincerely, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Reading one line at a time using NSFileHandle
Is there a way to read one line of a text file at a time using NSFileHandle (the way fgets does)? This code illustrates how you might approach filtering lines of data obtained through an NSFileHandle. NSFileHandle* yourFileHandle; NSString* input; NSArray* lines; int i; input = [[NSString alloc] initWithData: [yourFileHandle availableData] encoding: NSUTF8StringEncoding]; [input autorelease]; lines = [input componentsSeparatedByString: @\n]; for (i = 0; i [lines count]; i++) { if ([[lines objectAtIndex:i] hasPrefix: @Oh Noes!]) { result = YES; break; } } Caveat: I just typed it up. HTH, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: problems with NSTextField destroying background
Hi Memo, Try doing setDrawsBackground:NO when you initialize your NSTextFields. HTH, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Do I need to relase @string ??
While it's important to keep Objective C's memory management model and rules in mind, I've found the LLVM/Clang Static Analyzer to be the perfect tool for double-checking my code. It's a lot less neurotic than trying to remember everything, all the time, especially when you're starting out. Eric Orion Anderson did this very helpful tutorial: http://www.therareair.com/2008/09/26/tutorial-how-to-static-analyze-your-objective-c-code-using-the-clang-static-analyzer-tool/ http://tinyurl.com/d7p3pp Sincerely, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Log4Cocoa
This doesn't answer the original question, but I believe it is pertinent to this thread. It is also possible to log from within Xcode, something I hadn't realized until I saw the video of an excellent talk Joar Wingfors gave at a Silicon Valley Cocoaheads. Joel http://video.google.com/videoplay?docid=3598467380866353869 http://theocacao.com/downloads/DebuggingWithXcode.pdf ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Paginated PDF from NSView saved in memory
Dragan, This doesn't answer your questions, but it might be a useful hint pointing you toward a solution. I think the key method you want to use is [NSView dataWithPDFInsideRect] It's discussed in the Generating EPS and PDF Data section of Apple's printing doc. A print operation does not have to send its results to a printer. You can have the operation generate raw PDF or EPS data and write the data either to an NSMutableData object you provide or to a file at a path you specify. http://developer.apple.com/documentation/Cocoa/Conceptual/Printing/Printing.pdf HTH, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: reading a PDF
Antonio, Thank you for laying out this recipe; you really know this stuff! (Not that there was any question, given your flagship application PDFClerk :-) Thank you for deepening my understanding of working with PDFs! Torsten, The code I mentioned to you Creating and Examining PDF Documents is available online, something that eluded me in my initial note in this thread. It's in the Programming with Quartz code which David Gelphman has generously made available online :-) http://tinyurl.com/5b2c9w Namaste, Joel http://frameworker.wordpress.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: reading a PDF
Hi Torsten, I haven't looked extensively into the latest Apple documentation on this subject and wouldn't be surprised if it has been rolled in recently, but David Gelphman's Programming with Quartz does go into this in some detail. Chapter 14, Creating and Examining PDF Documents, contains a listing (Listing 14.11) of fairly extensive code showing how to count and categorize the images used on each page of a PDF document. Also, the quartz-dev mailing list would be another good place to discuss your topic. Best Wishes for Technical Success! Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Tabbing PDF Annotation Editor between annotations in edit mode?
On Nov 14, 2008, at 12:18 PM, Joel Norvell wrote: I want to modify the PDF Annotation Editor so that it will tab from annotation-to-annotation in edit mode, just like it does in test mode. And since PDFAnnotation isn't an NSView subclass, I'll have to create a mechanism that hears tab events and then updates the current annotation by hand. On Nov 14, 2008, at 12:28 PM, John Calhoun wrote: My first thought would be to go a different route ... grab keyDown's in your PDFView subclass and keep track of the current annotation with focus. Manually advance the focus by going round-robin threough the annotaions on the page. If you can do something more sophisticated though, go for it. :-) On Nov 15, 2008, at 01:05 AM, Joel Norvell wrote: John, I'd wrongly convinced myself that your approach was problematic; but it is exactly the right one! I've posted the code for this recipé in a blog entry: Tabbing In PDF Annotation Editor. http://tinyurl.com/6rbpy5 Yours in Cocoa, Joel http://frameworker.wordpress.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Tabbing PDF Annotation Editor between annotations in edit mode?
Dear Cocoa-dev People, I've been tangling with this question most of the morning and was hoping for some guidance on how to proceed. I want to modify the PDF Annotation Editor so that it will tab from annotation-to-annotation in edit mode, just like it does in test mode. What is the key to accomplishing this? Is there something simple I've overlooked? I'm thinking that I'll need to build something like a keyView chain (responder chain), procedurally, on a per-annotation basis. And since PDFAnnotation isn't an NSView subclass, I'll have to create a mechanism that hears tab events and then updates the current annotation by hand. Since this approach is a bit complicated, I wanted to ask the group for confirmation first, lest I proceed down a rabbit hole. Yours sincerely, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Tabbing PDF Annotation Editor between annotations in edit mode?
On Nov 14, 2008, at 12:18 PM, Joel Norvell wrote: I want to modify the PDF Annotation Editor so that it will tab from annotation-to-annotation in edit mode, just like it does in test mode. And since PDFAnnotation isn't an NSView subclass, I'll have to create a mechanism that hears tab events and then updates the current annotation by hand. On Nov 14, 2008, at 12:28 PM, John Calhoun wrote: My first thought would be to go a different route ... grab keyDown's in your PDFView subclass and keep track of the current annotation with focus. Manually advance the focus by going round-robin threough the annotaions on the page. If you can do something more sophisticated though, go for it. :-) John, I'd wrongly convinced myself that your approach was problematic; but it is exactly the right one! Thank you very much! Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Problem with NSData to NSString to NSData
Dear Cocoa-dev People, I wanted to thank everyone for their helpful replies to my question: How to save metadata for a PDF file? Graham, thank you for confirming and clarifying the Cocoa way. Your caveat (problem with other pdf readers) was also well taken! Ricky, thank you for your trenchant analysis and commentary. The reification of your suggested approach, by mentioning the TextEdit example, was way helpful! Michael, you've identified additional (and compelling) approaches that I'd have never quantified on my own! They bear looking into; part of my continuing Cocoa education :-) Dave, you know a lot about the PDF format! Thanks for quantifing a PDF compatible way to append metadata to a PDF! Jeff, you also know a lot about the PDF format! Thanks for clarifying another PDF compatible way to append metadata to a PDF! Marcel, thanks for your reply! My conclusion is that The Cocoa Way would be to use NSFileWrappers. (Not to deprecate the suggested PDF approaches – there's nothing wrong with them.) I've looked at using NSFileWrappers, but still have some questions. My plan is to take them to NSCoder Night (in Campbell) and flesh out the recipe, part of my ongoing Cocoa education :-) As an aside, I want to strongly recommend Eric Buck's Cocoa Design Patterns which led me toward the NSFileWrapper approach in the first place! (It's available through Safari Books Online Rough Cuts.) Many thanks, Joel Norvell ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Problem with NSData to NSString to NSData
Dear Cocoa-dev People, First, I wanted to thank Aki Inoue and Rob Keniger for pointing out the problem with my NSData-NSString-NSData approach. As an alternative, would it be fruitful to use a Directory Wrapper to represent the data as two files; one the metadata and the other the pdf? Then I could work with the metadata file, but just display the pdf file. In the What could go wrong here? department, would my compound file end up behaving like a directory (or worse)? Many thanks, Joel Norvell On 2008/10/28, at 21:43, Joel Norvell email_removed wrote: Dear Cocoa-dev People, I have a file with some metadata prepended to a pdf. I want to strip the metadata off and display the pdf. I was trying to do this: - (void) loadFromPath: (NSString *) path { NSData *myData = [NSData dataWithContentsOfFile:path]; NSString *myStr = [[NSString alloc] initWithData:pdfData encoding:NSASCIIStringEncoding]; // I strip off the metadata here, leaving the pdfStr. // Nothing I've tried here has worked: NSData * myNewData = [pdfStr dataUsingEncoding: ???]; // Display the pdf here... } How can I get this to work? Sincerely, Joel Norvell ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Problem with NSData to NSString to NSData
Dear Cocoa-dev People, I have a file with some metadata prepended to a pdf. I want to strip the metadata off and display the pdf. I was trying to do this: - (void) loadFromPath: (NSString *) path { NSData *myData = [NSData dataWithContentsOfFile:path]; NSString *myStr = [[NSString alloc] initWithData:pdfData encoding:NSASCIIStringEncoding]; // I strip off the metadata here, leaving the pdfStr. // Nothing I've tried here has worked: NSData * myNewData = [pdfStr dataUsingEncoding: ???]; // Display the pdf here... } How can I get this to work? Sincerely, Joel Norvell ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: BOOL array
I'm resending this to correct an egregious attribution error in my previous post. My comment remains the same. On Sep 9, 2008, at 03:24, Alex Reynolds wrote: I am currently putting 320 to 480 character long NSString * instances into an NSMutableArray. The characters are 0 or 1. I guess I could use an int array, but I'm looking to speed up my app and reduce storage. Is it possible to create a BOOL array that can be put into an NSMutableArray? On Sep 10, 2008, at 02:32, Todd Blanchard wrote: You might consider using a NSMutableIndexSet since your problem basically boils down to storing membership in a set for each of a ranch of numbers. NSIndexSet is what things like NSTable use to track selected rows. I would think it would be hard to beat that without going to a raw C bitmap implementation. It will be MUCH better than what you have now. The values in an NSMutableIndexSet are always sorted, so the order in which they are added is not preserved. Wouldn't that defeat the purpose of the OP's data structure? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: BOOL array
OK. I think I've got it. One could use an increasing sequence of integers, letting evenness and oddness determine the boolean state at any index. That would save a huge amount of overhead in this case! --- On Wed, 9/10/08, Todd Blanchard wrote: Well, if I read it right, he's using the NSString as a very expensive bit vector - only storing 0's and 1's. If instead of storing a '1' at position n he sticks n into the NSMutableIndexSet, it amounts to the same thing. He can keep an array of NSMutableIndexSets instead of an array of NSStrings. On Sep 9, 2008, at 11:51 PM, Joel Norvell wrote: The values in an NSMutableIndexSet are always sorted, so the order in which they are added is not preserved. Wouldn't that defeat the purpose of the OP's data structure? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: BOOL array
Yes, only storing ones would work well with NSMutableIndexSet's containsIndex method. If you didn't get a hit you'd know that that position was a zero. I was incorrectly thinking of NSMutableIndexSet as an array. --- On Wed, 9/10/08, Shawn Erickson [EMAIL PROTECTED] wrote: On Wed, Sep 10, 2008 at 9:18 AM, Joel Norvell wrote: OK. I think I've got it. One could use an increasing sequence of integers, letting evenness and oddness determine the boolean state at any index. That would save a huge amount of overhead in this case! You only need to store the index of all the ones not need for even/odd business. You then walk the index set picking out the ones and marking down zeros for those indexes not in the set, etc. Of course the bit vector that someone suggested earlier is likely a better tool for this. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: -dataWithPDFInsideRect: unsafe within -drawRect:?
Hi Graham, You might try saving and restoring graphics states for the pertinent NSGraphicsContexts, although this wouldn't seem to explain why your code broke. Sincerely, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Challenge 18 in Hillegass Book
Hi James, I'd recommend looking at the AppKit Sketch example for architecture and Scott Stevenson's tutorial for using NSBezierPath: http://cocoadevcentral.com/d/intro_to_quartz_two/ HTH, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Does NSTextField conform to NSEditor (commitEditing specifically)?
Hello Sean, I'm no expert on the NSEditor informal protocol, but there was a recent thread in which Ken Thomases reply (which I've quoted below) might be of help to you. http://www.cocoabuilder.com/archive/message/cocoa/2008/7/25/214002 Sincerely, Joel On Jul 25 06:13 AM, Ken Thomases wrote: You don't mention if you're using bindings. If you are, you should send one of the -commitEditing... messages to the NSController-derived mediating controllers. This is part of the NSEditor information protocol. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: How to locate coding examples for specified commands [Newbie]
Phil, I'd add Google Code Search to the aforementioned. http://www.google.com/codesearch In its advanced mode you can stipulate that the match must be in Objective-C. Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Correct way to commit pending text field edits?
Graham Cox wrote: I need a way to commit ... pending edits as part of my response to the Apply button. I don't know that this is the correct way, but there is a built-in mechanism that will do what you want: If you were to makeFirstResponder nil for the window containing the text field, the textDidEndEditing method would be called on the active text field and then its data could be saved normally. You'd lose the edit state of course, but if you're applying changes I'm guessing that would be OK. HTH, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Correct way to commit pending text field edits?
chaitanya pandit wrote: You need to call this on the NSTextField's cell: setSendsActionOnEndEditing:YES sendsActionOnEndEditing appears to be ON by default. And it doesn't affect pending edits anyway. The problem is how to cause textDidEndEditing to fire. Hence my suggestion to makeFirstResponder nil for the window containing the text field. Although Ken Ferry's suggestion send one of the -commitEditing... messages to the NSController-derived mediating controllers. This is part of the NSEditor information protocol. seems more elegant than my suggestion to just slam the window's firstResponder. Sincerely, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: PropertyList - NSBrowser / NSOutlineView?
Joeles, The NIBs and Xcode project files seem to be absent, but you can still see the source code for OutlineMe in Google Code Search. Go to: http://google.com/codesearch And enter: OutlineMe lang:objectivec HTH, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
RE: NSApp delegate without a nib
Francisco, It is possible to set the application delegate ... without subclassing NSApplication or mucking around inside of main(). But I don't know an approach that doesn't require using IB. When I needed to do this, I used Mark Ericksen's very clear recipe from 2001: Re: [NSApp setDelegate] http://www.cocoabuilder.com/archive/message/cocoa/2001/6/5/40691 HTH, Joel On Jul 17, 2008, at 11:28 AM, Francisco Tolmasky wrote: I've looked around the docs quite a bit and haven't been able to find an answer to this. Basically, I'd like to know if it is at all possible to set the application delegate without a nib, and without subclassing NSApplication or mucking around inside of main (). Is there something similar to NSPrincipalClass in the Info.plist like NSApplicationDelegate or something? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: A question of style: Returning 'pairs'
I'd use an NSArray for this, wrapping the offset in an NSNumber. Joel P.S. Note to Mr. Butler: The correct term is complement; not compliment. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: SSCrypto Framework
Dear Trygve, Another resource is Wade Tregaskis' Keychain Framework, which I've used. I've just taken a cursory glance at the SSCrypto Framework and they seem to overlap. Keychain seems more extensive, but the SSCrypto API does look very clean, as far as it goes. Sincerely, Joel http://sourceforge.net/projects/keychain/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: PDFKit guidance
Torsten, These aren't really PDFKit issues. PDF is a native Quartz data type. The issues you mentioned, scaling and color, are addressed in the Cocoa Drawing Guide. You probably want to use an Affine Transform for scaling. I'm not sure about how to go grayscale, but looks like NSColorSpace and NSColor would be involved. HTH, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: PDFKit guidance
Torsten, John Calhoun wrote: So, PDF Kit can I think do what you want. I stand corrected! But (to salvage a little face :-) you can't go wrong by reading the Cocoa Drawing Guide. Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: PDFView's NSPrintPanel : Determine if Print / Cancel clicked?
Hi Will, I'm not sure what you mean by adjust custom PDFPage drawing after the page has printed. And this may be no help at all, but if you could factor that drawing into drawPagePost (in 10.5 PDF Kit), then it wouldn't be printed, but it would be drawn on the screen. You could look at John Calhoun's PDFView Subclasser sample program for a code example if this is pertinent to your situation. Best regards, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: PDFDocuments and CGPDFDocuments
Kevin, The PDFAnnotationEditor example program does a lot of this sort of thing; have you looked at it? Also, any operation you can perform on an NSView also applies to a PDFView; plus you have the additional PDFView protocol. Other pertinent resources would be Apple's quartz-dev list and David Gelphman's beautiful book, Programming With Quartz. HTH, Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: validateMenuItem() not always being called
Jeff, You need to call super for the else cases. Are you doing that? Joel - (BOOL) validateMenuItem: (NSMenuItem *) menuItem { BOOL enable = NO; if ([menuItem action] == @selector(yourSelector:)) { if (yourEnablingLogicForThisSelectorIsSatisfied) { enable = YES; } } else if ... { } else { enable = [super validateMenuItem:menuItem]; } return enable; } ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Saving/restoring PDFAnnotationTextWidget stringValues with PDFKit 10.5
This is roughly the recipe Antonio suggested, although I'm shoehorning the widget data into the pdf itself; probably heretical, but it seemed like the practical thing to do. Synchronistically, I'd written this before posting my question :-) http://frameworker.wordpress.com/2008/05/06/a-cocoa-recipe-to-edit-pdf-forms/ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Saving/restoring PDFAnnotationTextWidget stringValues with PDFKit 10.5
If you use PDFKit 10.5 to save and then restore a pdf file, are PDFAnnotationTextWidget stringValues preserved? (These are the text fields that you enter in PDF forms.) They aren't being saved/restored in my program. This is the line that creates the pdfData which is written to my file: NSData * pdfData = [[_pdfView document] dataRepresentation]; The PDFKit documentation doesn't seem to answer this question (or else I missed it). I looked through the Cocoa-dev archives and saw one post Re: Editable PDFAnnotation that made me think they should be saved/restored under 10.5. But I've noticed that Preview 4.1 doesn't save that data, so now I'm confused. I'm using a June 2007 MacBook Pro with 10.5.2 and Xcode 3.0 and my Additional SDKs and Base SDK Path are both blank which I believe is supposed to resolve to the most current (10.5) SDK. Thank you for your consideration! From the Twilight Zone, Joel Norvell Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Saving/restoring PDFAnnotationTextWidget stringValues with PDFKit 10.5
Dear Antonio, Thank you very much for clarifying this! And CONGRATULATIONS on your new PDFClerk Pro 3.0 rewritten from the ground up to take advantage of Mac OS X 10.5's many improvements! Best regards, Joel --- Antonio Nunes [EMAIL PROTECTED] wrote: On May 3, 2008, at 6:54 AM, Joel Norvell wrote: If you use PDFKit 10.5 to save and then restore a pdf file, are PDFAnnotationTextWidget stringValues preserved? (These are the text fields that you enter in PDF forms.) They are not preserved. If you are saving data into your own file format you can can query the widgets at saving time and write them out explicitly. Then restore them when the file is read back in, after the PDF pages have been restored. António - Accepting others as they are brings a wonderful freedom to your own mind. --The Peace Formula - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Cocoa Tutoring in SF Bay Area
Hi Brad, Based on the description of your application, I think you'll find Brent Simmons' excellent XML-RPC Class for Cocoa helpful. And as Eric Wing pointed out, you can't go wrong with Cocoaheads and NSCoder Night! Sincerely, Joel http://ranchero.com/cocoa/xmlrpc/ You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Simple menu-action question
Hi Rick, The Sketch example program (Developer-Examples-AppKit-Sketch) adds some menu commands. I used it as an example when I was puzzling out how to add a menu item with new commands and then handle those commands in my first app. Hope this helps, Joel Like movies? Here's a limited-time offer: Blockbuster Total Access for one month at no cost. http://tc.deals.yahoo.com/tc/blockbuster/text4.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]