NSView selection range
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.