You are not logged in.
Hi!
I have been started learning C++ and again trying to do something funny with ncurses. I have now problem which I could solve different ways, but of course if there is this easy way I would use it.
Is there any functions in ncurses which tells which character is in wanted cell? Example if I have character # in cell 6,10 how can I prove that?
If there is something what you didn't understand, just ask. English is not my native language, so there can be some misunderstandings.
Last edited by Scionar (2011-04-10 15:29:39)
Offline
I suggest you:
man 3 inch
man 3 inchstr
man 3 in_wch
man 3 inwstr
Taking your example (assume the target window is stdscr):
char ch = mvinch(10, 6) & A_CHARTEXT;
I didn't test it but it should be something like that.
(not native english too so I'm sorry if I made any mistakes).
Sorry in advance for my poor english...
Offline
Yeah! That mvinch-function worked well. Thanks.
I didn't add that "& A_CHARTEXT" to the end, but it worked anyway. I tried to add it anyway to the end, but it didn't make difference.
Let's play that we have # at 6,9:
if (mvinch(6,9) == '#') {
implementation
}
This executes the implementation.
Offline
I suggest you to keep "& A_CHARTEXT" in place. If you read the man page it's clear, the function return the *chtype* at the given position, it doesn't return a character. An attribute have 3 elements, the character, the attributes and the color. If you add colors in the future the value of chtype will not be '#' but '#' | YOU_COLOR_VALUE.
Last edited by Chippeur (2011-04-06 23:22:40)
Sorry in advance for my poor english...
Offline
Yeah! That mvinch-function worked well. Thanks.
When you have a chance, be sure to edit your original post and add the tag [SOLVED] to the thread title,
Thanks
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Online