• 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 completion fun
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView completion fun


  • Subject: Re: NSTextView completion fun
  • From: Duncan Campbell <email@hidden>
  • Date: Wed, 23 Nov 2005 08:57:49 +1100

I'm not sure if it's the best way to do things, but I am using an NSTableView (on an NSView) - ([myTextView addSubView:mySubView]) - This has it's datasource hooked up to some code that populates the correct values based on what the user has typed so far.

In the keyDown: event of the NSTextView, I look for enter/return/tab (I have a flag set to know whether i am showing the completion view or not), and the up/down arrows and forward these keystrokes onto my custom completion class which then tells the NSTableView to move forward/backward in the list, or select the item.

I have of course also overridden the default complete: method in the NSTextView to cause my custom completion to be shown.

Hope this helps.

On 23/11/2005, at 8:44 AM, Todd Ransom wrote:

Can you elaborate on this? Where you hooked into the table-view, did you use an overlay window, etc. I am also interested in getting away from the built-in completions support if it turns out to be worth the effort.

thanks,
Todd Ransom
Return Self Software
http://returnself.com



On Nov 22, 2005, at 12:42 PM, Duncan Campbell wrote:

thx Todd - but this then results in an extra entry in the completions list.

I have gone the route of rolling my own using an NSTableView, and overriding the built-in completion stuff - seems to work quite well.

On 23/11/2005, at 2:39 AM, Todd Ransom wrote:

The only way I found to do this way to add a one space entry " " to the list.

Todd Ransom
Return Self Software
http://returnself.com



On Nov 21, 2005, at 1:35 AM, Duncan Campbell wrote:

When using the completions in an NSTextView, if only 1 match is found then the completions menu does not show - instead the completion text is simply inserted into the textview.

Does anyone know of a way i can force the menu to always show, even if there is only 1 match?

Cheers.

Duncan Campbell
=====================
http://www.duncanandsarah.com


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com


This email sent to email@hidden





Duncan Campbell ===================== http://www.duncanandsarah.com







Duncan Campbell ===================== http://www.duncanandsarah.com http://www.objective-d.com


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >NSTextView completion fun (From: Duncan Campbell <email@hidden>)
 >Re: NSTextView completion fun (From: Todd Ransom <email@hidden>)
 >Re: NSTextView completion fun (From: Duncan Campbell <email@hidden>)
 >Re: NSTextView completion fun (From: Todd Ransom <email@hidden>)

  • Prev by Date: Re: NSTextView completion fun
  • Next by Date: Re: NSOpenPanel problem
  • Previous by thread: Re: NSTextView completion fun
  • Next by thread: CoreData: NSManagedContext not updating NSArrayController in UI
  • Index(es):
    • Date
    • Thread