listbox.h

来自「一个网络流量分析的完整的程序」· C头文件 代码 · 共 47 行

H
47
字号
#include <curses.h>#define MAX_TEXT_LENGTH 240struct textlisttype {    char text[MAX_TEXT_LENGTH];    int cellwidth[10];          /* up to 10 cells per line */    char *nodeptr;		/* generic pointer, cast to appropriate type */    struct textlisttype *next_entry;    struct textlisttype *prev_entry;};struct scroll_list {    char *mainlist;             /* generic pointer, cast to appropriate type */    char *mlistptr;		/* generic pointer, cast to appropriate type */    struct textlisttype *textlist;         /* list of raw text entries */    struct textlisttype *texttail;    struct textlisttype *textptr;    int height;    int width;    int mainattr;    int selectattr;    int keyattr;    char *exitkeys;            WINDOW *win;    PANEL *panel;    WINDOW *borderwin;    PANEL *borderpanel;    };void tx_init_listbox(struct scroll_list *list, int width, int height,                      int startx, int starty,                      int mainattr, int borderattr, int selectattr,                      int keyattr);void tx_set_listbox_title(struct scroll_list *list, char *text, int x);void tx_add_list_entry(struct scroll_list *list, char *node, char *text);void tx_show_listbox(struct scroll_list *list);void tx_operate_listbox(struct scroll_list *list,                        int *keystroke,                        int *aborted);void tx_hide_listbox(struct scroll_list *list);void tx_unhide_listbox(struct scroll_list *list);void tx_close_listbox(struct scroll_list *list);void tx_destroy_list(struct scroll_list *list);#define tx_destroy_listbox tx_destroy_list

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?