Stuck in the top left

hi

i am trying to use the express edition and using code i found from here to try and get it to work


    class blah
    {
        private String fileToLoad;
        private GoView goView1 = new GoView();
        private GoXmlBindingTransformer tr;
        private GoDocument doc;
        private GoXmlReader rdr;

        public blah(GoView view)
        {
            this.goView1 = view;
            doc = goView1.Document;
            fileToLoad = "testing.xml";
        }

        public void GenerateTree()
        {
            goView1.Document.ValidCycle = GoDocumentValidCycle.DestinationTree;
            goView1.NewGoLink.ToArrow = true;
            GoBasicNode n = new GoBasicNode();
            n.Editable = false;
            n.Selectable = true;

            n.LabelSpot = GoObject.Middle;
            n.Text = "";
            n.Shape = new GoRoundedRectangle();

            tr = new GoXmlBindingTransformer("node", n);
            tr.TreeStructured = true;

            tr.TreeLinkPrototype = new GoLink();
            tr.TreeLinksToChildren = true;
            n.Label.Multiline = true;
            tr.AddBinding("label", "Text");
            //Doc = GoView1.Document;
            rdr = new GoXmlReader();
            rdr.AddTransformer(tr);
            rdr.RootObject = goView1.Document;
            using (StreamReader file = new StreamReader(fileToLoad))
            {
                rdr.Consume(file);
            }

            goView1.AllowResize = true;
            Size dispSize = goView1.DisplayRectangle.Size;
        }
    }

the thing is it just dumps all of the nodes in the top left with no spacing - why is this and how can it be fixed? thanks

You’ve specified that the data is tree structured, but haven’t done anything to actually position the nodes.

The easiest thing to do would be to use the full version (i.e. not express) and use GoLayoutTree. But… you will find code samples in Family Tree, TreeApp and WebWalker that all do some minimal tree layout in the Express kit.

so essentially i would need to write my own layout as i cant see anything common in the three examples?

If none of the 3 samples meet your needs, you should download Pro and try the GoLayoutTree component… you can install it on the same system as Express without problems.

Assuming you value your time at all, I think the cheapest solution would be to upgrade your Express to Pro and use GoLayoutTree. It looks like you just purchased, so we’d give you full credit.

No thanks, the express edition is fine. Would have just appreciated a pointer on how to layout nodes in the express edition seeing as it isnt documented in the user guide.

Thanks anyway