Automatic Screen Size Manipulation

Hello. Is there a way to programatically maximize a unix window? I am using X term and the scripts shows menus that need to fit within a specific screen size. I want to detect the screen size and advise the user to maximize thier screen if less than what is needed to correctly show the menus.

Thanks.

It's not possible to automatically resize the window and still be portable. I do know that the rows and columns can be read though.

If you can use C:

// Must link in libcurses.so with -lcurses to use curses
#include <curses.h>
#include <stdio.h>

int main()
{
  int x=-1, y=-1;
  WINDOW *w=initscr();
  if(w == NULL)
    return(1);

  x=w->_maxx - w->_curx;
  y=w->_maxy - w->_cury;

  endwin();

  printf("Console is %d x %d\n",x,y);

  return(0);
}