Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/main.c @ 151:b69c0b7a23e3
[/trunk] Changeset 163 by mikael
* Window resize handling 8-)
author | mikael |
---|---|
date | Sun, 01 May 2005 03:14:19 +0000 |
parents | 9f74832eb4f8 |
children | 05f606cfb9e4 |
comparison
equal
deleted
inserted
replaced
150:5647381a7dfb | 151:b69c0b7a23e3 |
---|---|
79 int key; | 79 int key; |
80 unsigned int port; | 80 unsigned int port; |
81 unsigned int ping; | 81 unsigned int ping; |
82 int ssl; | 82 int ssl; |
83 int ret = 0; | 83 int ret = 0; |
84 unsigned int refresh = 0; | |
84 | 85 |
85 credits(); | 86 credits(); |
86 | 87 |
87 /* SET THIS >0 TO ENABLE LOG */ | 88 /* SET THIS >0 TO ENABLE LOG */ |
88 ut_InitDebug(0, NULL); | 89 ut_InitDebug(0, NULL); |
148 /* Initialize N-Curses */ | 149 /* Initialize N-Curses */ |
149 ut_WriteLog("Initializing N-Curses...\n"); | 150 ut_WriteLog("Initializing N-Curses...\n"); |
150 scr_InitCurses(); | 151 scr_InitCurses(); |
151 | 152 |
152 ut_WriteLog("Drawing main window...\n"); | 153 ut_WriteLog("Drawing main window...\n"); |
153 scr_DrawMainWindow(); | 154 scr_DrawMainWindow(TRUE); |
154 | 155 |
155 optstring = cfg_read("logging"); | 156 optstring = cfg_read("logging"); |
156 if (optstring && (atoi(optstring) > 0)) | 157 if (optstring && (atoi(optstring) > 0)) |
157 hlog_enable(TRUE, cfg_read("logging_dir")); | 158 hlog_enable(TRUE, cfg_read("logging_dir")); |
158 | 159 |
192 | 193 |
193 ut_WriteLog("Entering into main loop...\n\n"); | 194 ut_WriteLog("Entering into main loop...\n\n"); |
194 ut_WriteLog("Ready to send/receive messages...\n"); | 195 ut_WriteLog("Ready to send/receive messages...\n"); |
195 | 196 |
196 jb_reset_keepalive(); | 197 jb_reset_keepalive(); |
197 keypad(scr_GetInputWindow(), TRUE); | |
198 while (ret != 255) { | 198 while (ret != 255) { |
199 key = scr_Getch(); | 199 key = scr_Getch(); |
200 | |
201 // The refresh is really an ugly hack, but we need to call doupdate() | |
202 // from time to time to catch the RESIZE events, because getch keep | |
203 // returning ERR until a real key is pressed :-( | |
200 if (key != ERR) | 204 if (key != ERR) |
201 ret = process_key(key); | 205 ret = process_key(key); |
206 else if (++refresh % 2) | |
207 doupdate(); | |
208 | |
202 jb_main(); | 209 jb_main(); |
203 if (update_roster) | 210 if (update_roster) |
204 scr_DrawRoster(); | 211 scr_DrawRoster(); |
205 } | 212 } |
206 | 213 |