本文整理汇总了C++中end_dialog函数的典型用法代码示例。如果您正苦于以下问题:C++ end_dialog函数的具体用法?C++ end_dialog怎么用?C++ end_dialog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了end_dialog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int
main(int argc, char **argv)
{
int retval;
unsigned char *tresult;
init_dialog();
use_helpfile("ftree2.test");
use_helpline("Press Arrows, Tab, Enter or F1");
retval = dialog_ftree("ftree2.test", '\t',
"ftree dialog box example",
"xterm widget tree from preprocess editres(1) dump",
-1, -1, 15,
&tresult);
dialog_update();
dialog_clear();
end_dialog();
if (!retval)
{
puts(tresult);
free(tresult);
}
exit(retval);
}
示例2: display_menu
static int
display_menu(void)
{
int ret=0;
int maxx,maxy;
int curr;
do_init_dialog();
getmaxyx(stdscr, maxy, maxx);
dialog_vars.help_button=1;
dialog_vars.item_help=1;
loop:
switch(ret=dlg_checklist("Welcome to pkg_cleanup.", "These are the leaf packages installed on your system\nChose the packages to deinstall. Help will display the package description.", maxy-1, maxx, maxy-9, menulen, menu, " X", FLAG_CHECK, &curr)) {
case DLG_EXIT_HELP: {
char *p = read_desc(menu[curr].ITEM_PROMPT);
if(p) {
dialog_vars.help_button=0;
dialog_msgbox(menu[curr].ITEM_DATA, p, maxy-4, maxx-4, TRUE);
dialog_vars.help_button=1;
free(p);
}
goto loop;
}
case 0:
ret=0;
break;
default:
ret=-1;
break;
}
dialog_vars.help_button=0;
dialog_vars.item_help=0;
end_dialog();
return(ret);
}
示例3: _menu1_sh_action
static int
_menu1_sh_action(dialogMenuItem * self)
{
dialog_clear();
end_dialog();
exit(0);
}
示例4: main
int main(int ac, char **av)
{
char *mode;
int res;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
conf_parse(av[1]);
conf_read(NULL);
mode = getenv("MENUCONFIG_MODE");
if (mode) {
if (!strcasecmp(mode, "single_menu"))
single_menu_mode = 1;
}
tcgetattr(1, &ios_org);
atexit(conf_cleanup);
init_wsize();
reset_dialog();
init_dialog(NULL);
set_config_filename(conf_get_configname());
do {
conf(&rootmenu);
dialog_clear();
if (conf_get_changed())
res = dialog_yesno(NULL,
_("Do you wish to save your "
"new configuration?\n"
"<ESC><ESC> to continue."),
6, 60);
else
res = -1;
} while (res == KEY_ESC);
end_dialog();
switch (res) {
case 0:
if (conf_write(filename)) {
fprintf(stderr, _("\n\n"
"Error during writing of the configuration.\n"
"Your configuration changes were NOT saved."
"\n\n"));
return 1;
}
case -1:
printf(_("\n\n"
"*** End of configuration.\n"
"\n\n"));
break;
default:
fprintf(stderr, _("\n\n"
"Your configuration changes were NOT saved."
"\n\n"));
}
return 0;
}
示例5: main
int main(int ac, char **av)
{
struct symbol *sym;
char *mode;
int res;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
conf_parse(av[1]);
conf_read(NULL);
sym = sym_lookup("KERNELVERSION", 0);
sym_calc_value(sym);
sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"),
sym_get_string_value(sym));
mode = getenv("MENUCONFIG_MODE");
if (mode) {
if (!strcasecmp(mode, "single_menu"))
single_menu_mode = 1;
}
tcgetattr(1, &ios_org);
atexit(conf_cleanup);
init_wsize();
reset_dialog();
init_dialog(menu_backtitle);
do {
conf(&rootmenu);
dialog_clear();
res = dialog_yesno(NULL,
_("Do you wish to save your "
"new kernel configuration?\n"
"<ESC><ESC> to continue."),
6, 60);
} while (res == KEY_ESC);
end_dialog();
if (res == 0) {
if (conf_write(NULL)) {
fprintf(stderr, _("\n\n"
"Error during writing of the kernel configuration.\n"
"Your kernel configuration changes were NOT saved."
"\n\n"));
return 1;
}
printf(_("\n\n"
"*** End of Linux kernel configuration.\n"
"*** Execute 'make' to build the kernel or try 'make help'."
"\n\n"));
} else {
fprintf(stderr, _("\n\n"
"Your kernel configuration changes were NOT saved."
"\n\n"));
}
return 0;
}
示例6: end_dialog
void MainWindow::reinitScreen()
{
/* FIXME: there must be a better way to do this */
end_dialog();
erase();
init_dialog(stdin, stdout);
dlg_put_backtitle();
}
示例7: main
int main(int ac, char **av)
{
int stat;
char *mode;
struct symbol *sym;
conf_parse(av[1]);
conf_read(NULL);
sym = sym_lookup("VERSION", 0);
sym_calc_value(sym);
snprintf(menu_backtitle, 128, "Core v%s Configuration",
sym_get_string_value(sym));
mode = getenv("MENUCONFIG_MODE");
if (mode) {
if (!strcasecmp(mode, "single_menu"))
single_menu_mode = 1;
}
tcgetattr(1, &ios_org);
atexit(conf_cleanup);
init_wsize();
init_dialog();
signal(SIGWINCH, winch_handler);
conf(&rootmenu);
end_dialog();
/* Restart dialog to act more like when lxdialog was still separate */
init_dialog();
do {
stat = dialog_yesno(NULL,
"Do you wish to save your new Core configuration?", 5, 60);
} while (stat < 0);
end_dialog();
if (stat == 0) {
conf_write(NULL);
printf("\n\n"
"*** End of Core configuration.\n"
"*** Check the top-level Makefile for additional configuration options.\n\n");
} else
printf("\n\nYour Core configuration changes were NOT saved.\n\n");
return 0;
}
示例8: main
int main(int ac, char **av)
{
struct symbol *sym;
char *mode;
int stat;
conf_parse(av[1]);
conf_read(NULL);
sym = sym_lookup("VERSION", 0);
sym_calc_value(sym);
snprintf(menu_backtitle, 128, "BusyBox v%s Configuration",
sym_get_string_value(sym));
mode = getenv("MENUCONFIG_MODE");
if (mode) {
if (!strcasecmp(mode, "single_menu"))
single_menu_mode = 1;
}
tcgetattr(1, &ios_org);
atexit(conf_cleanup);
init_wsize();
init_dialog();
signal(SIGWINCH, winch_handler);
conf(&rootmenu);
end_dialog();
/* Restart dialog to act more like when lxdialog was still separate */
init_dialog();
do {
stat = dialog_yesno(NULL,
"Do you wish to save your new diagnostic program configuration?", 6, 60);
} while (stat < 0);
end_dialog();
if (stat == 0) {
conf_write(NULL);
printf("\n\n"
"*** End of SQ diagnostic program configuration.\n");
printf("*** Execute 'make' to build the diagnostic program or try 'make help'.\n\n");
} else
printf("\n\nYour diagnostic program configuration changes were NOT saved.\n\n");
return 0;
}
示例9: _menu1_re_action
static int
_menu1_re_action(dialogMenuItem * self)
{
dialog_clear();
end_dialog();
endwin();
system("/sbin/reboot");
exit(0);
}
示例10: main
int main(int argc, char *argv[])
{
init_dialog();
_afm_menu();
end_dialog();
return 0;
}
示例11: keep_going
static int
keep_going(void)
{
int ret;
do_init_dialog();
ret = !dialog_yesno(NULL,"Do you want to process the new leaves packages?",-1,-1);
end_dialog();
return(ret);
}
示例12: main
int
main(int argc, char **argv)
{
int retval;
unsigned char *tresult;
char comstr[BUFSIZ];
init_dialog();
do {
use_helpline("Press OK for listing directory");
retval = dialog_tree(names,
sizeof(names)/sizeof(unsigned char *) - 1,
'/',
"tree dialog box example",
"Typical find -x / -type d output",
-1, -1, 15,
&tresult);
if (retval)
break;
use_helpline(NULL);
(void)snprintf(comstr, sizeof(comstr),
"ls -CF %s", tresult);
retval = dialog_prgbox(
comstr,
comstr, 20, 60, TRUE, TRUE);
dialog_clear();
retval = dialog_tree(names1,
sizeof(names1)/sizeof(unsigned char *),
':',
"tree dialog box example",
"Other tree",
-1, -1, 5,
&tresult);
if (!retval)
{
dialog_clear();
}
} while (!retval);
dialog_update();
dialog_clear();
end_dialog();
exit(retval);
}
示例13: shell_fire
static int
shell_fire(dialogMenuItem *self)
{
end_dialog();
if (fork() == 0) {
execl("/bin/tcsh", "tcsh", NULL);
_exit(1);
} else {
wait(NULL);
}
return (0);
}
示例14: read_pkglist
/* Goes through the glob contents, looking for zero-length +REQUIRED-BY */
static int
read_pkglist(int loops)
{
FILE *pkg;
char line[1024];
char *p;
do_init_dialog();
dialog_msgbox(NULL, "Searching for leaves", 5, 23, FALSE);
fflush(stdout);
pkg=popen("/usr/sbin/pkg query -e \"%#r=0 && %k=0\" \"%n-%v\\t%c\"", "r");
if(!pkg) {
fputs("Error executing pkg.\n", stderr);
return -1;
}
while(fgets(line, sizeof(line), pkg)!=NULL) {
for(p=strchr(line, 0)-1; p>line && isspace(*p); p--)
*p=0;
p=strtok(line, "\t");
p=strtok(NULL, "\0");
add_item(line, p?p:"");
}
if(WEXITSTATUS(pclose(pkg)) && menulen==0) {
fputs("pkg returned an error.\n", stderr);
return -1;
}
dlg_clear();
if(menulen==0) {
if(loops)
dialog_msgbox(NULL, "No new leaves found", 5, 23, TRUE);
else
dialog_msgbox(NULL, "No leaves found", 5, 19, TRUE);
end_dialog();
return(-1);
}
end_dialog();
return(0);
}
示例15: main
/* Kick it off, James! */
int
main(int argc, unsigned char *argv[])
{
int retval;
init_dialog();
retval = dialog_textbox("This is dialog_textbox() in action with /etc/passwd", "/etc/passwd", 10, 60);
dialog_clear();
fprintf(stderr, "returned value for dialog_textbox was %d\n", retval);
end_dialog();
return 0;
}