• 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: How can I retrieve the control's message?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I retrieve the control's message?


  • Subject: Re: How can I retrieve the control's message?
  • From: Nick Zitzmann <email@hidden>
  • Date: Mon, 28 Jan 2008 19:05:49 -0700


On Jan 28, 2008 AD, at 6:58 PM, 王兆明 wrote:

But, as you know, in Windows, there are many System-Defined custom messages,
such like WM_KEYDOWN, or, WM_NOTIFY, with these I can retrieve many
information or actions occurred on controls, such like the TreeView.


But in Mac, in cocoa, I can't find anything like them, I even don't know how
to hook the action when user input some text into the TextBox or when user
have select some node in TreeView, who can tell me, how to do this?


The Mac OS X equivalent is to subclass the view and override the method that handles the event, such as -keyDown:, -mouseDown:, etc.

But many classes, such as NSTextField, have either an action or delegate API that gets called when something happens, such as - controlTextDidChange:. If either a target/action or a delegate did- change method is present in the class (or superclass), then you should use them instead unless you really know what you're doing.

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How can I retrieve the control's message?
      • From: Douglas Davidson <email@hidden>
References: 
 >How can I retrieve the control's message? (From: 王兆明 <email@hidden>)

  • Prev by Date: Day designations in Leopard
  • Next by Date: Re: How can I retrieve the control's message?
  • Previous by thread: How can I retrieve the control's message?
  • Next by thread: Re: How can I retrieve the control's message?
  • Index(es):
    • Date
    • Thread