• 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
NSView selection range
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSView selection range


  • Subject: NSView selection range
  • From: Hasan Diwan <email@hidden>
  • Date: Fri, 11 Jun 2004 22:02:02 -0700

I have a WebView, which is an NSView subclass. I've checked the
NSResponder and NSView class documentation along with both of the
header files. What I'd like to do is as follows (in pseudocode):

- (IBAction)copy:(id)sender {
NSRange selection = [view rangeOfSelection];
if (selection == NULL) {
// custom copy
}
else {
[super copy:sender];
}
}
Effectively, I'd like to implement a custom behaviour to copy a
specific piece of data to the clipboard if there's no selection. If the
selection does exist, I'd like to process the operation as normal.
Question is how does Cocoa know if something's selected or not? Thanks
in advance!
Hasan Diwan {http://ibn.com/~hdiwan}
OpenPGP Fingerprint: 275D 0E84 550C D92A 4A56 732C 8528 2579 E6E9 4842

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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: NSView selection range
      • From: Hasan Diwan <email@hidden>
  • Prev by Date: Re: 30 day trial howto?
  • Next by Date: Re: Smooth Animation
  • Previous by thread: I need one or two good crackers
  • Next by thread: Re: NSView selection range
  • Index(es):
    • Date
    • Thread