bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: readline-like program


From: Rick Engebretson
Subject: Re: readline-like program
Date: Sun, 16 Jan 2005 13:26:14 -0600

> ----------------------------------------------------------------------
>
> Message: 1
>
>
> I'm not sure if this is the appropriate forum, if it isn't then I
> would really appreciate any links you think might be useful.  I've
> been attempting to write a program that would have a readline-like
> interface.  After reading through the manpages it appears that I
> should be doing something like:
>
>   initscr();
>   cbreak();
>   noecho();
>   keypad(stdscr,TRUE);
>   for (;;) {
>     int a = getch();
>     /* do something */
>   }
>
> This sets the WINDOW size to the physical screen size, which is not
> what I want.  I want the rest of the terminal to be unaffected with
> just a single terminal-input line at the end.  I tried (and tried..)
> various combinations of setupterm and newwin, but I couldn't quite
> get it to work.  Is there a "curses" way to do this or am I stuck
> using termcap?
>
> Many Thanks,
>   Jim Strother
>
>
>
>
>
> ------------------------------
>
> Message: 2
>
> Generally curses deals with full-screen stuff (in part because some
> terminals used to behave radically different in full-screen vs
> command-line).  It does implement a function "filter()", which tells
> ncurses to limit itself to a single line.  There's an example in the
> ncurses sources (test/filter.c) which demonstrates this.
>
> -- 
> Thomas E. Dickey
>
>
>
> ------------------------------
>
> Message: 3
>
> Here's an article that places a menu on its own window, which I believe is
> pretty much what you want. The entire document (not just the one article)
> might give you some other tips.
>
>
http://www.troubleshooters.com/lpm/200405/200405.htm#_Putting_the_Menu_in_its_Own_Window
>
> HTH
>
> SteveT
> Steve Litt

----------------------------------------

Another approach to limiting ncurses screen size is to use the stty system
command. On a high resolution linux framebuffer console, "stty cols N" and
"stty rows M" tells the kernel driver that the console has only N x M
character area. Ncurses will fill only this area, leaving the rest of the
framebuffer screen free for other things. Probably not what you're looking
for, but somewhat related.
Rick.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]