ncurses/forms...

ncurses/forms...

Post by Brant Partingto » Thu, 04 Jul 1996 04:00:00



help...
        I am having a problem using the forms and curses libraries.  I don't
know whether I am doing something dumb or what.  I am having two
problems which could both be stemming from the same thing...(1) When
receiving information from the user in a form, if the user types the
same character twice in a row, the second one does not show up until you
exit the field.  (2) Upon exiting a field, the last character is echoed
an extra time.

Upon typing 4 t's followed by 2 r's, this shows up: tt  r  
but after exiting the field this show's up:         ttttrrr
Notice the extra r that show's up.


#include <curses.h>
#include <form.h>
#include <stdlib.h>
#include <signal.h>
#include <stdio.h>
#include "formb.h"
#include "form.priv.h"  

void main(){
  FIELD *f[5];
  FORM *fo;
  int c;
  WINDOW *w;
int i;

  initscr();
  keypad(stdscr, TRUE);
  nonl();
  cbreak();
  noecho();

  f[0] = new_field(1, 10, 1, 0, 0, 1);
  f[1] = new_field(1, 50, 1, 20, 0, 1);
  set_field_opts(f[0], field_opts(f[0]) & ~O_ACTIVE);
  set_field_buffer(f[0], 0, "text...");
  f[2] = new_field(1, 10, 2, 0, 0, 1);
  f[3] = new_field(1, 50, 2, 20, 0, 1);
  set_field_opts(f[2], field_opts(f[2]) & ~O_ACTIVE);
  set_field_buffer(f[2], 0, "text...");
  f[4] = (FIELD *)NULL;
  fo = new_form(f);
  post_form(fo);
  refresh();
  for(;c!=0x02;){
    c=0;
    c=getch();
    switch(c){
    case '\t':
      form_driver(fo, REQ_SNEXT_FIELD);
      break;
    default:
      echochar(c);
      form_driver(fo, c);
      refresh();
      break;
    }
  }
  unpost_form(fo);
  endwin();
  exit(0);

Quote:}

Can anyone help?
 
 
 

1. ncurses form library

hi,

I have another problem with the form library, which is (I think) semilar to
the one with the menu library:

When I create the form and let the user enter data in the fields, nothing is
displayed in the fields until the user exits the fields to another field.
where did I go wrong?

btw, I may have the same problem as with the menu library, ie. specifying
the right window as main window and the one for sub-window.

10x, Ido.

2. Any body have cdrecord 1.9?!

3. ncurses/form SIGSEGV on free_field()

4. Setting menu Fonts under Netscape?

5. gcc, ncurses, forms, 1 second delay when escape is pressed.

6. Classless Subnetting and Solaris

7. ncurses/forms question

8. Two srcmstr's running on "console-challenged" systems

9. ncurses/forms...

10. help: ncurses - forms > How to get German Umlauts??

11. ncurses form library

12. ncurses/forms...

13. ncurses' forms library doesn't work.