diff options
author | toni <toni@devlap.local> | 2014-12-05 13:03:48 +0100 |
---|---|---|
committer | toni <toni@devlap.local> | 2014-12-05 13:03:48 +0100 |
commit | 2c10cb38e2816c5f367fd891c25f1b18da3ea07f (patch) | |
tree | 0d944f1246e9c2b49a60eb3548ad54a7a110d794 | |
parent | be645deab86daeb0f4c31ab8f1c3c28bb4b1e646 (diff) |
- preparing majore update (ui_input) ..
-rw-r--r-- | ui.c | 5 | ||||
-rw-r--r-- | ui_input.c | 4 | ||||
-rw-r--r-- | ui_input.h | 6 |
3 files changed, 11 insertions, 4 deletions
@@ -9,6 +9,7 @@ #include "ui.h" #include "ui_ani.h" +#include "ui_input.h" static WINDOW *wnd_main; @@ -148,6 +149,7 @@ stop_ui_thrd(void) { int main(int argc, char **argv) { + struct input *pw_input = init_input(true, true, "PASSWORD", 128); struct anic *heartbeat = init_anic(2,2); struct anic *a = init_anic(4,4); struct anic *b = init_anic(6,6); @@ -156,6 +158,7 @@ main(int argc, char **argv) register_anic(heartbeat, A_BOLD | COLOR_PAIR(3)); register_anic(a,0); register_anic(b,COLOR_PAIR(1)); + register_input(pw_input, COLOR_PAIR(2), 5, 5, 10, 5); if (run_ui_thrd() != 0) { exit(EXIT_FAILURE); } @@ -164,6 +167,8 @@ sleep(5); unregister_ui_elt(a); unregister_ui_elt(heartbeat); unregister_ui_elt(b); + unregister_ui_elt(pw_input); + free_input(pw_input); free_anic(heartbeat); free_anic(a); free_anic(b); return (0); @@ -36,6 +36,8 @@ input_cb(WINDOW *win, void *data, bool needs_update) } void -register_input(struct input *a, chtype attr) +register_input(struct input *a, unsigned int x, unsigned int y, unsigned int width, unsigned int height, chtype attr) { + WINDOW *wnd = newwin(y, x, width, height); + register_ui_elt(input_cb, (void *) a, wnd, attr); } @@ -1,5 +1,5 @@ -#ifndef UI_ANIC_H -#define UI_ANIC_H 1 +#ifndef UI_INPUT_H +#define UI_INPUT_H 1 #include <ncurses.h> @@ -21,6 +21,6 @@ int input_cb(WINDOW *win, void *data, bool needs_update); void -register_input(struct input *a, chtype attr); +register_input(struct input *a, unsigned int x, unsigned int y, unsigned int width, unsigned int height, chtype attr); #endif |