eXept Software AG Logo

Smalltalk/X Webserver

Smalltalk Dynamic Web Pages - Source of WebDemoApp1-theSVG1:

Home

Documentation
www.exept.de
Everywhere
for:
theSVG1:aRequest
    "a reply, generating svg which is embedded by test_svg1:"

    |builder|

    "/ suppress decoration
    aRequest response replyPresenter:nil.

    builder := HTML::SVGTreeBuilder new.
    builder
       svg; 
         viewBox:(0@0 corner:270@400);
         width:'100%';
         height:'100%';
         g; id:'mainlayer';
           rect; 
             fill:'red'; stroke:'black'; x:15; y:15; width:100; height:50;
             onClick:'alert(''you clicked on red'');';
           rectEnd;
           rect; 
             fill:'blue'; stroke:'black'; x:150; y:15; width:100; height:50; rx:12; ry:18; 
             onClick:'alert(''you clicked on blue'');';
           rectEnd;
         gEnd;
       svgEnd.

    aRequest response
        nextPutAll:(builder xmlString)

Edit
Index


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Mon, 18 Nov 2019 02:08:34 GMT