I imagine the answer to this is going to be pretty obvious. However... ;-)
When I pull an object from a flap onto the desktop, how can I get a handle on it so that I can send it messages programmatically? What I am hoping is that I could drag e.g. the bouncing atom thing into a project, and then - in a workspace? - be able to send it messages. Or, if this is completely the wrong approach, how else might I be able to play with an object instantiated in this way. Thanks AB _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
Hi Andy, Just "blue click" (Meta-click or whatever) on any object to bring up the Morphic handles. The second handle from the top on the right will let you inspect or explore the object, or browse its source code. Use the inspector or the explorer to send messages to the object. Very useful. Oscar On Feb 8, 2008, at 13:36, Andy Burnett wrote: > I imagine the answer to this is going to be pretty obvious. > However... ;-) > > When I pull an object from a flap onto the desktop, how can I get a > handle on it so that I can send it messages programmatically? What > I am hoping is that I could drag e.g. the bouncing atom thing into a > project, and then - in a workspace? - be able to send it messages. > Or, if this is completely the wrong approach, how else might I be > able to play with an object instantiated in this way. > > Thanks > AB > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
In reply to this post by Andy Burnett
Hello Andy,
AB> When I pull an object from a flap onto the desktop, how can I AB> get a handle on it so that I can send it messages AB> programmatically? What I am hoping is that I could drag e.g. the AB> bouncing atom thing into a project, and then - in a workspace? - AB> be able to send it messages. I long knew it was there, but it took me quite some time to find out. Hopefully by telling you, I will remember when I need it. Here goes: In the window menu of a Workspace (left of the cross to close it) you find an option "create textual references for dropped morphs". Set it and then drop your BouncingAtoms into the Workspace. The Morph will move back but in the Workspace you find something like "bouncing atoms1892" The bad news: If the name is a single word (like an Ellipse from the supplies flap) you then can send it messages. This doesn't work for representations with more than one words. Funny thing, if I use a StarMorph the reference is created but the Star goes to the trash! I tried this in 3.8, it maybe better or worse in younger images. Cheers Herbert mailto:[hidden email] _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
In reply to this post by Andy Burnett
El 2/8/08 9:36 AM, "Andy Burnett" <[hidden email]> escribió: > I imagine the answer to this is going to be pretty obvious. However... ;-) > > When I pull an object from a flap onto the desktop, how can I get a handle on > it so that I can send it messages programmatically? What I am hoping is that > I could drag e.g. the bouncing atom thing into a project, and then - in a > workspace? - be able to send it messages. Or, if this is completely the wrong > approach, how else might I be able to play with an object instantiated in this > way. > > Thanks > AB When the Inspector window shows, you have how to send messages to object in the lower pane (the code pane) As example, drag a Ellipse from the Supplies flap. Bring the halo with command-click., select the debug mode and bring the Inspector window with the "inspector morph". The window should say same like an EllipseMorph <Ellipse> (2954) In the lower pane type self color: Color red. Select and do it. In the debug , you also have an item labelled morph protocol and (text) or (tiles) for you see all messages this object could understand with same technique. In right panel, the methods marked in bold was implemented in same class, the others was inherited from some "mother" class or high in hierarchy. Which hierarchy ?, you say. In halo find the select browse class item and you bring the Hierarchy Browser. For EllipseMorph, the "mother" is BorderedMorph and up was Morph, Object, ProtoObject. So, any message this classes understand, your Ellipse understand. I advice you got a copy of SqueakByExample Cheers _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
In reply to this post by Herbert König
El 2/8/08 11:27 AM, "Herbert König" <[hidden email]> escribió: > I tried this in 3.8, it maybe better or worse in younger images. > > Cheers But better in 3.11 alpha , works as should be, so I imagine 3.10 gamma from which is derived also works. The future is always better :=) Edgar _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
In reply to this post by Andy Burnett
Also, there is a menu item in the workspace (click on the menu
button next to the close button in the title bar) called "create textual references to dropped morph". If you check the box, you can drop a morph onto the workspace and then you can refer to the object by the name created in the workspace from the workspace. However, this is not as effective as doing stuff in the inspector for it, as it has more "context" associated with it. -- Yoshiki At Fri, 8 Feb 2008 12:36:32 +0000, Andy Burnett wrote: > > [1 <multipart/alternative (7bit)>] > [1.1 <text/plain; ISO-8859-1 (7bit)>] > > [1.2 <text/html; ISO-8859-1 (7bit)>] > I imagine the answer to this is going to be pretty obvious. However... ;-) > > When I pull an object from a flap onto the desktop, how can I get a handle on it so that I can send it messages > programmatically? What I am hoping is that I could drag e.g. the bouncing atom thing into a project, and then - in a > workspace? - be able to send it messages. Or, if this is completely the wrong approach, how else might I be able to > play with an object instantiated in this way. > > Thanks > AB > > > [2 <text/plain; us-ascii (7bit)>] > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
Free forum by Nabble | Edit this page |