当前位置: 首页>>代码示例>>C++>>正文


C++ end_dialog函数代码示例

本文整理汇总了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);
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:29,代码来源:ftree2.c

示例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);
}
开发者ID:freenas,项目名称:ports,代码行数:35,代码来源:pkg_cleanup.c

示例3: _menu1_sh_action

static int 
_menu1_sh_action(dialogMenuItem * self)
{
	dialog_clear();
	end_dialog();
	exit(0);
}
开发者ID:joshuabergeron,项目名称:ClosedBSD,代码行数:7,代码来源:menu.c

示例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;
}
开发者ID:BackupTheBerlios,项目名称:openslx-svn,代码行数:60,代码来源:mconf.c

示例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;
}
开发者ID:Voskrese,项目名称:mipsonqemu,代码行数:59,代码来源:mconf.c

示例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();
}
开发者ID:wang-bin,项目名称:berryboot,代码行数:8,代码来源:mainwindow.cpp

示例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;
}
开发者ID:ChenBoTang,项目名称:ARM,代码行数:46,代码来源:mconf.c

示例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;
}
开发者ID:WTHsieh,项目名称:diag,代码行数:46,代码来源:mconf.c

示例9: _menu1_re_action

static int 
_menu1_re_action(dialogMenuItem * self)
{
	dialog_clear();
	end_dialog();
	endwin();
	system("/sbin/reboot");
	exit(0);
}
开发者ID:joshuabergeron,项目名称:ClosedBSD,代码行数:9,代码来源:menu.c

示例10: main

int main(int argc, char *argv[])
{
	
	init_dialog(); 
	_afm_menu();

	end_dialog();

	return 0;		
}
开发者ID:joshuabergeron,项目名称:ClosedBSD,代码行数:10,代码来源:main.c

示例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);
}
开发者ID:freenas,项目名称:ports,代码行数:10,代码来源:pkg_cleanup.c

示例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);
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:52,代码来源:tree.c

示例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);
}
开发者ID:karlpilkington,项目名称:pcbsd-projects,代码行数:13,代码来源:mainmenu.c

示例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);
}
开发者ID:freenas,项目名称:ports,代码行数:39,代码来源:pkg_cleanup.c

示例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;
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:15,代码来源:text.c


注:本文中的end_dialog函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。