rthornton128 / goncurses

NCurses Library for Go
Other
383 stars 51 forks source link

LINES and COLS? #65

Closed PopeFelix closed 2 years ago

PopeFelix commented 2 years ago

I'm brand new to ncurses programming. Apparently there are two constants, LINES and COLS, that allow you to determine the screen size. How do I access these using goncurses?

rthornton128 commented 2 years ago

Strictly speaking, LINES and COLS is used to get the size of the screen. GetMaxYX is used to get the size of windows. Unlike in C, in Goncurses you have a pointer to the screen and it's treated like a window, so you can actually fetch the size of the screen that way.

Example: https://github.com/rthornton128/goncurses/blob/db8d4cdb33a919912459437b53983909e96032d1/examples/getstr/getstr.go#L23

kpeters-cbsi commented 2 years ago

Thanks!