Thanks Julian. I think a component will be ok.<br><br>Mariano<br><br><div class="gmail_quote">On Thu, Jun 18, 2009 at 1:22 PM, Julian Fitzell <span dir="ltr">&lt;<a href="mailto:jfitzell@gmail.com">jfitzell@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Hi Mariano,</div><div><br></div>Off the top of my head, if I were implementing a google maps package, I would do it as a component or a painter (see below). Brushes certainly aren&#39;t intended to be kept around so if you have state to persist between requests that&#39;s not the way to go.<br>

<br><div>There are people who like implementing everything as brushes but the main functionality of brushes is that they can be selected in arbitrary orders to nest content within each other, e.g.:</div><div><br></div><div>

html div: [ html span: [ html paragraph: &#39;foo&#39; ] ].</div><div><br></div><div>Unless you plan to do be able to do:</div><div><br></div><div>html div: [ html googleMap: [ html paragraph: &#39;foo&#39; ] ]</div><div>

<br></div><div>(i.e. unless the thing you are creating allows content to be put inside it) I don&#39;t think there&#39;s much advantage in making your own brush. (The other reason to consider using brushes of course is that they have more direct access to the document).</div>

<div><br></div><div>Even if you don&#39;t need the benefits of components (see <a href="http://blog.fitzell.ca/2009/05/when-to-use-seaside-component.html" target="_blank">http://blog.fitzell.ca/2009/05/when-to-use-seaside-component.html</a> ), you can just create a renderable object by implementing #renderOn: and do:</div>

<div><br></div><div>html render: (GoogleMaps new configSomeStuff; yourself)</div><div><br></div><div>This process is made much clearer in 2.9 where you can subclass WAPainter, implement #rendererClass to control what kind of renderer you get passed (you might possibly implement the google maps thing *using* one or more custom brushes and have your own renderer for them), and implement #renderContentOn: as you would for a component.</div>

<div><br></div><div>Hopefully that makes things clearer and not muddier. :)</div><div><br><div>Julian</div><div><br><div class="gmail_quote"><div><div></div><div class="h5">On Thu, Jun 18, 2009 at 5:51 AM, Mariano Montone <span dir="ltr">&lt;<a href="mailto:marianomontone@gmail.com" target="_blank">marianomontone@gmail.com</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">Hello!,<br>           I&#39;m implementing an API for rendering Google Maps. I&#39;ve decided to implement it as a brush. That&#39;s because I&#39;m just generating javascript code. But now I have a problem: when adding support for callbacks, I need to hold some state; for example, the map the callback refers to. But I think brushes are not meant to hold state, that is something left for the components mechanism, isn&#39;t it? So I would like to know what would be the correct way of implementing it in the framework. Should I implement maps as components, or should I add state to my brushes; I may hold a state in the callback block too, but I don&#39;t think that&#39;s good.<br>


<br>Thanks!<br><font color="#888888"><br>Mariano<br><br><br>
</font><br></div></div><div class="im">_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></div></blockquote></div><br></div></div>
<br>_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></blockquote></div><br>