I have a bunch of items I want to display in a grid. I'd like the grid to dynamically resize based on the terminal window size. Basically I'd like it to fit as many columns as possible before adding another row. How should I go about this? Is the CDK matrix the right widget to use for this?
Asked
Active
Viewed 190 times
1 Answers
1
short: no
long: there are several points
- CDK does not do any re-layout when reading
KEY_RESIZE
. - The matrix widget has no methods for adding or removing rows/columns.
- While CDK allows binding of keys to callbacks, that probably does not work for special keys such as
KEY_RESIZE
. - You wouldn't be able to re-create (i.e., "resize") a matrix widget using a callback.
Rather, you might use the CDK widget as a starting point and see how to modify it to address the limitations noted above.

Thomas Dickey
- 51,086
- 7
- 70
- 105
-
Thanks @Thomas Dickey. Would you be willing to put the cdk up on github so I could contribute to it? I'm sure others would as well. From reading questions it sounds like many people tweak or enhance CDK for personal use but those features don't propagate out. It would be great to share it. – jterm Dec 01 '16 at 14:25