[Seaside-dev] WABuilder and Render Context

Maximilian Bareis max.bareis at me.com
Mon Aug 25 16:31:58 UTC 2014


Hi Esteban,

the procedure is fine for small chunks that do not need a specific RenderContext.

I am currently developing the tests for SeasideDynamicSVG package. There is everything already developed (own Canvas etc.) but I need to move it to Seaside 3.1. For that I am adding more testcases to ensure the stability.

The decent problem for this case is, that an AnchorBrush is created related to the Context:

anchorBrush := self context disableSVGAnchors
		ifTrue: [SVGDisabledAnchorBrush new]
		ifFalse: [SVGAnchorTag new].
	^self brush: anchorBrush

So without having my own context I am not able to use the WABuilder to create a SVGDisabledAnchorTag.
I could also create a subclass SVGBuilder but I think this feature may be useful also for WABuilder.

Regards

Max

Am 25.08.2014 um 18:23 schrieb Esteban A. Maringolo <emaringolo at gmail.com>:

> I don't know about SVG documents. But what I do to generate small
> chunks of HTML content is:
> 
> WAHtmlCanvas builder render: [ :html | html text: 'Hello world' ]
> 
> So maybe you should have your own WASvgCanvas and maybe a WASvgDocument too.
> 
> Regards!
> 
> 
> Esteban A. Maringolo
> 
> 
> 2014-08-25 13:16 GMT-03:00 Maximilian Bareis <max.bareis at me.com>:
>> 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?
>> 
>> Regards
>> 
>> Max
>> 
>> _______________________________________________
>> seaside-dev mailing list
>> seaside-dev at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
>> 
> _______________________________________________
> seaside-dev mailing list
> seaside-dev at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev

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


More information about the seaside-dev mailing list