Let user dblclick to change text

Hi Walter,
I want to allow user dblclicking to change text of the GoTextNode instead of clicking.

You can inherit from GoText to override the relevant methods:
public override bool OnSingleClick(GoInputEventArgs e, GoView view) { return false; }
public override bool OnDoubleClick(GoInputEventArgs e, GoView view) {
if (!CanEdit()) return false;
if (!view.CanEditObjects()) return false;
if (e.Shift || e.Control) return false;
DoBeginEdit(view);
return true;
}
You may want to customize the circumstances under which a double-click will call DoBeginEdit, but this is the basic idea that is essentially the same as the standard definition for GoText.OnSingleClick.

It’s ok. Thank you so much.

Problem again.

When I’ve created a node (derived from GoTextNode) with its background (derived from GoGroup).

Tell me how to prevent user split the label of the node.
When I’ve moved the label of the node, it was splited seperately from the node

class ScriptObject : GoTextNode
{
public ScriptObject()
{
this.Background = new ScriptBackground()
this.Label = new DblClickEditingText
}
}

class ScriptBackground : GoGroup
{
}

class DblClickEditingText : GoText
{

public override bool OnSingleClick(GoInputEventArgs e, GoView view) { return false; }

public override bool OnDoubleClick(GoInputEventArgs e, GoView view) {

if (!CanEdit()) return false;

if (!view.CanEditObjects()) return false;

if (e.Shift || e.Control) return false;

DoBeginEdit(view);

return true;

}

}

There’s nothing in your ScriptBackground class, nor any child objects in any instance of it. Did you just leave out all that code for this post?
In any case, I don’t understand what problem you are trying to describe.

Oh, Sorry. I don’t want show all code. Because it’s too long.

I want a GoTextNode and its label always couple together.

By default GoTextNode.LayoutChildren will change the Bounds of the GoTextNode.Background object so that it surrounds the GoText Label as the text is changed. (Alternatively, setting GoTextNode.AutoResizes to false will do the opposite–it will make the Label fit inside the Background.)
So I don’t understand your situation.
By the way, if you are going to have a class inheriting from GoTextNode and you want to use different parts than the standard ones, it’s conventional to override the respective Create… methods. That saves from having to create the standard parts and then throwing them away with your replacements.

Thank Walter,
I have resolved.