Francois- Wow! Thanks for making that Flash recording: http://francois.schnell.free.fr/bazar/patapata-test1/patapata-test1.html That is a neat demo showing things I had not even thought of, like with the jumping Morphs (and far beyond my presentation skills). My wife is now finally impressed somewhat with what I am doing. :-) The version you are using did benefit from her trying an earlier version and her feedback on it, as several things she (also a programmer) tried that were hard or confusing or generated errors, I made easier or fixed.
Your presentation almost made me think of one of Alan Kay's Squeak demos. Perhaps your familiarity with Squeak made is easier to understand what I was attempting with PataPata (especially without any tutorial documents)? Now that you made a video, perhaps that spark of enlightenment will spread. :-) To answer your first question: To add a method, try right-clicking in the yellow inspector pane to get a menu which will allow you to make new child or sibling nodes of a prototype you are inspecting (or to copy, rename or delete a node). [Unless that is a bug under wx on your XP? system?] (I used to have a help text about the right click menu but it got dropped a while back.) "Child" nodes are children of the node you have selected, usually you want to create a "sibling" node if you have already clicked on a method or value of a Morph or Prototype you are interested in. To make a new method, you enter the name of the new field in the first popup box. Then after clicking OK there, a second popup box comes up where you need to enter "method" without the quotes, and after you click OK there you can modify the default method text in the edit window below the yellow inspector pane. You need to enter "method" as otherwise the system will try to evaluate what you enter, which by default is a string. It's a bit awkward to use the popups (as opposed to, say, a custom new value entry dialog with radio buttons for method, string, or expression type), but it was easy to implement as a first try. While it is more prone to error, instead of typing "method", you could also enter a PrototypeMethod constructor to evaluate as an expression, such as: PrototypeMethod(None, "def foo(self): print 'foo'") which I just tested by adding a foo field to Morph 0 and then entering the following in the PyShell (the scrolling window at the bottom): world.morphs[0].foo() which should print "foo". Not sure how robust this second approach is though; some tricky things happen with how PrototypeMethods are bound to instances which I still need to clean up; I still need to resolve a bug related to copying morphs with local methods where modifying the original sometimes modifies the copy. To answer your second question: To execute a method in another morph, you must first have a pointer to that morph directly. Ideally, that would be supported by cut and paste in the inspector, but you can't do that yet. However, you can, say, go to Morph 0 and add a field and call it "morph1" and then when asked for the value, enter (without quotes): "world.morphs[1]" which will evaluate to Morph 1 in the world. Then you could reference "self.morph1" in any method of Morph 0, like to call "self,morph1.X()" directly. I just tried that, adding "self.morph1.x += 10" to the mouseDown method of Morph 0, so now you can click on Morph 0 and Morph 1 moves (what I guess might be your intent, based on your demo?) You could also just reference "self.world.morphs[1]" directly in your methods, but if you add or delete morphs in the world, then the morph that position 1 of that list refers to might change. I'm guessing you're using WinXP? Nice to see the wxWindows button dragging properly. Under wx GTK 2.6 there is a library bug where a button only moves when you let go of it as it; otherwise the button eats all mouse events after you click in it until you release it; PythonCard has the same issue under GNU/Linux witht hat GTK version; one reason I am considering drawing my own widgets. So many times one does things and thinks no one notices or cares, so I'm very excited to see someone trying it (and going to the effort to make a Flash video, too). Thanks again for trying it and the encouragement. As regards future evolution, right now I'm at a decision point as to whether to push forward in Python further or, as per my previous discussions here with Kirby where he rightly points to dominant paradigms in specific languages, to jump to something like OCaml and use it to build a Self-like prototype language on top of it (something like io, which looks great, http://www.iolanguage.com/about/ but with a Smalltalk/Self-derived keyword syntax, which I feel is desirable), and so essentially producing a system that supports two extremes of permissiveness at two different levels -- strong (but implicit) typing at a speedy supporting layer and anything-goes prototypes above that for most GUI development work. On the other hand, I am making a lot of progress with Python (and not knowing OCaml much) and a Python version has value to me for other reasons. So, this seems like a big vote on keeping it all in Python for now? All the best. --Paul Fernhout francois schnell wrote: > On 26/05/06, Paul D. Fernhout <[EMAIL PROTECTED]> wrote: > >> >> >> I think Self leads the way here in generality with one inspector that can >> be used to build GUIs, programs, or just sets of objects. And here is an >> attempt to bring that ease of use to Python, building on ideas from Self >> (and Squeak): :-) >> >> http://svn.sourceforge.net/viewcvs.cgi/patapata/trunk/PataPata/PataPata.py?view=log >> >> >> Doesn't succeed yet perhaps in making that beginner friendly, but a >> start. >> (PythonCard is much better choice for current work though.) > > > > Hello, > > I've just gave a try to your "PataPata" and I already have fun with it > while > "testing" it :) > http://francois.schnell.free.fr/bazar/patapata-test1/patapata-test1.html > > Will it be possible to directly add new methods to morphs (maybe from the > inspector ? ... when I saw the 'grow' method I wanted a "shrink' one ...). > Is there a way yet to execute a Morph method from another Morph (if I click > on Morph 1 I'd like to execute method X from Morph 2 for example). > > I find your "PataPata" promising and I'm eager to see how it evolves :) > > francois > > > > --Paul Fernhout _______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig