]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
added cursor on/off stuff
authorewt <ewt>
Tue, 16 May 2000 16:54:02 +0000 (16:54 +0000)
committerewt <ewt>
Tue, 16 May 2000 16:54:02 +0000 (16:54 +0000)
entry.c
newt.c
newt.h
popcorn.py

diff --git a/entry.c b/entry.c
index 9befda44a67ad86329cd330f4355f04f7be48810..6ac48de8000669451f3067aef01f9717259d9063 100644 (file)
--- 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 3d372b03a7ebebcf49388f5e15aa2e77ac88b2c1..677ddd0e81dfc1032ce880d4e9b52b51ffc4f60e 100644 (file)
--- 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 28ad8b59a08a443d826c9436b303a08232bd72ae..1f16287ac3bbab58f3e6435aa1a2b57a26edf69f 100644 (file)
--- 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 */
 
index 96b44bf362505422f8d5edd17ba03324a8108ce6..e300f4ec7c4d80d8d01926bccb2ef6173124f851 100755 (executable)
@@ -48,8 +48,6 @@ r2 = SingleRadioButton("Radio 2", r1)
 def something():
     print hello
 
-e.setCallback(sys.exit, 1)
-
 screen = SnackScreen()
 
 screen.helpCallback(help)