rthornton128 / goncurses

NCurses Library for Go
Other
383 stars 51 forks source link

LINES and COLS #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hey - is this a good idea?

func Lines() int {
    return int(C.LINES)
}

func Cols() int {
    return int(C.COLS)
}

I cant think of anything going wrong, and its useful for dealing with SIGWINCH. 
Of course it doesn't work without calling endwin() and refresh but its still 
convenient to get the new term size this way.

Original issue reported on code.google.com by mgs...@gmail.com on 10 Sep 2013 at 12:04

GoogleCodeExporter commented 9 years ago
Call Maxyx() on the stdscr (returned by Init()) to achieve the same thing. I 
have purposefully avoided writing any functions which call global variables 
like this whenever possible. Please let me know if the above doesn't meet your 
needs and I will consider implementing your suggestion.

Original comment by rthornto...@gmail.com on 10 Sep 2013 at 1:59

GoogleCodeExporter commented 9 years ago
Ahh that makes perfect sense - didnt cross my mind. Thanks a lot!

Original comment by mgs...@gmail.com on 10 Sep 2013 at 3:38

GoogleCodeExporter commented 9 years ago
Closing issue since the proposed solution works for OP.

Original comment by rthornto...@gmail.com on 12 Oct 2013 at 10:13