Window#move does not change the window's position and returns -1
Closed this issue · 4 comments
snacks02 commented
maiha commented
I'm not well familiar with curses , but I think move
is an operation about text.
Could you try x, y on Window
?
module Crt
class Window
def initialize(@row = -1, @col = -1, y = 0, x = 0)
snacks02 commented
Yup. If I'm changing x
and y
then it works nice.
The solution is inheritance then I guess? Something like this:
class SecondWindow < Crt::Window
def initialize(@row = -1, @col = -1, y = 3, x = 3)
Crt.init
@row = Crt.y if @row < 0
@col = Crt.x if @col < 0
@winp = LibNcursesw.newwin(@row, @col, y, x)
end
end
maiha commented
Running the crystal and c libraries works much the same. So it would be nice to find a sample of c that works for ncurses multiple windows first.
Then, I can help you with how to translate the c sample to the crystal, or how to write it in crt.cr.