• 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 do you use NSTextView methods on a NSView ? (keywords: TextEdit, sort lines)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you use NSTextView methods on a NSView ? (keywords: TextEdit, sort lines)


  • Subject: Re: How do you use NSTextView methods on a NSView ? (keywords: TextEdit, sort lines)
  • From: Douglas Davidson <email@hidden>
  • Date: Thu, 20 Jul 2006 11:15:46 -0700


On Jul 20, 2006, at 9:59 AM, email@hidden wrote:

In "Wrap to Page" mode, however, the main view is a MultiplePageView, whose
superclass is just NSView (as can be seen in MultiplePageView.h). Ideally
I should like
to define the two "sort" methods above on MultiplePageView also, but this
is impossible
because the implementation of those methods needs to know what lines are
selected,
and so uses methods like attributedSubstringFromRange: that are not available
for a NSView.


I hoped that since I had connected my sort menu items in the nib file to
first-responder actions
and replaced about every occurrence of NSTextView in the source code with
GGTextView,
the sort feature would work automatically even in "Wrap to Page" mode. I
was wrong : at
runtime, the sort menu items are disabled when in "Wrap to Page" mode.



I don't know offhand why it wouldn't work; quite a few standard menu items go to first responder actions defined on NSTextView. Try investigating how everything is set up in your app; for example, take a look at your validation code, and see if that's being hit.


Incidentally, sorting of text lines is something that might reasonably be handled by a service, so that it would be available to all applications, rather than by custom application-specific code.

Douglas Davidson

_______________________________________________
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: 
 >How do you use NSTextView methods on a NSView ? (keywords: TextEdit, sort lines) (From: email@hidden)

  • Prev by Date: Re: performSelectorOnMainThread
  • Next by Date: bindings, tables and custom sort selector
  • Previous by thread: How do you use NSTextView methods on a NSView ? (keywords: TextEdit, sort lines)
  • Next by thread: Sending a custom object over NSConnection using socket ports
  • Index(es):
    • Date
    • Thread