Thread: ncurses menu question

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    2

    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

    Code:
    int main()
    {
    //ncurses init is done here
    
    printw("A nifty title is located here\n"); //
    	post_menu(my_menu);
    	refresh();
    //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
    Location
    Canada
    Posts
    8,057
    Call move()? mvaddstr()? Something like that?

    See the ncurses man pages or an online version.

    [edit] Here's an ncurses tutorial: http://www.cs.mun.ca/~rod/ncurses/ncurses.html

    Scroll down to "Standard Windows and Function Naming Conventions" to see how functions are named, including move() variants: http://www.cs.mun.ca/~rod/ncurses/ncurses.html#overview

    Once you know more about ncurses, the man page is a great read: http://www.hmug.org/man/3/ncurses.php

    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.
    dwk

    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: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    2
    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