• 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
NSPasteBoard - Copying contents of NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: NSPasteBoard - Copying contents of NSTextField
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Re: accessibility vs dock
  • Next by Date: Re: Mouse click inside NSView
  • Previous by thread: Re: accessibility vs dock
  • Next by thread: Re: NSPasteBoard - Copying contents of NSTextField
  • Index(es):
    • Date
    • Thread