Re: selectText of NSTextField on focus

2015-07-06 Thread Joel Norvell
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.") Sincere

Re: "Sticky" Event tracking

2009-10-22 Thread Joel Norvell
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 __

[MEET] Silicon Valley CocoaHeads, Thursday, November 12

2009-11-11 Thread Joel Norvell
Silicon Valley CocoaHeads is meeting Thursday, November 12 at 7 p.m. (sharp) Apple Building 4 — Garage 1 Meeting Room As announced on Theocacao: Our featured speaker is Rob Rhyne who will give a talk on "Intuitive Design for the iPhone." Sincerely,

Re: PDFView focus ring

2012-02-01 Thread Joel Norvell
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

Re: Help finding documentation about printing

2011-07-10 Thread Joel Norvell
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 W

Unexpected PDFKit behavior in -[PDFPage string]

2010-01-21 Thread Joel Norvell
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 els

Re: Unexpected PDFKit behavior in -[PDFPage string]

2010-01-23 Thread Joel Norvell
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 c

Re: Switching Contents of NSView

2009-07-05 Thread Joel Norvell
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

Re: Problem with NSDecimalNumber truncating zeros

2009-07-06 Thread Joel Norvell
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/DOCUMENTA

Re: Confused about NSPrintInfo margins

2009-07-09 Thread Joel Norvell
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. H

Re: How to create programaticlly

2009-07-14 Thread Joel Norvell
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]; A

Re: How to create programaticlly

2009-07-14 Thread Joel Norvell
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: newBut

RE: missing vertical scroll bar

2009-07-17 Thread Joel Norvell
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 *wi

Re: Cocoa Graphics Parsing

2009-07-20 Thread Joel Norvell
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 moderat

Re: How to change focus ring color?

2009-07-31 Thread Joel Norvell
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

Re: How to change focus ring color?

2009-08-01 Thread Joel Norvell
Hi Alexander, If your object is always the First Responder, that would account for its focus ring always being redrawn. There's a lot of good information available, but you have to look around a bit to find it. Googling for - cocoa draw focus ring - shows some good results. The 2005 thread,

Is it valid to override awakeFromNib in my NSApplicationDelegate?

2012-03-25 Thread Joel Norvell
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

Re: Is it valid to override awakeFromNib in my NSApplicationDelegate?

2012-03-25 Thread Joel Norvell
Hi Fritz, Thank you very much for answering my question! Sincerely, Joel From: Fritz Anderson To: Joel Norvell Cc: "cocoa-dev@lists.apple.com" Sent: Sunday, March 25, 2012 11:02 AM Subject: Re: Is it valid to override awakeFro

Re: Transparent NSTextField

2012-06-28 Thread Joel Norvell
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:NSFocusR

Re: validateMenuItem() not always being called

2008-05-18 Thread Joel Norvell
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

Re: PDFDocuments and CGPDFDocuments

2008-05-29 Thread Joel Norvell
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

Re: PDFView's NSPrintPanel : Determine if Print / Cancel clicked?

2008-06-13 Thread Joel Norvell
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

Re: PDFKit guidance

2008-06-19 Thread Joel Norvell
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 NSColorSpa

Re: PDFKit guidance

2008-06-19 Thread Joel Norvell
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.

Re: SSCrypto Framework

2008-06-20 Thread Joel Norvell
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://sourc

Re: A question of style: Returning 'pairs'

2008-07-02 Thread Joel Norvell
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 request

RE: NSApp delegate without a nib

2008-07-17 Thread Joel Norvell
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 setDel

Re: PropertyList -> NSBrowser / NSOutlineView?

2008-07-22 Thread Joel Norvell
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-

Re: Correct way to commit pending text field edits?

2008-07-24 Thread Joel Norvell
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 fiel

Re: Correct way to commit pending text field edits?

2008-07-24 Thread Joel Norvell
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 "mak

Re: How to locate coding examples for specified commands [Newbie]

2008-07-26 Thread Joel Norvell
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) Pleas

Re: NSTextFieldCell - Kidnapped Focus Ring!

2008-07-30 Thread Joel Norvell
Hi Seth, My experience with focus rings has always been with NSView subclasses, not with cells. And my focus rings have always been drawn outside their views, adorning them, as it were. In the past, I have had to invalidate the focus ring's area with setKeyboardFocusRingNeedsDisplayInRect in

Re: Does NSTextField conform to NSEditor (commitEditing specifically)?

2008-08-07 Thread Joel Norvell
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 wrot

Re: Challenge 18 in Hillegass Book

2008-08-08 Thread Joel Norvell
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.ap

Re: -dataWithPDFInsideRect: unsafe within -drawRect:?

2008-08-29 Thread Joel Norvell
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 d

Re: BOOL array

2008-09-09 Thread Joel Norvell
> On Sep 9, 2008, at 18:43, Quincey Morris wrote: > > 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 spee

Re: BOOL array

2008-09-09 Thread Joel Norvell
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. >

Re: BOOL array

2008-09-10 Thread Joel Norvell
ead 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

Re: BOOL array

2008-09-10 Thread Joel Norvell
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 > > w

Re: Simple menu-action question

2008-03-31 Thread Joel Norvell
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 _

Re: Cocoa Tutoring in SF Bay Area

2008-04-01 Thread Joel Norvell
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/ ___

Saving/restoring PDFAnnotationTextWidget stringValues with PDFKit 10.5

2008-05-02 Thread Joel Norvell
e 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 no

Re: Saving/restoring PDFAnnotationTextWidget stringValues with PDFKit 10.5

2008-05-03 Thread Joel Norvell
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

Re: Saving/restoring PDFAnnotationTextWidget stringValues with PDFKit 10.5

2008-05-08 Thread Joel Norvell
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-rec

Re: Paginated PDF from NSView saved in memory

2008-12-30 Thread Joel Norvell
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

Re: Which language to get started with cocoa development?

2009-01-06 Thread Joel Norvell
Achim, This topic comes up on this list periodically. There was a good thread last October on "Why Objective-C?" http://www.cocoabuilder.com/archive/message/cocoa/2008/10/30/221401 (There are also other threads on this topic on this list.) Personally, I'd say you can't go wrong with ObjC. Bu

Re: Log4Cocoa

2009-01-23 Thread Joel Norvell
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/videopl

Re: Do I need to relase @"string" ??

2009-03-02 Thread Joel Norvell
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. Er

Problem with NSData to NSString to NSData

2008-10-28 Thread Joel Norvell
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/Unsubs

Re: Problem with NSData to NSString to NSData

2008-10-29 Thread Joel Norvell
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 <> wrote: > Dear Coc

Re: Problem with NSData to NSString to NSData

2008-10-31 Thread Joel Norvell
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

Tabbing PDF Annotation Editor between annotations in "edit mode"?

2008-11-14 Thread Joel Norvell
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 t

Re: Tabbing PDF Annotation Editor between annotations in "edit mode"?

2008-11-14 Thread Joel Norvell
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

Re: Tabbing PDF Annotation Editor between annotations in "edit mode"?

2008-11-15 Thread Joel Norvell
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." > > > > > &g

Re: reading a PDF

2008-11-29 Thread Joel Norvell
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

Re: reading a PDF

2008-11-30 Thread Joel Norvell
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

Re: Printing File to PDF from Native Application

2008-12-09 Thread Joel Norvell
Jeff, Would the NSView (or NSWindow) method dataWithPDFInsideRect be a starting point for you? It does let you obtain your view as PDF data. Though, there might be a more direct approach to get what you need just by using the basic printing classes. In case these resources have eluded your ra

Re: problems with NSTextField destroying background

2009-03-11 Thread Joel Norvell
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 moderat

Re: Reading one line at a time using NSFileHandle

2009-03-25 Thread Joel Norvell
> 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;

[MEET] Silicon Valley CocoaHeads, Thursday, April 23

2009-04-22 Thread Joel Norvell
Silicon Valley CocoaHeads is meeting Thursday, April 23 at 7pm (sharp) Apple Building 4 — Garage 1 Meeting Room As announced on Theocacao: "Our featured speaker is Wil Shipley of Delicious Monster, who will share what he's learned while writing his

Re: Booleans

2009-05-28 Thread Joel Norvell
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 c

Zooming Breaks Focus-ring Architecture (10.13.1)

2017-12-04 Thread Joel Norvell
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

Quicksand boxed – a tale of woe.

2018-04-12 Thread Joel Norvell
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

Re: NSDrawer

2018-07-18 Thread Joel Norvell
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