SGI window size.

Conn Copas cvc at
Fri Jun 23 08:00:00 EDT 1995

Re the initial size of the SGI window, I posted some code a while ago for
automatically sizing the X window according to the aspect ratio of the data in
the current region. I mentioned that I had done the same for the SGI if people
wanted more details, and that offer still stands.

Briefly, here is what I have added to Graph_Set.c:

char *Prog;
    int pref_rows,pref_cols, x_left,y_top;

    setpgrp (); /* avoid signal problems */

/*    prefsize(pref_cols,pref_rows);
    prefposition(x_left,x_left+pref_cols,y_top,y_top+pref_rows); */


    if (0 > winopen (Prog))
        fprintf (stderr, "Cannot open graphics window\n"), exit (-1);



prefsize/2, prefposition/4, keepaspect/2, and winposition/4 are all part of
the SGI graphics library; take a look at the man pages.

get_aspect/3 is something I wrote which takes a look at the aspect ratio of
the current region, and scales up the rows and columns if considered necessary.

get_user/3 is something I used from the XDRIVER which takes a look in the
.grassrc file to see whether certain parameters are defined. If not, it
substitutes arg 3 as the default.

Conn V Copas
Information Technology Division
Defence Science and Technology Organisation
PO Box 1500
Salisbury            tel: +61 (0)8 25 95349
SA  5108             fax: +61 (0)8 25 96781
Australia       e-mail: cvc at

More information about the grass-dev mailing list