A more powerful way to lay out rows is to use the template mechanism available. By calling NkLayoutRowTemplateBegin(), it's possible to set the template for all rows that follow. Column sizing is defined using one of three template functions. Firstly, NkLayoutRowTemplatePushStatic() specifies that widgets in this column should be of a fixed width. NkLayoutRowTemplatePushDynamic(), like the definition of dynamic allocation without templates, will split the row width among dynamic columns (this could be as little as 0 if no space is available). Finally, there's an additional call to the NkLayoutRowTemplatePushVariable()function; this will ensure that widgets get their minimum required space and will take up any extra space ...

Get Hands-On GUI Application Development in Go now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.