aboutsummaryrefslogtreecommitdiff
path: root/src/application.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/application.c')
-rw-r--r--src/application.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/application.c b/src/application.c
index a56fd43..74641c5 100644
--- a/src/application.c
+++ b/src/application.c
@@ -34,10 +34,17 @@ application_init(MESSENGER_Application *app,
34 app->argc = argc; 34 app->argc = argc;
35 app->argv = argv; 35 app->argv = argv;
36 36
37 initscr(); 37 app->window = initscr();
38
39 if (!(app->window))
40 {
41 app->status = GNUNET_SYSERR;
42 return;
43 }
44
38 noecho(); 45 noecho();
39 46
40 keypad(stdscr, TRUE); 47 keypad(app->window, TRUE);
41 timeout(100); 48 timeout(100);
42} 49}
43 50
@@ -49,6 +56,9 @@ run (void *cls,
49{ 56{
50 MESSENGER_Application *app = cls; 57 MESSENGER_Application *app = cls;
51 58
59 if (!(app->window))
60 return;
61
52 chat_start(&(app->chat), app, cfg); 62 chat_start(&(app->chat), app, cfg);
53} 63}
54 64
@@ -71,6 +81,9 @@ application_run(MESSENGER_Application *app)
71 81
72 messages_clear(&(app->messages)); 82 messages_clear(&(app->messages));
73 83
84 if (app->window)
85 delwin(app->window);
86
74 endwin(); 87 endwin();
75} 88}
76 89