Re: "Building Cocoa Applications" ch. 8
Re: "Building Cocoa Applications" ch. 8
- Subject: Re: "Building Cocoa Applications" ch. 8
- From: Paul Williamson <email@hidden>
- Date: Tue, 20 Aug 2002 17:22:36 -0700
At 5:26 PM -0500 8/20/02, Michael Grant wrote:
>
Okay, this is probably going to be a forehead-slapper, but I'm stumped. Why
>
*doesn't* keyboard input work for the '0' button in the calculator
>
application in Garfinkel & Mahoney? It's based on the button title, which is
>
a string, not an integer, so the mathematical properties of zero shouldn't
>
have anything to do with it... right?
The other two (invisible) buttons on the bottom row of the NSMatrix also have the title "0" by default, and nothing stops them from ending up in the keyTable. objectForKey: returns the first match, which is to one of the invisible buttons.
My preferred solution is to add only enabled buttons to keyTable in checkButton:.
-Paul
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.