diff options
author | younix <web2p10@wemelug.de> | 2010-07-20 00:23:02 +0200 |
---|---|---|
committer | younix <web2p10@wemelug.de> | 2010-07-20 00:23:02 +0200 |
commit | d5824490d8ea7fb470bcce5fb0b406446ba1d9da (patch) | |
tree | 5d823ee0280ce049dd8b566c58e4f15751046d15 | |
parent | 57540d34dae0c9958068ffc2d2c6960389958aa8 (diff) | |
download | pa-sink-ctl-d5824490d8ea7fb470bcce5fb0b406446ba1d9da.tar.gz pa-sink-ctl-d5824490d8ea7fb470bcce5fb0b406446ba1d9da.tar.bz2 pa-sink-ctl-d5824490d8ea7fb470bcce5fb0b406446ba1d9da.zip |
interface: adding function for window-resize
This function resize the internal ncurses box when the
terminal program was resized.
-rw-r--r-- | src/interface.c | 12 | ||||
-rw-r--r-- | src/interface.h | 1 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/interface.c b/src/interface.c index 589343a..4830bed 100644 --- a/src/interface.c +++ b/src/interface.c @@ -14,13 +14,13 @@ // ncurses WINDOW *menu_win; +int height; +int width; int chooser_sink; int chooser_input; - int selected_index; extern GArray *sink_list; - extern pa_context* context; void interface_init(void) @@ -42,13 +42,19 @@ void interface_init(void) refresh(); } +void interface_resize(void) +{ + getmaxyx(stdscr, height, width); + wresize(menu_win, height, width); +} + void print_sink_list(void) { int i = 0; int x = 2; int y = 2; int offset = 0; - + werase(menu_win); box(menu_win, 0, 0); diff --git a/src/interface.h b/src/interface.h index 0290d1f..20aa559 100644 --- a/src/interface.h +++ b/src/interface.h @@ -12,6 +12,7 @@ void print_input_list(int sink_num); void print_volume(pa_volume_t, int, int); void get_input(void); void interface_init(void); +void interface_resize(void); void interface_clear(void); #endif |