| MatthewRock (34) | |||
|
Hello. I wanted to ask few things about Curses library, I decided that my topic will fit here best. I've recently started working on Curses library. I want to learn how to use it. I'm using tutorial( http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/index.html ). Ignoring the fact that I couldn't figure out how to use mouse, as tutorial on site won't work here, I've decided to create a simple program. My program has to create a window(Fixed size), and allow user to move it with arrows. After each move program outputs in the window that moved coordinates of its 4 corners. If user press enter, program exits. I've created this code(I'm really sorry for it, I'm bad at making it readable):
Actually both functions allowing me to move window are not efficient(constantly creating and destroying window), but the other solution presented of site(which looked rather like a trick, that with creating window-like structure was used to setup borders of 'window', but no real window was created; I decided to stick to window using). Now I've got two problems: 1)I can't see what I wrote. If windows leaves border of console(so it disappears) I can see what is written there. But not before(maybe sometimes, for half a second). Theoretically it looks like window was covering the strings, but first - window is created before strings are wrote, second - in order to do so it had to create black space in its middle. So I don't know what to do with that. Tried changing colour, but didn't work. 2)I don't really know how to use refresh(); . It's rather question than problem :) When I write some of the easy programs, it doesn't matter if I use refresh or not. In other it counts. When do I use refresh? Thanks for your help guys.:) | |||
|
|
|||
| Peter87 (3691) | |
I think you should put wrefresh(okno); between line 37-38. I don't think you need refresh() on line 29 because you don't update the stdscr window (default window). | |
|
|
|