Thread: ncurses menu question

  1. #1
    Registered User
    Join Date
    Nov 2006

    ncurses menu question

    hey everybody,

    I wrote a little menu in ncurses and everything runs great. However, i'm having a bit of trouble adding a line right before the menu.

    This is what my code looks like when i try to add a title

    int main()
    //ncurses init is done here
    printw("A nifty title is located here\n"); //
    //more stuff here to interact with the menu
    return 0;
    basically, the menu is always position at 0,0, thus overwritting any string before the menu. Is there a way to change the position of the menu?

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Call move()? mvaddstr()? Something like that?

    See the ncurses man pages or an online version.

    [edit] Here's an ncurses tutorial:

    Scroll down to "Standard Windows and Function Naming Conventions" to see how functions are named, including move() variants:

    Once you know more about ncurses, the man page is a great read:

    BTW, I found that stuff by googling for "ncurses tutorial" and "man ncurses". It's not hard to find. [/edit]
    Last edited by dwks; 11-07-2006 at 01:55 PM.

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell

    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ:

    My website:
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Registered User
    Join Date
    Nov 2006
    i did google and find all those links (including the man)..

    those all work correctly if i don't have the menu (ie i comment out post_menu(my_menu)). mvaddch will not move the menu down, it will just be painted on top of everything..

    move(2, 0); ---> move the cursor down by 2

    post_menu is still posted at 0,0, thus, overwritting everything that i have moved

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 03-26-2009, 02:47 PM
  2. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 03:25 PM
  3. Very simple question, problem in my Code.
    By Vber in forum C Programming
    Replies: 7
    Last Post: 11-16-2002, 03:57 PM
  4. Menu stuff
    By Shadow in forum C Programming
    Replies: 10
    Last Post: 04-28-2002, 09:05 AM
  5. quick question about C Dos text menu pgm i was doing
    By Shadow in forum C Programming
    Replies: 2
    Last Post: 09-16-2001, 10:26 AM