• 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
Copy via Pasteboard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Copy via Pasteboard


  • Subject: Copy via Pasteboard
  • From: Stefan Jung <email@hidden>
  • Date: Tue, 10 Jul 2001 11:30:14 +0200

Hi,
I want to do the following:
Copy a PICT representation of a custom view that draws some lines
and text based upon the input from a table view to the pasteboard.

I have:
The table view and the custom view working all right. I put

- (IBAction)copy:(id)sender {
NSPasteboard *pboard = [NSPasteboard generalPasteboard];
NSPICTImageRep *specImagePICT = [[NSPICTImageRep alloc]
initWithData:[self dataWithPDFInsideRect:[self bounds]]];
[pboard declareTypes:[NSArray
arrayWithObjects:NSPICTPboardType, NSPDFPboardType, nil]
owner:nil];
[pboard setData:[specImagePICT PICTRepresentation]
forType:NSPICTPboardType];
}

- (BOOL)acceptsFirstResponder {
return YES;
}

- (BOOL)becomeFirstResponder {
return YES;
}
- (BOOL)validateMenuItem {
return YES; //just to try quick
}

into the view class implementation and connected the view as its
windows first responder.

The problem: Copy is always ghosted.

The solution: - fill in please- :-)

Thanks,

Stefan Jung


  • Follow-Ups:
    • Re: Copy via Pasteboard
      • From: Stéphane Sudre <email@hidden>
  • Prev by Date: Re: NSThread question
  • Next by Date: Re: Learning Cocoa book "Dot View" tutorial question
  • Previous by thread: Re: NSThread question
  • Next by thread: Re: Copy via Pasteboard
  • Index(es):
    • Date
    • Thread