<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.59">
<TITLE>Re: [Seaside] Is there an easy way to decorate Canvas elements toincorporate other toolkits?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>You could try subclassing WARenderCanvas and overriding,<BR>
<BR>
DojoCanvas&gt;&gt;brush: tag<BR>
<BR>
^(super brush: tag)<BR>
&nbsp;&nbsp;&nbsp; dojoType: tag dojoType;<BR>
&nbsp;&nbsp;&nbsp; yourself<BR>
<BR>
Cheers!<BR>
<BR>
-Boris (via BlackBerry)<BR>
<BR>
----- Original Message -----<BR>
From: seaside-bounces@lists.squeakfoundation.org &lt;seaside-bounces@lists.squeakfoundation.org&gt;<BR>
To: seaside@lists.squeakfoundation.org &lt;seaside@lists.squeakfoundation.org&gt;<BR>
Sent: Thu May 15 05:37:57 2008<BR>
Subject: [Seaside] Is there an easy way to decorate Canvas elements toincorporate other toolkits?<BR>
<BR>
I am new to Seaside, and am playing around and kicking the tires.<BR>
<BR>
I wanted to do a demo for some of my colleagues and one of the things we<BR>
played around with a few weeks ago was Dojo (which really impressed quite<BR>
a few people).<BR>
<BR>
I have read posts about how Dojo is not the way to go - however as part of<BR>
my playing around with the technology I wanted to see if I could incoporate<BR>
some Dojo look and feel stuff into my simple Seaside tutorial app.<BR>
<BR>
One thing that struck me, is that my app is happily rendering some forms<BR>
using things like:<BR>
<BR>
&nbsp;&nbsp; html textInput callback: [:value | self user userName: value]; value:<BR>
self user userName]<BR>
<BR>
To get a Dojo look and feel all I need to do is render html that looks a<BR>
bit like the following:<BR>
&nbsp;&nbsp; &lt;input type=&quot;text&quot; length=&quot;20&quot; name=&quot;first&quot;&nbsp; dojoType=&quot;dijit.form.TextBox&quot;&gt;<BR>
<BR>
So it occurs to me that the html canvas that I am passing in to my seaside<BR>
components could be decorated (or have a different rendering strategy) in<BR>
some way so that it outputs things in a different manner.<BR>
<BR>
This sounds like it should be easy - however my first look at the world of<BR>
WARenderCanvas doesn't make it look like rendering is done with a strategy<BR>
pattern in mind?<BR>
<BR>
While I could add extra dojo methods to the canvas - it seems like I should<BR>
be able to plug in a different strategy but code like:<BR>
<BR>
textInput<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^ self brush: WATextInputTag new<BR>
<BR>
Seems like its all hard coded without this in mind.<BR>
<BR>
Is there some easy way to do this another way? I suppose I could wrap the<BR>
Canvas in something else that doesn't forward methods like #textInput and<BR>
does something else - but I'm not sure where I hook in to do that.<BR>
<BR>
Any tips or starting points would be greatly appreciated.<BR>
<BR>
Tim<BR>
<BR>
<BR>
<BR>
_______________________________________________<BR>
seaside mailing list<BR>
seaside@lists.squeakfoundation.org<BR>
<A HREF="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</A><BR>
</FONT>
</P>

</BODY>
</HTML>