A graphical list of links

Hello,
I want to give users the possibility to choose their links graphically.
I tried first with 2 nodes and a link in a GoPalette, but the nodes moves themselve in a GoPalette. (I will tryied later with a GoView.)
Now, I try to make a listbox of link style, with the ScrollingMultiTextNode function of the demo1.
if you try this code, you will see that the links aren’t stayed in the lisbox.

Thanks in advance.
[code]// (Only the function MakeScrollingMultiTextNodeItem (String s) is different)
// in addstuff of the demo1 :
ScrollingMultiTextNode smtn = MakeScrollingMultiTextNode();
doc.Add(smtn);
// in their original emplacement :public static GoGroup MakeScrollingMultiTextNodeItem(String s)
{
GoGroup g = new GoGroup();
GoPort no1 = new GoPort();
no1.Location = new PointF(10, 20);
no1.Visible = false;
g.Add(no1);
GoPort no2 = new GoPort();
no2.Location = new PointF(100, 0);
no2.Visible = false;
g.Add(no2); Color col = new Color();
col = Color.FromArgb(255 * myRandom.Next(2), 255 * myRandom.Next(2), 255 * myRandom.Next(2)); GoLink link1 = new GoLink();
link1.ToArrow = true;
link1.ToArrowShaftLength = 5;
link1.FromPort = no1;
link1.ToPort = no2;
link1.Style = GoStrokeStyle.Bezier;
link1.PenColor = col;
link1.PenWidth = 2;
link1.BrushColor = col;
g.Add(link1);
return g;
}
public static ScrollingMultiTextNode MakeScrollingMultiTextNode()
{
ScrollingMultiTextNode mtn = new ScrollingMultiTextNode();
GoListGroup lg = mtn.ListGroup;
lg.LinePenColor = Color.Red;//.Black;
lg.BorderPenColor = Color.Black;
for (int i = 1; i < 50; i++)
{
mtn.AddItem(MakeScrollingMultiTextNodeItem(i.ToString()), mtn.CreatePort(true, i), mtn.CreatePort(false, i));
}
return mtn;
}[/code]

Looking at this… don’t quite understand it yet.

if you do this:
no1.Visible = true;
no1.Style = GoPortStyle.Times; and no1.PenColor = col;
for no1 and no2.... You'll see the ports are "correct" but the link isn't following.
also on color... the random picker is picking white, which doesn't help matters:
if (col.R == 255 && col.G == 255 && col.B == 255) // avoid white
col = Color.ForestGreen;

[code]

public static GoObject MakeScrollingMultiTextNodeItem2(String s) {
Color col = new Color();
col = Color.FromArgb(255 * myRandom.Next(2), 255 * myRandom.Next(2), 255 * myRandom.Next(2));
if (col.R == 255 && col.G == 255 && col.B == 255) // avoid white
col = Color.ForestGreen;
GoStroke r = new GoStroke();
r.Selectable = false;
r.AddPoint(new PointF(10, 20));
r.AddPoint(new PointF(40, 20));
r.AddPoint(new PointF(70, 0));
r.AddPoint(new PointF(100, 0));
r.ToArrow = true;
r.ToArrowShaftLength = 5;
r.Style = GoStrokeStyle.Bezier;
r.PenColor = col;
r.PenWidth = 2;
r.BrushColor = col;
return r;
}
public static ScrollingMultiTextNode MakeScrollingMultiTextNode2() {
ScrollingMultiTextNode mtn = new ScrollingMultiTextNode();
GoListGroup lg = mtn.ListGroup;
lg.LinePenColor = Color.Red;//.Black;
lg.BorderPenColor = Color.Black;
lg.Spacing = 16;
lg.TopLeftMargin = new SizeF(10, 10);
for (int i = 1; i < 50; i++) {
mtn.AddItem(MakeScrollingMultiTextNodeItem2(i.ToString()), mtn.CreatePort(true, i), mtn.CreatePort(false, i));
}
return mtn;
}

[/code]
will give you this:
and it scrolls correctly.

Also note that the MovableLinkApp sample gives you links in a palette.

Thank a lot Jake.