• 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: NSTextView question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView question


  • Subject: Re: NSTextView question
  • From: Simon Jacquier <email@hidden>
  • Date: Sun, 14 Apr 2002 14:02:11 +0200

email@hidden <email@hidden> wrote:

> i'm a newbie to cocoa and i'd like to know how to tell an NSTextField to send
> an action when the tabulation key is pressed. can u help me ?

You mean "to tell a _NSTextView_", right?

Make MyDocument the delegate for your TextView in Interface Builder
(double-click on your TextView, then control-click from the TextView to the
File's Owner to create a link, select the Delegate Outlet in the Inspector
and click Connect), and then add this method to MyDocument.m:

// circumvent the Tab key in the textView
- (BOOL)textView:(NSTextView *)myTextView doCommandBySelector:(SEL)command;
{
if (command == @selector(insertTab:))
{
// do someting here
return YES;
}
return NO;
}


Simon Jacquier
_______________________________________________
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.

References: 
 >NSTextView question (From: email@hidden)

  • Prev by Date: NSTextView question
  • Next by Date: Setting cursor position
  • Previous by thread: NSTextView question
  • Next by thread: Re: NSTextView question
  • Index(es):
    • Date
    • Thread