• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ post_menu函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中post_menu函数的典型用法代码示例。如果您正苦于以下问题:C++ post_menu函数的具体用法?C++ post_menu怎么用?C++ post_menu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了post_menu函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: menuvisual_create

MENUPAN*
menuvisual_create(void)
{
    MENU *menu;
    MENUPAN *menupan;


    const char *choices[] = {
        "Visualizza tabella",
        NULL,
        NULL,

    };
    const char *desc[] = {
        "M-t",
        NULL,
        NULL,

    };


    menu=menu_create(choices, desc, 0);
    menupan=menu_pan_create(menu, 1, 2*ISIZE+1, 2);
    post_menu(menu);


    return menupan;
}
开发者ID:BackupTheBerlios,项目名称:geekbase,代码行数:28,代码来源:workspace.c


示例2: menulpr_create

MENUPAN*
menulpr_create(void)
{
    MENU *menu;
    MENUPAN *menupan;


    const char *choices[] = {
        "Cambia path db",
        SEP,
        "Esci",
    };
    const char *desc[] = {
        "M-p",
        DSEP,
        "M-x",
    };


    menu=menu_create(choices, desc, A_SIZE(choices));
    menupan=menu_pan_create(menu, 1, 1, 0);
    post_menu(menu);


    return menupan;
}
开发者ID:BackupTheBerlios,项目名称:geekbase,代码行数:26,代码来源:workspace.c


示例3: display_menu

/* display current menu */
void display_menu() {
  
  int rows, cols, begin_y, begin_x;

  /* setup menu options */
  menu_opts_off(menu_ptr, O_ROWMAJOR);
  set_menu_fore(menu_ptr, COLOR_PAIR(MENU_PAIR) | A_STANDOUT);
  set_menu_back(menu_ptr, COLOR_PAIR(MENU_PAIR) | A_DIM | A_NORMAL);

  /* setup appropriate windows */
  set_menu_win(menu_ptr, stdscr);
  scale_menu(menu_ptr, &rows, &cols);

  /* locate menu in the center */
  getmaxyx(stdscr,LINES,COLS);
  begin_y = (LINES-rows) / 2;
  begin_x = (COLS-cols) / 2;

  /* create main menu window */
  sub_window = subwin(stdscr, rows, cols, begin_y, begin_x);
  set_menu_sub(menu_ptr, sub_window);

  /* display the menu */
  post_menu(menu_ptr);
  refresh();
  
}
开发者ID:topgenorth,项目名称:saballistics,代码行数:28,代码来源:menu_handlers.c


示例4: menucerca_create

MENUPAN*
menucerca_create(void)
{
    MENU *menu;
    MENUPAN *menupan;


    const char *choices[] = {
        "Cerca per Orario",
        "Cerca per Docente",
        "Cerca per Aula",
        "Cerca per Materia"
    };
    const char *desc[] = {
        "M-o ",
        "M-d ",
        "M-a ",
        NULL
    };


    menu=menu_create(choices, desc, A_SIZE(choices));
    menupan=menu_pan_create(menu, 1, 3*ISIZE+1, 3);
    post_menu(menu);


    return menupan;
}
开发者ID:BackupTheBerlios,项目名称:geekbase,代码行数:28,代码来源:workspace.c


示例5: main

int main()
{	
	initscr();
	start_color();
	ITEM *menuitems[6];
	MENU *menubar;
	WINDOW *win,*sub_win;
	int i,rows,cols;
	//initcolor();
	menuitems[0]=new_item("File","");
	menuitems[1]=new_item("Edit","");
	menuitems[2]=new_item("Options","");
	menuitems[3]=new_item("Window","");
	menuitems[4]=new_item("Help","");
	menuitems[5]=NULL;
	//menu_opts_off(menubar,O_ROWMAJOR);
	menubar=new_menu(menuitems);
	scale_menu(menubar,&rows,&cols);
	win=newwin(rows+2,cols+2,2,5);
	box(win,179,196);
	sub_win=derwin(win,rows,cols,1,1);
	set_menu_win(menubar,win);
	set_menu_sub(menubar,sub_win);
	post_menu(menubar);
	wrefresh(win);

	wgetch(sub_win);
	unpost_menu(menubar);
	free_menu(menubar);
	for(i=0;i<6;i++)
		free_item(menuitems[i]);
	endwin();
}
开发者ID:smsajid,项目名称:scdk,代码行数:33,代码来源:menu.cpp


示例6: menuhelp_create

MENUPAN*
menuhelp_create(void)
{
    MENU *menu;
    MENUPAN *menupan;


    const char *choices[] = {
        "Help",
        SEP,
        "About",
        NULL,
    };
    const char *desc[] = {
        "M-h",
        DSEP,
        NULL,
    };


    menu=menu_create(choices, desc, A_SIZE(choices));
    menupan=menu_pan_create(menu, 1, 4*ISIZE+1, 4);
    post_menu(menu);


    return menupan;
}
开发者ID:BackupTheBerlios,项目名称:geekbase,代码行数:27,代码来源:workspace.c


示例7: workspace_create

MENU*
workspace_create(void)
{
    MENU *menu;


    const char *choices[] = {
        "Lpr ",
        "Edita ",
        "Visualizza ",
        "Cerca ",
        "Help " ,
    };
    const char *desc[] = {
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
    };


    menu=menu_create(choices, desc, A_SIZE(choices));
    set_menu_format(menu, 1, A_SIZE(choices));
    set_menu_fore(menu, COLOR_PAIR(1) | A_REVERSE);
    set_menu_back(menu, COLOR_PAIR(1));

    post_menu(menu);

    return menu;

}
开发者ID:BackupTheBerlios,项目名称:geekbase,代码行数:32,代码来源:workspace.c


示例8: menuedita_create

MENUPAN*
menuedita_create(void)
{
    MENU *menu;
    MENUPAN *menupan;


    const char *choices[] = {
        "Inserisci Record",
        "Edita Record",
        "Elimina Record",
    };
    const char *desc[] = {
        "M-i",
        "M-e",
        "M-c  ",
    };


    menu=menu_create(choices, desc, A_SIZE(choices));
    menupan=menu_pan_create(menu, 1, ISIZE+1, 1);
    post_menu(menu);


    return menupan;
}
开发者ID:BackupTheBerlios,项目名称:geekbase,代码行数:26,代码来源:workspace.c


示例9: printMenus

void printMenus() {
    int i;
    MENU *fileMenu, *dirMenu;

    // Create items
    fileItems = malloc(numFiles * sizeof(ITEM *));
    for (i = 0; i < numFiles; i++) {
        fileItems[i] = new_item(fileEntries[i]->d_name, NULL);
        if (fileItems[i] == NULL)
            break;
    }
    fileItems[numFiles] = NULL;

    dirItems = malloc(numDirs * sizeof(ITEM *));
    for (i = 0; i < numDirs; i++) {
        dirItems[i] = new_item(dirEntries[i]->d_name, NULL);
        if (dirItems[i] == NULL)
            break;
    }
    dirItems[numDirs] = NULL;


    // Create menus
    fileMenu = new_menu(fileItems);
    dirMenu = new_menu(dirItems);
    menus = malloc(2 * sizeof(MENU *));
    menus[0] = fileMenu;
    menus[1] = dirMenu;

    if (fileMenu == NULL || dirMenu == NULL) {
        fprintf(stderr, "Error creating menus\n");
    }

    // Associate windows and menus
    set_menu_win(fileMenu, cursesWins[0]);
    set_menu_sub(fileMenu, derwin(cursesWins[0], LINES / 2, (COLS / 2) - 6, 3, 1));
    set_menu_format(fileMenu, (LINES / 2), 1);

    set_menu_win(dirMenu, cursesWins[1]);
    set_menu_sub(dirMenu, derwin(cursesWins[1], LINES / 2, (COLS / 2) - 6, 3, 1));
    set_menu_format(dirMenu, (LINES / 2), 1);

    post_menu(fileMenu);
    wrefresh(cursesWins[0]);
    post_menu(dirMenu);
    wrefresh(cursesWins[1]);
}
开发者ID:rghamilton3,项目名称:ts,代码行数:47,代码来源:main.c


示例10: show_chooser_win

void
show_chooser_win(MENU *dirmenu, size_t items, char *buf)
{
	int	 c = 0;
	size_t	 buflen, offset = 0;
	char	*tmp;

	buflen = strlen(buf) - 1;

	set_menu_fore(dirmenu, A_REVERSE);
	returnval = set_menu_format(dirmenu, LINES, 1);
	post_menu(dirmenu);
	refresh();

	while ((c = getch()) != 'q') {
		switch(c) {
		case 'j':
		case KEY_DOWN:
			menu_driver(dirmenu, REQ_DOWN_ITEM);
			break;
		case 'k':
		case KEY_UP:
			menu_driver(dirmenu, REQ_UP_ITEM);
			break;
		case KEY_NPAGE:
			menu_driver(dirmenu, REQ_SCR_DPAGE);
			break;
		case KEY_PPAGE:
			menu_driver(dirmenu, REQ_SCR_UPAGE);
			break;
		case KEY_END:
			menu_driver(dirmenu, REQ_LAST_ITEM);
			break;
		case KEY_HOME:
			menu_driver(dirmenu, REQ_FIRST_ITEM);
			break;
		case 10: /* Enter */
			move(20, 0);
			clrtoeol();

			tmp = (char *)item_name(current_item(dirmenu));
			offset = strlcpy(buf, tmp, MAX_CHOICESIZE);
			if (offset >= MAX_CHOICESIZE)
				goto toolong;
			if (strlcpy(buf + offset,
				    item_description(current_item(dirmenu)),
				    MAX_CHOICESIZE - offset))
				goto toolong;

			pos_menu_cursor(dirmenu);
			break;
		}
	}
toolong:
	unpost_menu(dirmenu);
	fprintf(stdout, "shit happens\n");

	fprintf(stdout, "VALUE WAS: %d\n", returnval);
}
开发者ID:weezel,项目名称:fcd,代码行数:59,代码来源:choosewin.c


示例11: mainmenu

int mainmenu(int height, int width) {
    int ret;
    ITEM **menu_items;
    MENU *main_menu;
    int n_choices, i;

    clean_main_menu();
    build_main_menu(instance_path);

    n_choices = menu_size;
    menu_items = (ITEM **) calloc(n_choices + 1, sizeof (ITEM *));
    for (i = 0; i < n_choices; ++i) {
        menu_items[i] = new_item(menu_values[i], menu_values[i]);
        set_item_userptr(menu_items[i], (void *) menu_selected);
    }
    menu_items[n_choices] = (ITEM *) NULL;
    main_menu = new_menu((ITEM **) menu_items);
    menu_opts_off(main_menu, O_SHOWDESC);

    set_menu_sub(main_menu, derwin(stdscr, 10, 50, 6, 10));

    post_menu(main_menu);
    attron(A_BOLD);
    mvprintw(0, 0, name);
    mvprintw(0, width - strlen(vers), vers);
    attroff(A_BOLD);
    refresh();
    pos_menu_cursor(main_menu);
    while ((i = getch()) != KEY_F(4)) {
        switch (i) {
            case KEY_DOWN:
                menu_driver(main_menu, REQ_DOWN_ITEM);
                break;
            case KEY_UP:
                menu_driver(main_menu, REQ_UP_ITEM);
                break;
            case 10:
            {
                ITEM *cur;
                int (*p)(char *);
                cur = current_item(main_menu);
                p = (int (*)(char *))item_userptr(cur);
                ret = p((char *) item_name(cur));
                pos_menu_cursor(main_menu);
                goto menu_sel;
            }
        }
    }
    if (i == KEY_F(4)) {
        ret = menu_size - 1;
    }

menu_sel:
    unpost_menu(main_menu);
    free_menu(main_menu);
    for (i = 0; i < n_choices; ++i)
        free_item(menu_items[i]);
    return ret;
}
开发者ID:JonathanFu,项目名称:OpenAM-1,代码行数:59,代码来源:main.c


示例12: main

int main(int argc, char const *argv[]) {
    ITEM **my_items;
    int c;
    MENU *my_menu;
    WINDOW *my_menu_win;
    int n_choices, i;

    initscr();
    start_color();
    cbreak();
    noecho();
    keypad(stdscr, TRUE);
    init_pair(1, COLOR_RED, COLOR_BLACK);

    n_choices = ARRAY_SIZE(choices);
    my_items = (ITEM **) calloc(n_choices, sizeof(ITEM *));
    for (i = 0; i < n_choices; ++i)
        my_items[i] = new_item(choices[i], choices[i]);

    my_menu = new_menu((ITEM **) my_items);
    my_menu_win = newwin(10, 40, 4, 4);
    keypad(my_menu_win, TRUE);

    set_menu_win(my_menu, my_menu_win);
    set_menu_sub(my_menu, derwin(my_menu_win, 6, 38, 3, 1));

    set_menu_mark(my_menu, " * ");

    box(my_menu_win, 0, 0);
    print_in_middle(my_menu_win, 1, 0, 40, "My Menu", COLOR_PAIR(1));
    mvwaddch(my_menu_win, 2, 0, ACS_LTEE);
    mvwhline(my_menu_win, 2, 1, ACS_HLINE, 38);
    mvwaddch(my_menu_win, 2, 39, ACS_RTEE);
    mvprintw(LINES - 2, 0, "F1 to exit");
    refresh();

    post_menu(my_menu);
    wrefresh(my_menu_win);

    while ((c = wgetch(my_menu_win)) != KEY_F(1)) {
        switch (c) {
        case KEY_DOWN:
            menu_driver(my_menu, REQ_DOWN_ITEM);
            break;
        case KEY_UP:
            menu_driver(my_menu, REQ_UP_ITEM);
            break;
        }
        wrefresh(my_menu_win);
    }

    unpost_menu(my_menu);
    free_menu(my_menu);
    for (i = 0; i < n_choices; ++i)
        free_item(my_items[i]);

    endwin();
    return 0;
}
开发者ID:bachue,项目名称:libncurses-test,代码行数:59,代码来源:19_window_usage.c


示例13: derwin

int generic_menu::get_choice()
{
    if (choices.size() == return_values.size())
    {
        //create the menu and the item pointer vector
        MENU* my_menu;
        std::vector<ITEM*> my_items;
        WINDOW* menu_win = derwin(screen, choices.size(), 30, ypos, xpos);
        ITEM* cur = NULL;
        for (int x = 0; x < choices.size(); x++)
        {
            //populate the items vector with the string data in choices
            //c_str because ncurses is very old
            my_items.push_back(new_item(choices.at(x).c_str(), NULL));
        }
        //pushback a null item for safety
        my_items.push_back((ITEM*)NULL);
        //create the menu and attach the items
        my_menu = new_menu((ITEM**)my_items.data());
        //print the desc and post the menu
        mvwprintw(screen, LINES - 3, 0, "%s\n", desc.c_str());
        //set_current_item(my_menu, lastItem);
        set_menu_win(my_menu, menu_win);
        keypad(menu_win, TRUE);
        post_menu(my_menu);
        touchwin(screen);
        wrefresh(menu_win);
        std::vector<int>::iterator return_iter = return_values.begin();
        int c = 0;
        while((c = wgetch(menu_win)) != '\n')
        {   
            touchwin(screen);
            wrefresh(menu_win);
            switch(c)
            {	case KEY_DOWN:
                    menu_driver(my_menu, REQ_DOWN_ITEM);
                    if (return_iter != return_values.end())
                    {
                        return_iter++;
                    }
                    break;
                case KEY_UP:
                    menu_driver(my_menu, REQ_UP_ITEM);
                    if (return_iter != return_values.begin())
                    {
                        return_iter--;
                    }
                    break;
            }
        }
        unpost_menu(my_menu);
        for (int x = 0; x < my_items.size(); x++)
        {
            free_item(my_items[x]);
        }
        free_menu(my_menu);
        return *return_iter;
    }
}
开发者ID:destrovel,项目名称:sim_curses,代码行数:59,代码来源:generic_menu.cpp


示例14: displayMenu

void displayMenu(int y, int x, char title[],int numOfOpt, char *options[], void (*p[])(void)){
	int i,c;
	WINDOW *menuWindow;
	MENU *myMenu;
	ITEM **myOptions;
	ITEM *currentOption;
	initscr();
	noecho();
	cbreak();
	keypad(stdscr,TRUE);
	init_pair(1,COLOR_CYAN,COLOR_BLACK);
	myOptions=(ITEM **)calloc(numOfOpt+1,sizeof(ITEM *));
	for(i=0;i<numOfOpt;i++){
		myOptions[i]=new_item(options[i]," ");
		set_item_userptr(myOptions[i],p[i]);	
	}
	myOptions[numOfOpt]=(ITEM *)NULL;
	myMenu=new_menu(myOptions);
	menuWindow = newwin(8,20,(LINES-y)/2,(COLS-x)/2);
	keypad(menuWindow,TRUE);
	set_menu_win(myMenu,menuWindow);
	set_menu_sub(myMenu, derwin(menuWindow,y-4,x-2,3,1));
	set_menu_format(myMenu,numOfOpt,1);
	menu_opts_off(myMenu, O_SHOWDESC);
	set_menu_mark(myMenu," * ");
	post_menu(myMenu);
	wrefresh(menuWindow);
	while((c=wgetch(menuWindow))!=KEY_F(2)){
		switch(c){
			case KEY_UP:
				menu_driver(myMenu,REQ_UP_ITEM);
				break;
			case KEY_DOWN:
				menu_driver(myMenu,REQ_DOWN_ITEM);
				break;
			case 10:{
				ITEM *temp;
				temp=current_item(myMenu);
				void(*pointer)(void);
				pointer=item_userptr(temp);
				pointer();
				pos_menu_cursor(myMenu);
				menu_driver(myMenu,REQ_DOWN_ITEM);
				break;
				}
			wrefresh(menuWindow);
		}
	}
	/*unpost_menu(myMenu);*/
	/*for(i=0;i<numOfOpt;++i){*/
		/*free_item(myOptions[i]);*/
	/*}*/
	/*free_menu(myMenu);*/
	/*free(optionsNumbers);*/
}
开发者ID:nijen1312,项目名称:uczelnia,代码行数:55,代码来源:menufunctons.c


示例15: main

int main()
{	ITEM **my_items;
	int c;				
	MENU *my_menu;
        int n_choices, i;
	ITEM *cur_item;
	
	
	initscr();
        cbreak();
        noecho();
	keypad(stdscr, TRUE);
	
        n_choices = ARRAY_SIZE(choices);
        my_items = (ITEM **)calloc(n_choices + 1, sizeof(ITEM *));

        for(i = 0; i < n_choices; ++i)
                my_items[i] = new_item(choices[i], choices[i]);
	my_items[n_choices] = (ITEM *)NULL;

	my_menu = new_menu((ITEM **)my_items);
	post_menu(my_menu);
	refresh();

	while((c = getch()) != KEY_F(1))
	{       switch(c)
	        {	case KEY_DOWN:
				menu_driver(my_menu, REQ_DOWN_ITEM);
				break;
			case KEY_UP:
				menu_driver(my_menu, REQ_UP_ITEM);
				break;
			case 10:	/* Enter */
				cur_item = current_item(my_menu);
				move(LINES - 2, 0);
				clrtoeol();
				mvprintw(LINES - 2, 0, "You have chosen %d item with name %s and description %s", 
				item_index(cur_item) + 1,  item_name(cur_item), 
				item_description(cur_item));
				
				refresh();
				pos_menu_cursor(my_menu);
				break;
		}
	}	

	free_item(my_items[0]);
        free_item(my_items[1]);
	free_menu(my_menu);
	endwin();
}
开发者ID:AmitKrJoshi,项目名称:LDP,代码行数:51,代码来源:menu_item_data.c


示例16: updateBuddyList

/* 
void updateBuddyList(){
    int i;
    for(i = 1; i <= buddy_count; i++){
        char *s = (char *)malloc(100*sizeof(char));
        memset(s, '\0', 100);
        s = strncpy(s, buddies[i].nick, strlen(buddies[i].nick));
        strcat(s, "@");
        strcat(s, buddies[i].ip);

        items[i] = new_item(s, "");
    }
    unpost_menu(buddy_menu);
    post_menu(buddy_menu);
        //s = strdup(buddies[i].nick);
    //set_menu_items(buddy_menu, items);
    wrefresh(buddy_win);
  char c;
    while((c = wgetch(buddy_win)) != KEY_F(1))
    {       switch(c)
        {   case KEY_DOWN:
            menu_driver(buddy_menu, REQ_DOWN_ITEM);
            break;
            case KEY_UP:
            menu_driver(buddy_menu, REQ_UP_ITEM);
            break;
        }
    }
}
*/
void initBuddyList(){
    //build list displayName
    int i;
    items = (ITEM **)calloc(252, sizeof(ITEM *));
    items[0] = new_item("Group","");
    for(i = 1; i <= buddy_count; i++){
        char *s = (char *)malloc(100*sizeof(char));
        memset(s, '\0', 100);
        s = strncpy(s, buddies[i].nick, strlen(buddies[i].nick));
        strcat(s, "@");
        strcat(s, buddies[i].ip);

        //s = strdup(buddies[i].nick);
        items[i] = new_item(s, "");
    }
    for(i = 0; i < buddy_count; i++){
        //printf(displayNames[i]);
        //        items[i] = new_item(displayNames[i], displayNames[i]);
//        char *name = (char *)malloc(strlen(displayNames[i]) + 1);
//        name = strncpy(name, displayNames[i], strlen(displayNames[i]));
//        char *xxx = "Bonsoir";
//        name[strlen(displayNames[i])] = '\0';
        //name = strncpy(name, displayNames[i], strlen(displayNames[i]));
//        char *yyy = (char *)malloc(strlen(xxx) + 1);
//        yyy = strdup(xxx);
     //   items[i] = new_item(yyy, "");

    }

//    keypad(buddy_win, TRUE);
    buddy_menu = new_menu((ITEM **)items);
    set_menu_win(buddy_menu, buddy_win);
    set_menu_sub(buddy_menu, derwin(buddy_win, 0, 0, 0, 0));
    //set_menu_sub(buddy_menu, buddy_win);
    post_menu(buddy_menu);
    wrefresh(buddy_win);
    refresh();
    /*  char c;
    while((c = wgetch(buddy_win)) != KEY_F(1))
    {       switch(c)
        {   case KEY_DOWN:
            menu_driver(buddy_menu, REQ_DOWN_ITEM);
            break;
            case KEY_UP:
            menu_driver(buddy_menu, REQ_UP_ITEM);
            break;
        }
        wrefresh(buddy_win);
    }*/   
}
开发者ID:vanthonguyen,项目名称:chat-curses,代码行数:80,代码来源:buddy.c


示例17: wbkgd

void NCRowMenu::setup()
{
	wbkgd(getWindow(),COLOR_PAIR(2));

	ITEM **my_items;
	MENU *my_menu;
    WINDOW *my_menu_win;
	int i;

	my_items = (ITEM **) calloc(choices.size()+2, sizeof(ITEM *));
    for(i = 0; i < choices.size(); ++i)
    	my_items[i] = new_item(choices[i].c_str(), "NULL");
	
	my_menu = new_menu((ITEM **) my_items);

	set_menu_grey(my_menu, COLOR_PAIR(2));
	set_menu_fore(my_menu, COLOR_PAIR(2));
	set_menu_back(my_menu, COLOR_PAIR(2));

	menu_opts_off(my_menu, O_SHOWDESC);

    my_menu_win = getWindow();
    keypad(my_menu_win, FALSE);

	/* Set main window and sub window */
    set_menu_win(my_menu, my_menu_win);
    //set_menu_sub(my_menu, derwin(my_menu_win, 10, 150, 3, 1));
	set_menu_format(my_menu, 1, 10);
	set_menu_mark(my_menu, " ");

    //box(my_menu_win, 0, 0);

	//wbkgdset(getWindow(), COLOR_PAIR(2));
	//wrefresh(getWindow());
	wrefresh(stdscr);
	
	refresh();

	/* Post the menu */
	post_menu(my_menu);
	wrefresh(my_menu_win);

	//setBorder(0, 0);
}
开发者ID:lukasic,项目名称:ncfm,代码行数:44,代码来源:NCRowMenu.cpp


示例18: column_select_update_menu

void
column_select_update_menu(ui_t *ui)
{
    // Get panel information
    column_select_info_t *info = column_select_info(ui);
    ITEM *current = current_item(info->menu);
    int top_idx = top_row(info->menu);

    // Remove the menu from the subwindow
    unpost_menu(info->menu);
    // Set menu items
    set_menu_items(info->menu, info->items);
    // Put the menu agin into its subwindow
    post_menu(info->menu);

    // Move until the current position is set
    set_top_row(info->menu, top_idx);
    set_current_item(info->menu, current);
}
开发者ID:cruzccl,项目名称:sngrep,代码行数:19,代码来源:ui_column_select.c


示例19: main

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

	initscr();
	atexit(quit);
	clear();
	noecho();
	curs_set(0);
	nl();
	keypad(stdscr, TRUE);

	it = (ITEM **)calloc(5, sizeof(ITEM *));
	it[0] = new_item("M1", "");
	it[1] = new_item("M2", "");
	it[2] = new_item("M3", "");
	it[3] = new_item("Ende", "");
	it[4] = 0;

	me = new_menu(it);
	post_menu(me);

	mvaddstr(7, 3, "Programm mittels Menü oder F2-Funktionstaste beenden");
	refresh();

	while ((ch = getch()) != KEY_F(2)) {
		switch (ch) {
			case KEY_DOWN:
				menu_driver(me, REQ_DOWN_ITEM);
				break;
			case KEY_UP:
				menu_driver(me, REQ_UP_ITEM);
				break;
			case 0xA:
				if (item_index(current_item(me)) == 3) {
					exit(0);
				}
				break;
		}
	}

	return 0;
}
开发者ID:pwarnimo,项目名称:misc_projects,代码行数:42,代码来源:m1.c


示例20: display_menu

/* glue items to menu and post menu */
static void display_menu(smsgloader *_this)
{
    int rows,cols;
    VERBOSE_DEBUGPR("displaying scom menu requested\n");
    if(_this->loadmenu)
    {
        DEBUGPR("Error!!!!! loadmenu already dsiplayed??\n");
        return;
    }
    _this->loadmenu=new_menu(_this->loaditems);
    scale_menu(_this->loadmenu,&rows,&cols);
    wresize(_this->msgloaderwin,rows+5,cols+5);
    box(_this->msgloaderwin,0,0);
    wprintw(_this->msgloaderwin,"(%s)",SCOMMENU_TOGGLE_STR);
    set_menu_win(_this->loadmenu,_this->msgloaderwin);
    _this->derwin=derwin(_this->msgloaderwin,rows,cols,2,2);
    set_menu_sub(_this->loadmenu,_this->derwin);
    set_menu_mark(_this->loadmenu," * ");
    post_menu(_this->loadmenu);
}
开发者ID:M-a-z,项目名称:nibbles,代码行数:21,代码来源:msgloadermenu.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ post_run函数代码示例发布时间:2022-05-30
下一篇:
C++ post_event函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap