summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcinzelent <marcin@zelent.net>2017-08-09 10:16:36 +0200
committermarcinzelent <marcin@zelent.net>2017-08-09 10:16:36 +0200
commit2b29391c4f2611ba196ee4b55265d4f3e710ad02 (patch)
treeb9ccf19edbed16ef9bf44702a2979befd91b08f7 /timetracker.c
parent9a845595ebd15b88e1c684f5064efaa3d8a15dcb (diff)
Fixed input text overriding new activity description window.
Diffstat (limited to 'timetracker.c')
-rw-r--r--timetracker.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/timetracker.c b/timetracker.c
index 95067b5..797be53 100644
--- a/timetracker.c
+++ b/timetracker.c
@@ -134,15 +134,24 @@ void stop_new_activity()
void edit_new_activity()
{
WINDOW *win = newwin(10, 50, (LINES-10)/2, (COLS-50)/2);
+ int i = 1;
+
wborder(win, '|', '|', '-', '-', '+', '+', '+', '+');
mvwprintw(win, 1, 1, "What are you doing: ");
echo();
curs_set(1);
- mvwgetstr(win, 2, 1, new_activity.description);
+ //mvwgetstr(win, 2, 1, new_activity.description);
+ wmove(win, 2, 1);
+ while(1)
+ {
+ new_activity.description[i] = wgetch(win);
+ if(new_activity.description[i] == '\n') break;
+ if(i%48==0) wmove(win, i/48+2, 1);
+ i++;
+ }
noecho();
curs_set(0);
new_activity.description[strcspn(new_activity.description, "\n")] = 0;
- wrefresh(win);
}
char *create_data_files()