[EDIT: fixed the inline HTML reference.]
I noticed that all of the examples using gfx, create the drawing surface in the same manner, programatically.
That is, they all have a <div id="gfx_here"></div> in the document body and then call a javascript onLoad which calls dojox.gfx.createSurface(...). Is there any other way to create the drawing surface? Would it be possible to enter the contents of a drawing delaritively (in the html document body)?

At this moment we don't
At this moment we don't support the declarative creation of a surface.
It doesn't matter how the <div> was created, if you want you can create it totally dynamically using document.createElement("div").
Sorry, but I am unable to
Sorry, but I am unable to create a surface dynamically. I tried something like this:
var holder = document.createElement("div");
var container=dojo.byId("gfx_container");
container.addChild(holder);
var surface = dojox.gfx.createSurface(holder, 500, 500);
var dim = { x: 50, y: 50, width: 100, height: 100 };
var rect = surface.createRect(dim);
rect.setStroke({color: "blue", width: 10, join: "round" });
}
dojo.addOnLoad(initGfx);
with
<div id="gfx_container">
</div>
</body>
You didn't mention what
You didn't mention what error you saw, if any, but you probably need "appendChild", not "addChild" for a normal html element, i.e., container.appendChild(holder).
Yes, that fixed it. Thanks.
Yes, that fixed it. Thanks.