capt_get_packet(): check for key press only every 20ms
[iptraf-ng.git] / src / tui / listbox.h
blob510bbf16edc9a3b698d018bb782e7f62f946949b
1 #ifndef IPTRAF_NG_TUI_LISTBOX_H
2 #define IPTRAF_NG_TUI_LISTBOX_H
4 #define MAX_TEXT_LENGTH 240
6 struct textlisttype {
7 char text[MAX_TEXT_LENGTH];
8 char *nodeptr; /* generic pointer, cast to appropriate type */
9 struct textlisttype *next_entry;
10 struct textlisttype *prev_entry;
13 struct scroll_list {
14 struct textlisttype *textlist; /* list of raw text entries */
15 struct textlisttype *texttail;
16 struct textlisttype *textptr;
17 int height;
18 int width;
19 int mainattr;
20 int selectattr;
21 int keyattr;
22 int row;
24 WINDOW *win;
25 PANEL *panel;
26 WINDOW *borderwin;
27 PANEL *borderpanel;
30 void tx_init_listbox(struct scroll_list *list, int width, int height,
31 int startx, int starty, int mainattr, int borderattr,
32 int selectattr, int keyattr);
33 void tx_set_listbox_title(struct scroll_list *list, char *text, int x);
34 void tx_add_list_entry(struct scroll_list *list, char *node, char *text);
35 void tx_show_listbox(struct scroll_list *list);
36 void tx_operate_listbox(struct scroll_list *list, int *aborted);
37 void tx_hide_listbox(struct scroll_list *list);
38 void tx_unhide_listbox(struct scroll_list *list);
39 void tx_close_listbox(struct scroll_list *list);
40 void tx_destroy_list(struct scroll_list *list);
42 #define tx_destroy_listbox tx_destroy_list
44 #endif /* IPTRAF_NG_TUI_LISTBOX_H */