From: kimura wataru<ki...@us...> - 2005-11-23 04:09:12
|
Hi, I think method "draggingSourceOperationMaskForLocal:" of protocol NSDraggingSource is missing. http://www.cocoabuilder.com/archive/message/cocoa/2005/8/3/143456 Tom Counsell wrote: >Hello > >I have a feeling this is a stupid question, but I just can't figure >it out. > >I have created a subclass of an NSOutlineView in order to implement >drag to trash. Everything works fine, except that the operation >variable passed by Cococa to the method >draggedImage_endedAt_operation isn't one of the OSX::NSDragOperation >constants: > >Whereas the OSX::NSDragOperationDelete constant is always the Fixnum >32, the operation returned is a Bignum with a variety of values. > >What am I missing? Why can't I compare the returned operation with >the constant? > RubyCocoa gets arguments' type of informal protocol from a class DummyProtocolHandler. I wondered a bug in this process. I tested the method draggedImange:endedAt:operation: and got fine result. ------ % cat dnd.rb require 'osx/cocoa' class DraggingSource < OSX::NSObject def draggedImage_endedAt_operation( animage, apoint, operation ) raise "error #{operation}" unless operation == OSX::NSDragOperationDelete nil end end drag = DraggingSource.alloc.init drag.ocm_send('draggedImage:endedAt:operation:', nil, [0,0], OSX::NSDragOperationDelete) % ruby -d dnd.rb : 2005-11-23 12:59:25.195 ruby[12834] RBOBJ:methodSignatureForSelector(draggedImag e:endedAt:operation:) 2005-11-23 12:59:25.196 ruby[12834] RBOBJ: --> NSMethodSignature: types=v@:@{_ NSPoint=ff}I nargs=5 sizeOfParams=160 returnValueLength=0; 2005-11-23 12:59:25.196 ruby[12834] OBJWRP:ocm_invoke (draggedImage:endedAt:oper ation:): ret_type=v * 2005-11-23 12:59:25.196 ruby[12834] OBJWRP: arg_type[0]: @ * 2005-11-23 12:59:25.196 ruby[12834] OBJWRP: arg_type[1]: {_NSPoint=ff} * 2005-11-23 12:59:25.197 ruby[12834] OBJWRP: arg_type[2]: I * 2005-11-23 12:59:25.197 ruby[12834] OBJWRP: NSInvocation#invoke (draggedImage :endedAt:operation:) ... 2005-11-23 12:59:25.197 ruby[12834] RBOBJ:methodSignatureForSelector(draggedImag e:endedAt:operation:) : ------ -- kimura wataru |