[Seaside-dev] WABuilder and Render Context

Maximilian Bareis max.bareis at me.com
Mon Aug 25 21:48:16 UTC 2014


Am 25.08.2014 um 23:09 schrieb Philippe Marschall <philippe.marschall at gmail.com>:

> On Mon, Aug 25, 2014 at 6:16 PM, Maximilian Bareis <max.bareis at me.com> wrote:
>> Hi,
>> 
>> I use WABuilder for creating small chunks of html-Code to test the SVGTags.
>> Unfortunately it is not possible to pass a RenderContext into
>> WABuilder>>render:
>> 
>> WABuilder>>render: anObject
>> ^ String streamContents: [ :stream |
>> | context document renderer |
>> ...
>> context := WARenderContext new.
>> ...
>> renderer := self rendererClass context: context.
>> self openDocument: document context: context.
>> renderer render: anObject; flush.
>> self closeDocument: document ]
>> 
>> so I would like to change the method and split it up in two methods:
>> 
>> WABuilder>>render:
>> 
>> ^ self render: anObject withContext: WARenderContext new.
>> 
>> and WABuilder>>render:withContext:
>> 
>> WABuilder>>render: anObject
>> ^ String streamContents: [ :stream |
>> | context document renderer |
>> ...
>> context := aWARenderContext.
>> ...
>> renderer := self rendererClass context: context.
>> self openDocument: document context: context.
>> renderer render: anObject; flush.
>> self closeDocument: document ]
>> 
>> Is that OK and conforming to your development rules? How do I proceed if it
>> is ok to implement?
> 
> Can you explain a bit why you need a custom WARenderContext?
> 
as I answered to Esteban, the creation of SVGAnchor depends on the state of the context. If the context has the state disableSVGAnchor the disabledAnchor is created otherwise the SVGAnchor is created. Why the disabled state is coupled to the context is beyond my knowledge, this needs to be answered by Johan or the creator of SVGCanvas>>anchor: 
If you think you do not need this feature in WABuilder I will subclass it to SVGBuilder.

Regards

Max


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside-dev/attachments/20140825/b597a4cc/attachment.htm


More information about the seaside-dev mailing list