// Windows with layouts. #include void w_verBoxl() { hWin win = win_make(); hBoxl vb = win_verBoxl(win); box_add(vb, lbl_make("A")); box_add(vb, lbl_make("B")); box_add(vb, lbl_make("C")); box_addStretch(vb); win_setTitle(win, "Vertical Box"); win_show(win, true); } void w_horBoxl() { hWin win = win_make(); hBoxl hb = win_horBoxl(win); box_add(hb, lbl_make("1")); box_add(hb, lbl_make("2")); box_add(hb, lbl_make("3")); box_add(hb, lbl_make("4")); win_setTitle(win, "Horizontal Box"); win_show(win, true); } void w_ctrGrid() { hWin win = win_make(); hGrid g = win_ctrGrid(win); grid_add(g, lbl_make("A1"), 0, 0); grid_add(g, lbl_make("A2"), 0, 1); grid_add(g, lbl_make("A3"), 0, 2); grid_add(g, lbl_make("A4"), 0, 3); grid_add(g, lbl_make("B1"), 1, 0); grid_add(g, lbl_make("B2"), 1, 1); grid_add(g, lbl_make("B3"), 1, 2); grid_add(g, lbl_make("B4"), 1, 3); grid_add(g, lbl_make("C1"), 2, 0); grid_add(g, lbl_make("C2"), 2, 1); grid_add(g, lbl_make("C3"), 2, 2); grid_add(g, lbl_make("C4"), 2, 3); grid_addColStretch(g); win_setTitle(win, "Grid"); win_show(win, true); } void w_horSplt() { hWin win = win_make(); hSplt sp = win_horSplt(win); splt_add(sp, lbl_make("A")); splt_add(sp, lbl_make("B")); win_setTitle(win, "Horizontal Splitter"); win_show(win, true); } void w_verSplt() { hWin win = win_make(); hSplt sp = win_verSplt(win); splt_add(sp, lbl_make("1")); splt_add(sp, lbl_make("2")); win_setTitle(win, "Vertical Splitter"); win_show(win, true); } void w_mix() { hWin win = win_make(); hBoxl hb = win_horBoxl(win); box_add(hb, lbl_make("A")); hSplt sp = box_verSplt(hb); box_add(hb, lbl_make("B")); splt_add(sp, lbl_make("1")); hGrid gr = panel_ctrGrid(splt_addPanel(sp)); grid_add(gr, lbl_make("A1"), 0, 0); grid_add(gr, lbl_make("B2"), 1, 1); grid_add(gr, lbl_make("C3"), 2, 2); win_setTitle(win, "Mix"); win_show(win, true); } int main(int argc, pcstr argv[]) { hApp app = app_make(argc, argv, APP_NAME, 0, ORG_DOMAIN, 0); w_verBoxl(); w_horBoxl(); w_ctrGrid(); w_horSplt(); w_verSplt(); w_mix(); app_exec(app); app_free(&app); } // eof