CGrid and system actions

I have succesfully created the dockables layout using CGrid. But there is a problem: the dockables don’t have system actions: minimize/maximize buttons, etc.
If dockables are added via CControl.add(), system actions are added to the dockables.

The code is as follows

WindowProvider wp = new ComponentWindowProvider(this);
this.dockControl = new CControl(wp);
// I don't need in minimize are, so use CGridArea
CGridArea area = this.dockControl.createGridArea("base");
add(area.getComponent());
CGrid g = new CGrid();
g.add(0, 0, 25, 50, createDockable("dockID_1"));
// adding other dockables
area.deploy(g);

It seems that the dockables are required to be registered somehow, but I don’t understand how to do it.

Thank you.

As you said, you have to call CControl.add.

this.dockControl.add( dockable );
g.add( 0, 0, 25, 50, dockable );```

You can also tell the CGrid to call "add" automatically:
```CGrid g = new CGrid( this.dockControl );```

It works, thank you.
I was disorientated by documentation. common.pdf, page 16 says (in a red box) “Make sure not to add a dockable twice to a CControl. If using a CGrid the add method of CControl must not be called.”

It is really misleading in the documentation. I’ll correct that.