File: labels.c

package info (click to toggle)
iptraf 2.7.0-7
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,484 kB
  • ctags: 1,211
  • sloc: ansic: 12,154; makefile: 144; sh: 126; awk: 1
file content (37 lines) | stat: -rw-r--r-- 1,036 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * labels.c - some common keyhelp printing routines for the iptraf
 * user interface library
 *
 * Written by Gerard Paul Java
 * Copyright (c) Gerard Paul Java 2001
 */
 
#include <curses.h>
#include <panel.h>
#include "winops.h"

void tx_printkeyhelp(char *keytext, char *desc, WINDOW * win,
                  int highattr, int textattr)
{
    wattrset(win, highattr);
    wprintw(win, "%s", keytext);
    wattrset(win, textattr);
    wprintw(win, "%s", desc);
}

void tx_menukeyhelp(int textattr, int highattr)
{
    move(LINES - 1, 1);
    tx_printkeyhelp("Up/Down", "-Move selector  ", stdscr, highattr, textattr);
    tx_printkeyhelp("Enter", "-execute", stdscr, highattr, textattr);
    tx_coloreol();
}

void tx_listkeyhelp(int textattr, int highattr)
{
    move(LINES - 1, 1);
    tx_printkeyhelp("Up/Down", "-move pointer  ", stdscr, highattr, textattr);
    tx_printkeyhelp("Enter", "-select  ", stdscr, highattr, textattr);
    tx_printkeyhelp("X/Ctrl+X", "-close list", stdscr, highattr, textattr);
    tx_coloreol();
}