Skip to content
alekseyt edited this page Oct 22, 2017 · 1 revision
if (nk_begin(ctx, "Demo", nk_rect(50, 50, 450, 250),
	NK_WINDOW_BORDER|NK_WINDOW_TITLE|NK_WINDOW_NO_SCROLLBAR)) 
{
	nk_layout_row_dynamic(ctx, 200, 2); // wrapping row

	if (nk_group_begin(ctx, "column1", NK_WINDOW_BORDER)) { // column 1
		nk_layout_row_dynamic(ctx, 30, 1); // nested row
		nk_label(ctx, "column 1.1", NK_TEXT_CENTERED);

		nk_layout_row_dynamic(ctx, 30, 1);
		nk_label(ctx, "column 1.2", NK_TEXT_CENTERED);

		nk_group_end(ctx);
	}

	if (nk_group_begin(ctx, "column2", NK_WINDOW_BORDER)) { // column 2
		nk_layout_row_dynamic(ctx, 30, 1);
		nk_label(ctx, "column 2.1", NK_TEXT_CENTERED);

		nk_layout_row_dynamic(ctx, 30, 1);
		nk_label(ctx, "column 2.2", NK_TEXT_CENTERED);

		nk_group_end(ctx);
	}

	nk_end(ctx);
}

Clone this wiki locally