Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LINES and COLS? #65

Closed
PopeFelix opened this issue Apr 24, 2022 · 2 comments
Closed

LINES and COLS? #65

PopeFelix opened this issue Apr 24, 2022 · 2 comments
Labels

Comments

@PopeFelix
Copy link

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
Copy link
Owner

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:

row, col := stdscr.MaxYX()

@kpeters-cbsi
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants