NSPasteBoard - Copying contents of NSTextField
NSPasteBoard - Copying contents of NSTextField
- Subject: NSPasteBoard - Copying contents of NSTextField
- From: Oliver Cameron <email@hidden>
- Date: Tue, 9 Dec 2003 20:24:44 +0000
Hey guys,
Im trying to copy the contents of a NSTextField (the NSTextField is:
webColorTextField)
Heres the code:
- (void)copyContents:(id)sender
{
NSPasteboard *thePasteboard = [NSPasteboard generalPasteboard];
[thePasteboard setString:[webColorTextField stringValue]
forType:NSStringPboardType];
}
And this is attached to a button in the same window as the TextField.
It builds fine, but when I press the button, nothing is copied. Maybe
this should be mentioned, the TextField is non-editable.
Thanks,
Oliver
_______________________________________________
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.