Enventually I tried to do it with urwid which is way higher level than ncurse.
I asked a question about it on SO and didn't got more results.
But eventually I found some FOSS that did just that, I used the source code and made something that worked. You can find the answer in the related question.