Discussion:
[Tutor] ncurses question
bruce
2015-10-30 20:06:44 UTC
Permalink
Hi.

Looking over various sites on ncurses. Curious. I see various chunks
of code for creating multiple windows.. But I haven't seen any kind of
example that shows how to 'move' or switch between multiple windows.

Anyone have any code sample, or any tutorial/site that you could point me to!

I'm thinking of putting together a simple test to be able to select
between a couple of test windows, select the given field in the
window, and then generate the results in a lower window based on
what's selected..

Just curious. Any pointers, greatly appreciated.

Thanks
_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Laura Creighton
2015-10-30 21:39:19 UTC
Permalink
Post by bruce
Hi.
Looking over various sites on ncurses. Curious. I see various chunks
of code for creating multiple windows.. But I haven't seen any kind of
example that shows how to 'move' or switch between multiple windows.
Anyone have any code sample, or any tutorial/site that you could point me to!
I'm thinking of putting together a simple test to be able to select
between a couple of test windows, select the given field in the
window, and then generate the results in a lower window based on
what's selected..
Just curious. Any pointers, greatly appreciated.
Thanks
I went looking and found this:
http://www.tuxradar.com/content/code-project-build-ncurses-ui-python#null

but I think you are going to have to believe Eric Raymond when
he mentions here:
http://invisible-island.net/ncurses/ncurses-intro.html

newterm(type, ofp, ifp)
A program which outputs to more than one terminal should use
newterm() instead of initscr(). newterm() should be called once
for each terminal. It returns a variable of type SCREEN * which
should be saved as a reference to that terminal. (NOTE: a SCREEN
variable is not a screen in the sense we are describing in this
introduction, but a collection of parameters used to assist in
optimizing the display.) The arguments are the type of the
terminal (a string) and FILE pointers for the output and input of
the terminal. If type is NULL then the environment variable $TERM
is used. endwin() should called once at wrapup time for each
terminal opened using this function.

set_term(new)
This function is used to switch to a different terminal previously
opened by newterm(). The screen reference for the new terminal is
passed as the parameter. The previous terminal is returned by the
function. All other calls affect only the current terminal.

That paper is talking about ncurses and C, but since as far as I
know all that the python bindings do is wrap the same things, it
should be true there, as well. But I have no working code, so
take this with the appropriate amount of salt ....

Laura
_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Loading...