Monday, June 13, 2005

Steptalk integration ..

Now that I have something mostly working on the "stack" side .. what would be neat is to have a way of adding some little code snippets directly in Gorm and link them to actions; it's not meant to replace ObjC coding, but in my "hypercard"-like idea, it's ok -- you'll use small scripts to do some of the things, and if you want really complex stuff you can use objc objects. Well I guess people could abuse the script system, but hey..

So, the obvious way to add scripting is to use Steptalk, Stefan Urbanek's script engine for GNUstep. Furthermore, Steptalk isn't tied to a specific language (actually it can support a smalltalk-like language and scheme, and we could have something else like ruby in the future...).

I had a look to F-Script but I was disappointed by its IB palette.. basically it's not really useable for what I want ;-) -- even if I didn't want to use it, I was wondering how the palette was working, as I thought it permitted what I want... in fact, it kinda does, but by setting manually the targets/actions of objects in the script .. bah :-) -- I want something more easy to use.

Well, I compiled Steptalk on OSX to play a bit with it, and I'm trying to think about how the palette could work to provide an environment as easy to use as possible... F-Script palette's idea of defining a bunch of outlets (object1, object2, .. object9) on the F-Script view where you link objects to have them accessible from the script is a bit crude, but for a start it will do the work. Though I think it should be possible to create a custom editor/connector that will let you add outlets on the fly, which would be a better way. Need to ask greg about that :-)

So the idea is to create a Steptalk palette that will contain a "Steptalk object" (which will contains a steptalk environment and
a text containing the script). You will be able to connect outlets to this object (and theses outlets will then be accessible from the script), and also use it as a target (so you could connect a button to it, when the button is clicked it will execute the content of the script). That won't be a perfect system and not as transparent as visual basic / hypercard (eg, click on the button, you get a window with the corresponding code executed onClick), but that would be a start. This "Steptalk object" won't be a view, but we could have a simple view so you could put the script on your windows (this view won't show when the program is running...).

Something that could be interesting too is to use custom widgets that already contains a steptalk object, with their target/action set to it. For example, the Stack could (and probably should) contains such an object. Same for the cards. And we could have a custom button containing a steptalk object too, which will then permit the "I click on the button and the code appears" scenario...

No comments: