• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Key Equivalents (and now TextField Delegate Problems)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Key Equivalents (and now TextField Delegate Problems)


  • Subject: Re: Key Equivalents (and now TextField Delegate Problems)
  • From: John Nairn <email@hidden>
  • Date: Wed, 15 May 2002 23:43:12 -0600

Thanks for the input, but I still can not get key equivalents to work. Here are some details:

1. The interface has a TextField, 3 buttons, and a TextView. The focus is on the TextField.

2. All buttons are connected to actions and all actions work correctly when the button is clicked

3. One, for example, has key equivalent Y, pop up at <no key> and command key check box checked

4. When running, the command keys are ignored. I set breakpoint in action routines to verify they never get called

Is the TextField (or TextView) interfering with the key events? Perhaps key equivalents only work when there are only buttons? Or do I need more to get them working?

P.S.: I have many problems associated with TextFields. For example, today I could not setDelegate for any TextFields. I could connect the delgate in Interface Builder but the delegate methods never get called. I am certain the delegate methods are working because they are also connected to two TextViews and they get called correctly by them (i.e., I set the delegate for many objects to one class but the set does not work for any TextField objects).

On Wednesday, May 15, 2002, at 05:20 PM, email@hidden wrote:

John Nairn wrote:
|I have three buttons and I set one to have "return"
|as a key equivalent and two to have command keys. The return causes a
|crash and the two key equivalents are ignored.
Without knowing more about how everything is set up, there's little that can be said.

I just created (using Project Builder and Interface Builder) a small app that has a window with three buttons, one with "return" for its key, the others with command-Y and command-=. Pressing each key is ignored, as expected. Nothing untoward--like a crash--occurs. I have to assume that (1) the "return" button has an "action connection", and (2) that the method invoked by the action connection is what's actually causing the crash.

|Maybe there is more to key equivalents then just setting them in
|Interface Builder, but I have not been able to find documentation. I
|would appreciate help or point me where to look.
I'm assuming that you're already aware that a button has to have an "action connection" made, which determines what Objective-C method is executed when the button is clicked (or its key equivalent pressed). If not, the Interface Builder documentation is a starting point (available from PB via the "Developer Tools" help), and the description of "Action Messages" (under "Events and Other Input", from "Cocoa Help" in the PB Help menu). Also, the Objective-C tutorial gets into setting up connections. (It's available only in PDF, unfortunately. You can find it in "Getting Started" under "Cocoa Help".) Setting the key equivalent and making the connection are pretty much it; everything else is window dressing, to make things prettier and easier to use.

To say anything specific, though, I'd need to see what your action method is doing.

Glen Fisher


----------------
John Nairn (1-801-581-3413, FAX: 1-801-581-4816)
Web page: http://www.mse.utah.edu
_______________________________________________
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.

  • Follow-Ups:
    • Re: Key Equivalents (and now TextField Delegate Problems)
      • From: email@hidden
References: 
 >Re: Key Equivalents (From: email@hidden)

  • Prev by Date: RE: Splitter Views
  • Next by Date: Re: Is there a tutorial/sample for displaying...
  • Previous by thread: Re: Key Equivalents
  • Next by thread: Re: Key Equivalents (and now TextField Delegate Problems)
  • Index(es):
    • Date
    • Thread