Hi Roel,
2) La deuxième question est encore assez générale :
Lorsque
l'utilisateur tape dans la zone textarea, on aimerait bien implémenter
une analyse de la syntaxe dynamique. Or il existe un attribut de
textarea qui est onKeyPress. Et demande comme paramètre une commande
script. Comment utiliser cela dans smalltalk? Et que doit-on mettre
dans la commande script pour pouvoir exécuter une méthode de la classe
même? (Par exemple, si on tape sur une touche, on appelle la méthode
MiseAjourTextarea de la classe).
doing dynamic things like the described one is very difficult using the
web, because the HTTP protocol only supports a one-way communication:
the client has to request a page.
The OnKeyPress-Attribute is part of the JavaScript extension to HTML
and allows sometimes to go around those limitiations. One could create
a textarea using the following the shape of
<textarea OnKeyPress="submit();" ...
This would cause the textarea to be submitted every time the user hits
a key. Unfortuantely this won't be useable, because a new page is then
loaded into the browser and the current cursor position, the selection
in the text-box, etc. are lost. It could be possible to write some more
JavaScript code to handle this (and to use frames to submit only a
parts of the page), but I don't suggest to do so as this won't work on
different browsers and is probably too slow anyway.
In general, I suggest not to use JavaScript anywhere as it harms much
more than it helps ... but this is just my personal opinion.
I can only give the following solutions:
* Add a preview-button to your text-area to allow the user to see the
actual output from time-to-time.
* Have a look at XUL project (part of Mozilla) that provides some
extensions to the HTTP protocol to allow creating better UIs, in fact
the whole Mozilla GUI is built using this framework. As a drawback this
invlolves some client-side XML and JavaScript programming and will only
run on the Mozilla browser; but at least the possiblities look
promising.
Cheers,
Lukas
--
Lukas Renggli
http://renggli.freezope.org