From ca4cd5bec239b88b72fccb2f4849e634a504b260 Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Tue, 23 Aug 2016 00:06:01 +0300 Subject: flowtop: Render table row via raw ncurses buffer Render each column to the ncurses raw buffer first, this buffer contains ncurses {char:attr} elements which will be printed to the screen after ui_table_row_show() will be called (at the end of columns rendering by flowtop). The reason of this change is to have easy way to make horizontal scrolling over this buffer. Approach is used from the 'htop' tool. Signed-off-by: Vadim Kochan Signed-off-by: Tobias Klauser --- flowtop.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'flowtop.c') diff --git a/flowtop.c b/flowtop.c index 405bfd8..d98a7b6 100644 --- a/flowtop.c +++ b/flowtop.c @@ -1017,10 +1017,19 @@ static void draw_flow_entry(const struct flow_entry *n) print_flow_peer_info(n, show_src ? FLOW_DIR_SRC : FLOW_DIR_DST); + ui_table_row_show(&flows_tbl); + if (show_src) { ui_table_row_add(&flows_tbl); + ui_table_row_print(&flows_tbl, TBL_FLOW_PROCESS, ""); + ui_table_row_print(&flows_tbl, TBL_FLOW_PID, ""); + ui_table_row_print(&flows_tbl, TBL_FLOW_PROTO, ""); + ui_table_row_print(&flows_tbl, TBL_FLOW_STATE, ""); + ui_table_row_print(&flows_tbl, TBL_FLOW_TIME, ""); + print_flow_peer_info(n, FLOW_DIR_DST); + ui_table_row_show(&flows_tbl); } } -- cgit v1.2.3-54-g00ecf