This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GSoC 2011 [web repl console]


On 04/07/2011 07:38 PM, Fattom Riddle wrote:
Dear Per:

I think you mean you want the browser show the rich UI result.
So, we have a communication protocol to handle this?

The Kawa expression "Hello" evaluates to a sting, and the result inserted as a text node.

The Kawa expression:
#<b>Some bold text.</b>
evaluates to an Element node.  That would get converted to XML,
and sent to the browser, which inserts it - as a <b> node.

See http://per.bothner.com/blog/2010/XML-literals/ and
http://www.gnu.org/software/kawa/XML-literals.html

But, how does the rich ui result work?
I mean it's easy to show rich ui result, but it's hard to assign an
event on a rich ui result.
For example, how to make a button which can show alert message?

First, read: http://per.bothner.com/blog/2007/ReplPane/ especially the section "Embedding Viewable objects".

What I'm imagining is that "printing"

#<a onclick=(lambda (evt) (doit)) "Click here!"/>

would insert a <a> element, with a (JavaScript) onclick event
handler.  When this event handler is called in the browser, it
sends a message to the server, which applies the lambda expression
(in the server).  No need for special handling of the lambda
expression: It's just an expression which evaluates to a procedure
value.  The REPL needs to manage a mapping between the JavaScript
event handler (in the browser), and the Scheme functions (on the
server).

But this sort of thing is beyond the basic core functionality.
However, it is very interesting, as it points to a general GUI
for Kawa using XHTML.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]