From: ewt Date: Tue, 16 May 2000 16:54:02 +0000 (+0000) Subject: added cursor on/off stuff X-Git-Tag: r0-50-12~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23efd09b23efbc02707762572e213112bf594b67;p=thirdparty%2Fnewt.git added cursor on/off stuff --- diff --git a/entry.c b/entry.c index 9befda4..6ac48de 100644 --- a/entry.c +++ b/entry.c @@ -190,7 +190,7 @@ static struct eventResult entryEvent(newtComponent co, if (ev.when == EV_NORMAL) { switch (ev.event) { case EV_FOCUS: - /*SLtt_set_cursor_visibility(0);*/ + newtCursorOn(); if (en->flags & NEWT_FLAG_HIDDEN) newtGotorc(co->top, co->left); else @@ -200,7 +200,7 @@ static struct eventResult entryEvent(newtComponent co, break; case EV_UNFOCUS: - /*SLtt_set_cursor_visibility(1);*/ + newtCursorOff(); newtGotorc(0, 0); er.result = ER_SWALLOWED; if (co->callback) diff --git a/newt.c b/newt.c index 3d372b0..677ddd0 100644 --- a/newt.c +++ b/newt.c @@ -202,10 +202,9 @@ int newtInit(void) { SLang_init_tty(0, 0, 0); newtSetColors(newtDefaultColorPalette); + newtCursorOff(); /*initKeymap();*/ - /*SLtt_set_cursor_visibility(0);*/ - /*memset(&sa, 0, sizeof(sa)); sa.sa_handler = handleSigwinch; sigaction(SIGWINCH, &sa, NULL);*/ @@ -220,6 +219,7 @@ int newtInit(void) { int newtFinished(void) { SLsmg_gotorc(SLtt_Screen_Rows - 1, 0); + newtCursorOn(); SLsmg_refresh(); SLsmg_reset_smg(); SLang_reset_tty(); @@ -655,3 +655,11 @@ void newtDefaultPlaceHandler(newtComponent c, int newLeft, int newTop) { void newtDefaultMappedHandler(newtComponent c, int isMapped) { c->isMapped = isMapped; } + +void newtCursorOff(void) { + SLtt_set_cursor_visibility (0); +} + +void newtCursorOn(void) { + SLtt_set_cursor_visibility (1); +} diff --git a/newt.h b/newt.h index 28ad8b5..1f16287 100644 --- a/newt.h +++ b/newt.h @@ -125,6 +125,8 @@ void newtRedrawHelpLine(void); void newtPopHelpLine(void); void newtDrawRootText(int col, int row, const char * text); void newtBell(void); +void newtCursorOff(void); +void newtCursorOn(void); /* Components */ diff --git a/popcorn.py b/popcorn.py index 96b44bf..e300f4e 100755 --- a/popcorn.py +++ b/popcorn.py @@ -48,8 +48,6 @@ r2 = SingleRadioButton("Radio 2", r1) def something(): print hello -e.setCallback(sys.exit, 1) - screen = SnackScreen() screen.helpCallback(help)