[GB.NCURSES]
* NEW: Screen.Beep() is a new method which makes an audible beep * NEW: Screen.Flash() produces a visual flash on the screen * BUG: Fix Window.ReadLine(): getnstr() doesn't return the input length git-svn-id: svn://localhost/gambas/trunk@7190 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
9d6820dd88
commit
1afd7010c6
2 changed files with 18 additions and 4 deletions
|
@ -158,6 +158,18 @@ BEGIN_METHOD_VOID(Screen_free)
|
|||
END_METHOD
|
||||
#endif
|
||||
|
||||
BEGIN_METHOD_VOID(Screen_Beep)
|
||||
|
||||
beep();
|
||||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_METHOD_VOID(Screen_Flash)
|
||||
|
||||
flash();
|
||||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_METHOD_VOID(Screen_Refresh)
|
||||
|
||||
SCREEN_refresh();
|
||||
|
@ -242,6 +254,8 @@ GB_DESC CScreenDesc[] = {
|
|||
GB_EVENT("Resize", NULL, NULL, &EVENT_Resize),
|
||||
|
||||
GB_STATIC_METHOD("_init", NULL, Screen_init, NULL),
|
||||
GB_STATIC_METHOD("Beep", NULL, Screen_Beep, NULL),
|
||||
GB_STATIC_METHOD("Flash", NULL, Screen_Flash, NULL),
|
||||
GB_STATIC_METHOD("Refresh", NULL, Screen_Refresh, NULL),
|
||||
GB_STATIC_METHOD("Resize", NULL, Screen_Resize, "(Lines)i(Cols)i"),
|
||||
|
||||
|
|
|
@ -501,14 +501,14 @@ END_METHOD
|
|||
BEGIN_METHOD_VOID(Window_ReadLine)
|
||||
|
||||
char line[256]; /* XXX: Must be enough! */
|
||||
int len;
|
||||
int ret;
|
||||
|
||||
len = getnstr(line, sizeof(line) - 1);
|
||||
if (len == ERR) {
|
||||
bzero(line, sizeof(line));
|
||||
ret = wgetnstr(THIS->main, line, sizeof(line) - 1);
|
||||
if (ret == ERR) {
|
||||
GB.ReturnNull();
|
||||
return;
|
||||
}
|
||||
line[len] = 0;
|
||||
GB.ReturnNewZeroString(line);
|
||||
|
||||
END_METHOD
|
||||
|
|
Loading…
Reference in a new issue