GoSimpleNode Autoresize

Question ?

I have the following code :
GoListGroup dataValues = new GoListGroup();
dataValues.Selectable = false;
dataValues.Editable = true;
dataValues.Orientation = Orientation.Horizontal;
dataValues.Alignment = MiddleCenter;
dataValues.Add( [GoText] );
dataValues.Add( [GoImage] );

The GoText has the following description :
GoText gt = new GoText();
gt.Selectable = false;
gt.AutoResizes = true;

And this GoListGroup is in a GoGroup like this :
GoGroup element = new GoGroup();
element.Selectable = false;
element.Editable = true;
element.Add( [dataValues] );

this.Icon = element;
this.Icon.Selectable = false;
this.Editable = true;
this.Resizable = false;
this.Reshapable = false;

(THIS = GoSimpleNode)

I override OnSingleClick of my node to get the selector icon and to show a contextual menu.
Toolstrip clicking modifies the GoText and the GoSimple has th efollowing behaviour :

  1. A text which is 20 caracters long =>the GoSimple resizes itself at the good width
  2. Then, when I choose a text which is 10 caracters long => the GoSimple doesn't resize itself to reduce its width
  • WHY ?

Well, I copied your code bits here, filled in the missing bits. I added a button to add / subtract a character to the button bar.

When I remove a character from the GoText, the node shrinks.
so... I don't know why you're seeing this.

Does all elements have to be resizable ?

No. Are you using GoSimpleNode, or a custom version of it? What methods have you overridden?


Overridden methods :

void LayoutChildren(GoObject childchanged)
GoRoundedRectangle border = getBorder();
if (border != null) border.Size = this.Icon.Size;

bool OnSingleClick => to show a WinForm contextual menu