Stéphane Ducasse wrote
which kind of files are you dropping because dropping a .st file does the same on 2.0 and 1.2
Yes, that's the problem. It's PasteUpMorph that handles all the dropped files. I want to make a custom Morph, DropZone, that handles dropped files. Of course i could alter PasteUpMorph, but there is a functionality that worked in 1.2 and works in Squeak, that ceased to work in 1.3+, that allowed to make morphs that handle dropped files.
Do you have a scenario that works in 1.2 because I got exactly the same behavior with 1.2 and 2.0? When I drop a txt file I get a workspace in both version. When do you get your halt open. in 1.2 I put an halt into Morph>>handleDropFiles: anEvent "Handle a drop from the OS." self halt. anEvent wasHandled ifTrue:[^self]. "not interested" (self wantsDropFiles: anEvent) ifFalse:[^self]. anEvent wasHandled: true. self dropFiles: anEvent. I tried the same on 2.0 and this is in both cases the PasteUpMorph that get it. So. ok in 1.1-11411 I got your halt. :) MorphicEventDispatcher>>dispatchDefault: anEvent with: aMorph "Dispatch the given event. The event will be passed to the front-most visible submorph that contains the position wrt. to the event." | localEvt index child morphs inside | "See if we're fully outside aMorphs bounds" (aMorph fullBounds containsPoint: anEvent position) ifFalse:[^#rejected]. "outside" "Traverse children" index := 1. morphs := aMorph submorphs. inside := false. [index <= morphs size] whileTrue:[ child := morphs at: index. localEvt := anEvent transformedBy: (child transformedFrom: aMorph). (child processEvent: localEvt using: self) == #rejected ifFalse:[ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "Not rejected. The event was in some submorph of the receiver" inside := true. localEvt wasHandled ifTrue:[anEvent copyHandlerState: localEvt]. index := morphs size. "break" ]. index := index + 1. ]. "Check for being inside the receiver" inside ifFalse:[inside := aMorph containsPoint: anEvent position event: anEvent]. inside ifTrue:[^aMorph handleEvent: anEvent]. ^#rejected
Background: I made an application for the psychology department of a university that parses Tobii eyetracker files (with PetitParser, which works AMAZINGLY WELL!) and does all sorts of calculations with them. I want to provide a nice interface, that allows users to drop the eyetracker files on a Pharo window to start the file processing.
-- View this message in context: http://forum.world.st/Problems-with-a-Morph-that-accepts-File-Dropping-in-Ph... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.