Enhancements - Context::getWidth

- Added help function to reduce general code size.
This commit is contained in:
Paul Beckingham 2009-06-10 00:35:37 -04:00
parent 8dfe4bd30a
commit 2da4f8ba7a
4 changed files with 39 additions and 128 deletions

View file

@ -126,3 +126,20 @@ int Context::interactive ()
}
////////////////////////////////////////////////////////////////////////////////
int Context::getWidth ()
{
// Determine window size, and set table accordingly.
int width = config.get ("defaultwidth", (int) 80);
#ifdef HAVE_LIBNCURSES
if (config.get ("curses", true))
{
WINDOW* w = initscr ();
width = w->_maxx + 1;
endwin ();
}
#endif
return width;
}
////////////////////////////////////////////////////////////////////////////////