• 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
Quartz composer drag and drop problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Quartz composer drag and drop problems


  • Subject: Quartz composer drag and drop problems
  • From: Pablo Pons Bordes <email@hidden>
  • Date: Mon, 16 Jan 2006 20:30:56 +0000

Hello, I'm trying to develop an application using some "new" technologies. Core data, Binding, and quartz composer (based on core image i think). to learn more about it

All the tecnologies are OK except for quarz composer. I'm put an Quartz composer composition (QCC) in my application. This composition have a published input called image (as all of you can imagine is an image type) i could change the image of the composition through my aplication.
The problems became when i try to implement the drag and drop on this view. firstly i try to implement the sorce of the drag and drop so i implements the methods:
- (unsigned int)draggingSourceOperationMaskForLocal:(BOOL)flag;
- (void)mouseDragged:(NSEvent *)event;


that are all the methods that i need to became a source of drag and drop.

The first chance i implement those methods as a category of QCView class in my appControler file. but it doesn't work so I inherit from QCView and make a customQCView class that the only methods that I implements was those. but nothing hapen again.

So some one have any sagestion to resolve this problem?

thanks

the code of the custom class is:

//
//  CustomGCView.m
//  shareDVD
//
//  Created by Pablo Pons Bordes on 15/01/06.
//  Copyright 2006 __MyCompanyName__. All rights reserved.
//

#import "CustomGCView.h"


@implementation CustomGCView

- (unsigned int)draggingSourceOperationMaskForLocal:(BOOL)flag
{
    return NSDragOperationCopy;
}


- (void)mouseDragged:(NSEvent *)event { NSPasteboard *pb; NSImage *anImage; NSPoint p;

	NSLog(@"mouse Dragged");

    // Create the image that will be dragged
    anImage = [[self  valueForInputKey:@"imagen"] retain];


    // Get the location of the drag event
    p = [self convertPoint:[event locationInWindow] fromView:nil];

    // Get the pasteboard
    pb = [NSPasteboard pasteboardWithName:NSDragPboard];

    // Put the string on the pasteboard
    [self writeImageToPasteboard:pb];

    // Start the drag
    [self dragImage:anImage
                 at:p
             offset:NSMakeSize(0,0)
              event:event
         pasteboard:pb
             source:self
          slideBack:YES];
    [anImage release];
}

- (void)writeImageToPasteboard:(NSPasteboard *)pb
{
NSImage * anImage;

anImage = [[self valueForInputKey:@"imagen"] retain];

// Declare types
[pb declareTypes:[NSArray arrayWithObject:NSTIFFPboardType] owner:self];
// Copy data to the pasteboard
[pb setData:[anImage TIFFRepresentation] forType:NSTIFFPboardType];
[anImage release];
}
@end






_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Quartz composer drag and drop problems
      • From: Guy English <email@hidden>
  • Prev by Date: Re: [Core Data] Improve save performance ?
  • Next by Date: Drawing into a WebView during drag time?
  • Previous by thread: Re: ANN: "Programming with Quartz"
  • Next by thread: Re: Quartz composer drag and drop problems
  • Index(es):
    • Date
    • Thread