Copy via Pasteboard
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]
initWith
Data:[self dataWithPDFInsideRect:[self bounds]]];
[pboard declareTypes:[NSArray
arrayWithObjects:NSPICTPboardType, NSPDFPboardType, nil]
owner:nil];
[pboard set
Data:[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