Better: Workspace>>acceptDroppingMorph: dropee event: evt inMorph: targetMorph "Return the dropee to its old position, and add a reference to it at the cursor point." | bindingName externalName reference | (dropee isKindOf: TransferMorph) ifTrue: [reference := dropee passenger. externalName := dropee passenger className] ifFalse: [reference := dropee. dropee externalName]. externalName := externalName isOctetString ifTrue: [externalName] ifFalse: ['a' , externalName]. bindingName := externalName translateToLowercase , reference identityHash printString. targetMorph correctSelectionWithString: bindingName , ' '. (self bindingOf: bindingName) value: reference. dropee rejectDropMorphEvent: evt. ^ true"success" On Thu, Mar 17, 2016 at 6:30 PM, karl ramberg <[hidden email]> wrote:
|
It seems though that the TransferMorphs are not very usable the way they are created when dragged out of inspectors. They are direct links to objects not to the instance variables. So they don't update if the instance variable change... Best, Karl On Thu, Mar 17, 2016 at 6:38 PM, karl ramberg <[hidden email]> wrote:
|
In reply to this post by Karl Ramberg
2016-03-17 17:55 GMT+01:00 Chris Muller <[hidden email]>:
> All Jakob had to do was "do it" on: > > myXml := '<SomeElement>.... all kinds of XML ... </SomeElement>' > > He now has access to myXml. Then replace all the text in the > workspace with that from the other workspace. Done. If the markup had not been "vast" (12 MB) and possibly full of single quotes, that would have been my way to go, too. I could have attempted a global search and replace for these, though... but then again even scrolling around felt sluggish with that much text in the Workspace. I could have done that :%s/'/''/g in a proper text editor, but instead I went crazy and grabbed the String from the TextMorph and wished to move it out of that Object Explorer... Many ways to accomplish the same thing, and a lot of them would probably have been more efficient than asking for that feature I had in mind, granted. In the end, or rather minutes after starting this thread, I solved my text transfer problem by copying the XML and doing `xmlString := Clipboard clipboardText string`... > I guess I see Workspaces for learning and discovery for newbies. > Short, simple, explorations of syntax and class library. > > Attempting to do work as complex as parsing a large XML is going to > present further challenges above and beyond accessing an object. If > someone feels the need to "link workspaces" they really should stop > and consider just making a class. In fact, I think linked workspaces > would lead a newbie down the wrong path.. I was not going to write the parsing in the workspace, but I wanted to conduct my experimenting from there, just like Karl said. And in the beginning, I needed the XML as a String object, to put it into the StAXParser, try out the parser API in the workspace and, eventually, put the parser into my reading object for which I have written a proper class, of course. :-) Hence, I do not really feel the need for linked workspaces, but I would like to move objects around the tools occasionally. That's why I was delighted to be introduced to that dropped references feature. I agree with the others that it would be convenient if the TransferMorphs were unpacked automatically. IMHO, the usual assignment semantics would suffice, no actual binding/referring to an instance variable required. If I wanted to be up to date with the object's state I would transfer that object itself and not an instance variable. |
In reply to this post by Chris Muller-3
2016-03-17 17:28 GMT+01:00 karl ramberg <[hidden email]>:
> > How about another copy command, like 'copy as reference' and then you could > paste it in another Workspace ? > I think I would have liked "paste as string literal" ;-) But using the clipboard for things other than text might be worthwhile, as an alternative to drag&drop from an Inspector. Then "Paste as reference" in workspaces -- or something similar in slot view/edit panes in the debugger, to overwrite the selected value with the previously copied object -- would be the actual innovation. Albeit the Clipboard class looks like it only stores text at the moment... but the "outside" clipboards have supported other data types for ages. |
On 18.03.2016, at 00:41, Jakob Reschke <[hidden email]> wrote: I'd like being able to paste object references, yes. Albeit the Clipboard class Oh. Do we still not have that in trunk? Ugh. I just copied this out of Etoys (get halo, press cmd-c) and pasted into this email: - Bert - smime.p7s (5K) Download Attachment |
Free forum by Nabble | Edit this page |