[squeak-dev] How do I move a morph from one project to another?
Bob Arning
arning315 at comcast.net
Wed May 2 12:09:01 UTC 2018
In the course of this discussion, it seemed like drag&drop might be
handy for some use cases. Attached is a (really simple) DropZoneMorph
that can do whatever you like to things dropped into it.
On 5/2/18 5:48 AM, H. Hirzel wrote:
> Bob, thank you for the good summary of the points of discussion.
> I work in a similar way as Stéphane describes.
>
> --Hannes
>
> On 5/2/18, Stéphane Rollandin <lecteur at zogotounga.net> wrote:
>>> This all started with a simple problem that had a simple answer. Then
>>> many answers appeared without a clear notion of what the problem is. Who
>>> has a real problem that happens several times a day that takes too long
>>> to do? DTSTTCPW, anyone?
>> I use projects mostly as virtual desktops where I keep different aspects
>> of my work (be it development or music composition) more or less cleanly
>> separated.
>>
>> When I realize that what I'm working on is not anymore in the meant
>> scope of the current project, I create a new project and dispatch all
>> workspaces, browsers and other tools (including homemade ones such as
>> musical editors) that live in the current (usually crowded) World to the
>> world of that project.
>>
>> So I only deal with top-level morphs, and as I said earlier I added an
>> item in their red handle menu to easily send them away (usually several
>> morphs in a row). I also have another item for sending a morph copy to
>> another project, but I use this one much less often.
>>
>>
>> Stef
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20180502/7d05fd69/attachment.html>
-------------- next part --------------
'From Squeak5.1 of 23 August 2016 [latest update: #16548] on 2 May 2018 at 8:05:03 am'!
"Change Set: DropZone
Date: 2 May 2018
Author: Bob Arning
DropZoneMorph is a place to drop things to execute a user-supplied action. Examples in class comment"!
Morph subclass: #DropZoneMorph
instanceVariableNames: 'label action '
classVariableNames: ''
poolDictionaries: ''
category: 'Morphic-Widgets'!
!DropZoneMorph commentStamp: 'raa 5/2/2018 08:02' prior: 0!
DropZoneMorph new
openLabel: 'explore'
action: [ :m | m explore. #reject]
DropZoneMorph new
openLabel: 'to project unnamed'
action: [ :m | (Project named: 'Unnamed') world addMorph: m.]
DropZoneMorph new
openLabel: 'take a picture'
action: [ :m | m imageForm asMorph openInWorld. #reject]
!
!DropZoneMorph methodsFor: 'as yet unclassified' stamp: 'raa 5/2/2018 07:31'!
acceptDroppingMorph: aMorph event: evt
self halt.! !
!DropZoneMorph methodsFor: 'as yet unclassified' stamp: 'raa 5/2/2018 07:49'!
openLabel: l action: a
label _ l.
action _ a.
self
listDirection: #leftToRight;
hResizing: #shrinkWrap;
vResizing: #shrinkWrap;
extent: 1 at 1;
borderWidth: 0;
rubberBandCells: true;
color: Color paleBlue;
addMorph: (StringMorph contents: label) lock.
self openInWorld! !
!DropZoneMorph methodsFor: 'as yet unclassified' stamp: 'raa 5/2/2018 07:58'!
rejectDropEvent: anEvent
anEvent wasHandled: true.
(action value: anEvent contents) = #reject ifTrue: [
anEvent contents rejectDropMorphEvent: anEvent.
].
! !
!DropZoneMorph methodsFor: 'as yet unclassified' stamp: 'raa 5/2/2018 07:59'!
wantsDroppedMorph: aMorph event: evt
self halt.
! !
More information about the Squeak-dev
mailing list
|