// An application with a window, menus, and a dialog. #include #include #include #include #include void onAbout(hWin win) { hDlg dlg = dlg_about(win, APP_NAME); dlg_exec(dlg); wgt_free(&dlg); } int main(int argc, pcstr argv[]) { hApp app = app_make(argc, argv, APP_NAME, 0, ORG_DOMAIN, 0); hActs acts = acts_make(); hWin win = win_acts_make(acts); hMbar mb = win_menuBar(win); hMenu mf = mbar_addMenu(mb, "&File"); hMenu mv = mbar_addMenu(mb, "&View"); hMenu ma = mbar_addMenu(mb, "&About"); menu_addAct(mf, acts_get(acts, act_Quit())); menu_addAct(mv, acts_get(acts, act_MenuBar())); menu_separator(mv); menu_addAct(mv, acts_get(acts, act_FullScreen())); menu_addAct(ma, acts_get(acts, act_About())); x_cbVoid cbAbout = {win, onAbout}; win_onAbout(win, cbAbout); win_show(win, true); app_exec(app); acts_free(&acts); wgt_free(&win); // optionally app_free(&app); // optionally } // eof