linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Earl R. Lapus" <elapus@ntsp.nec.co.jp>
To: linux-c-programming@vger.kernel.org
Subject: ncurses problem
Date: Thu, 10 Feb 2005 18:24:29 +0800	[thread overview]
Message-ID: <420B365D.7090109@hq.ntsp.nec.co.jp> (raw)

[-- Attachment #1: Type: text/plain, Size: 453 bytes --]

hi there,

i have a problem using ncurses. i attached the source code with this email.
this program displays two text fields. my problem occurs when i add this,
`char buff[256];` after the declaration, `int ch;`.
after adding the character array declaration, the text fields won't 
display anymore.
any ideas?

-earl-.

-- 
==========================================
  There are seven words in this sentence.
==========================================


[-- Attachment #2: nform.c --]
[-- Type: text/x-csrc, Size: 1199 bytes --]

#include <form.h>


int main(void)
{
    int ch;

    FORM *formp;
    FIELD *fields[2];

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

    fields[0] = new_field(1, 32, 4, 18, 0, 0);
    fields[1] = new_field(4, 32, 6, 18, 0, 0);

    set_field_back(fields[0], A_STANDOUT);
    field_opts_off(fields[0], O_AUTOSKIP); 

    set_field_back(fields[1], A_STANDOUT);
    field_opts_off(fields[1], O_AUTOSKIP);

    formp = new_form(fields);
    post_form(formp);
    refresh();

    mvprintw(4, 5, "IP Address:");
    mvprintw(6, 5, "Message:");
    move(4, 18);
    refresh();

    while( (ch = getch()) != KEY_F(1) )
    {
       switch(ch)
       {
          case KEY_DOWN: 
               form_driver(formp, REQ_NEXT_FIELD);
               form_driver(formp, REQ_END_LINE); 
               break;

          case KEY_UP:
               form_driver(formp, REQ_PREV_FIELD);
               form_driver(formp, REQ_END_LINE); 
               break;

          default: 
               form_driver(formp, ch);
               break;
       }
    }

    unpost_form(formp);
    free_form(formp);
    free_field(fields[0]);
    free_field(fields[1]);
  
    endwin();

    return 0;
}

             reply	other threads:[~2005-02-10 10:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-10 10:24 Earl R. Lapus [this message]
2005-02-10 14:28 ` ncurses problem Rechberger Markus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=420B365D.7090109@hq.ntsp.nec.co.jp \
    --to=elapus@ntsp.nec.co.jp \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).